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 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.
|target class is the class 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 to upcast.|
|generic class reference is the upcasted reference. If an error occurs, generic class reference is Not A Refnum.|
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 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.