LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

variant downcast

Hi to all,
playing a bit with Labview classes I found a behaviour unexpected; in particular downcasting (with To More Specific Class function) the Control class to the String class and wiring this reference to a property node the 'Value' property is a String type.
But downcasting to the Digital class yelds a reference whom 'Value' property is a Variant type.
Maybe this is dued to the fact that the Digital class is not 'Strict' or whatever?
Anyone figure out what's happening?
See the attached Vi for example

Thanks,
manga


0 Kudos
Message 1 of 3
(2,745 Views)
Yes, it is because the Digital constant is not strict.  A numeric (Digital type) can be either Unsigned Integer, Signed Integer, Floating Point, or Complex Floating Point and varying sizes of these (for example U8, U32, SGL, DBL).  As such, the Value of a non-strict Digital is a Variant because it is not known exactly which type it is until run time.
Message 2 of 3
(2,743 Views)
Thanks Jim

manga
0 Kudos
Message 3 of 3
(2,732 Views)