LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to determine the representation of a Numeric control via property?

Solved!
Go to solution

All,

This may be a silly question.  Is there a way to determine the representation of a numeric control from its reference?  For example U8 vs. DBL. I want to populate the data from a file to a vi then run it.  I can't seam to find the property that I need.

 

Thanks,

Rich

0 Kudos
Message 1 of 9
(4,504 Views)

Hi Rich,

 

well, you could parse the "type descriptor" property of the numeric control to get it's representation (or use the appropriate function found somewhere at OpenG).

 

But how should that help you in loading a file? How do you want to "populate data to a vi"?What do you want to achieve exactly?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(4,498 Views)

I am writ a utility that will not allow check in to SRCC if he vi violates certain unit tests.  Therefore I need to use a second vi to open, populate and run the vi under test.  So,  I have to get the controls of the vis under test via a reference of the front panel, then make the references more specific to enable access without variants.  Where do I find the "type descriptor" property?  It still alludes me!

Thanks again!

Rich

0 Kudos
Message 3 of 9
(4,494 Views)
Solution
Accepted by topic author rwelch

Hi Rich,

 

you should find that property where all the others are found Smiley Wink

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 9
(4,491 Views)

GerdW wrote:

you should find that property where all the others are found Smiley Wink


Well, I think this property is normally not exposed. Gerd, did you enable scripting? 😮

0 Kudos
Message 5 of 9
(4,472 Views)

Hi Altenbach,

 

no, I only have a standard LV7.1 installation on my company's laptop... And LV help also explains this property without mentioning any scripting (section "property and method reference -> vi server -> GObject ->control).

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 9
(4,468 Views)

Ah, I cannot find it in 8.5. I think significant changes were made somewhere, so things are quite different now. I don't remember the details, but it was discussed once. I am sure somebody has more information.

 

For example, flatten to string has a type output in 7.1 (7.1 help page), while it does not in 8.5 (8.5 help page) unless it was upgraded from an old version where this output was wired. The 8.5 help has more details on the changes:

 

"If you need to flatten type descriptor data to a string that is readable by LabVIEW 7.x or earlier, right-click this function and select Convert 7.x Data from the shortcut menu. In Convert 7.x Data mode, this function shows the type string (7.x only) output and displays the icon for this function with a red 7.x on it. LabVIEW 7.x and earlier stores type descriptors in 16-bit flat representation. LabVIEW 8.0 and later stores type descriptors in 32-bit flat representation. National Instruments recommends reworking any application that uses the Convert 7.x Data mode as a long term solution. "

 

Message 7 of 9
(4,465 Views)
GerdW, Thank You! I am using 8.6.1 and it is not visible. Howerver if I cut and paste from your example it all works! Thanks again! Rich
0 Kudos
Message 8 of 9
(4,440 Views)

As Gerd initially noted, you can do this using the OpenG functions (the example uses the "Get TDEnum From Data" VI from the "LabVIEW Data Tools" library):

 

 

Message Edited by smercurio_fc on 06-07-2009 09:16 AM
0 Kudos
Message 9 of 9
(4,407 Views)