LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What datatype are SringsAndValues[]?

Okay, I have a cluster with a couple ring controls in it.  If I create a property node directly from the ring control, Value is U16.  If I try to read the control by refnum, Value is EXT.  So, which is it really?  (see attached image)
0 Kudos
Message 1 of 3
(2,571 Views)

Hello,

The datatype of the Ring is a U16.  The reason they are different in your VI is that the implicit property node is going to give you access to the exact data type for the control (in other words, the implicit property node "knows" exactly what kind of ring you're dealing with, since it is implicitly linked to the front panel object), whereas the Ring reference that you have casted from the more generic Control class isn't strictly typed, so the datatype it provides for the Ring value is the most all-encompassing numeric datatype there is...specifically, the EXT datatype.  To my knowledge, there is no way to gain access to a strict representation of a control that you obtain from the "Controls[]" property of the Panel or Cluster classes.

I hope that explanation made sense.  You can read more about strict typing in the LabVIEW Help.

-D
Message 2 of 3
(2,558 Views)
As an addition to what Darren said, here's another nice aspect to LV's polymorphism - if you wire the reference from your own ring into the top terminal of the To More Specific Class VI, the result will be strict and you will have the correct data type.
 
Other than that, you can always try extracting the type descriptor (every control has this property) and use that to see the data types. Look at OpenG's data manipulation VIs for more on this.

___________________
Try to take over the world!
Message 3 of 3
(2,544 Views)