06-06-2009 06:50 AM
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
Solved! Go to Solution.
06-06-2009 07:13 AM
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?
06-06-2009 07:40 AM
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
06-06-2009 07:49 AM
06-06-2009 10:40 AM
GerdW wrote:you should find that property where all the others are found
![]()
Well, I think this property is normally not exposed. Gerd, did you enable scripting? 😮
06-06-2009 11:55 AM
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).
06-06-2009 12:22 PM
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. "
06-06-2009 08:52 PM
06-07-2009 09:15 AM - edited 06-07-2009 09:16 AM
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):