To More Generic Class Function

Owning Palette: Application Control VIs and Functions

Requires: Base Development System

Typecasts a reference, such as a control or a type definition, to a more generic class or interface in the inheritance hierarchy.

For example, if Class A inherits from Class B, the function upcasts a variable of type A to a variable of type B.

You can use the To More Generic Class function for casting any class hierarchy in LabVIEW, including VI Server refnums, .NET/ActiveX refnums, and LabVIEW classes or interfaces.

Details  

 Add to the block diagram  Find on the palette
target class is the class or interface to which you want to upcast reference. You can wire a class specifier constant or any wire of the target type to this input.
reference is the refnum or LabVIEW class or interface to upcast.
generic class reference is the upcasted reference. If an error occurs, generic class reference is Not A Refnum.

To More Generic Class Details

This function does not have error in and error out parameters because LabVIEW can determine at edit time whether you have wired the reference to a compatible target class. If you wire the reference to an incompatible target class, the wire breaks and you receive a Class conflict error.

You can use the To More Generic Class function to manipulate the properties or methods from a more generic class or interface than that of the reference. For example, you can wire an enum control reference to the To More Generic Class function to upcast the reference to the Numeric class. You then can manipulate the Numeric class properties of the control, but you no longer can access the specific properties of the Enum class.

Wire a Fa�ade VI refnum to reference and a VI refnum to target class to upcast from Fa�ade VI to VI.

Related Information

Casting LabVIEW Classes