LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can your typecast a Generic Class RefNum to its more Specific Class representation

I can find the Class ID of a Generic Class RefNum, but how can I use this to TypeCast the control into it's Specific Class RefNum.
0 Kudos
Message 1 of 3
(3,369 Views)
Since you already have the Class ID to data type conversion VI, the next thing you need to do is downcast to the more specific type. You can change the class specifier constant from its default "generic" type to a more specific type by right-clicking on it and navigating the "Select VI Server" sub-menu. You can also wire strict references (front panel control references) into the downcast node. You will get an error if you try to cast to a type that is not the same as your control. You can do a process of elimination in a for loop to make sure that it hits its correct type.

This is a pretty cool topic, Chris. There are LOTS of neat applications. If you email me at jkring@calbay.com I will send you an NI Week presentation given by Rob Dye on control references.
It includes a lot of other useful information that will help you get the most out of control references.

-Jim Kring
0 Kudos
Message 2 of 3
(3,369 Views)
Chris,
Jim's answer is right there, also, for a recent example of downcasting using references, look at the attached, specifically Jean-Pierre's example vi. Good Luck with this, Doug

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=50650000000800000005290000&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0
0 Kudos
Message 3 of 3
(3,369 Views)