Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

To More Generic Class Function

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

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.

Details  

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.

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 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.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit