From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
10-17-2018 06:21 AM - edited 10-17-2018 06:37 AM
If I open a control file (.ctl) that is a striclty type VI reference using the Open VI Reference function, how can I get the data type as a variant or similar during runtime showing the connector signature?
The front panel control only returns a raw refnum value not the data type.
E.g. for this type def control, I would like to get this information:
10-17-2018 06:54 AM - edited 10-17-2018 06:55 AM
This seems to work.
Now to decode the type string data...
10-17-2018 10:01 PM
Look in the Data Type Parsing palette.
10-18-2018 01:57 AM - edited 10-18-2018 01:58 AM
Thanks Paul. I'd originally dismissed that palette as the Get Refnum Information didn't return enough information, but I just had another look and found the Get VI Information which works great. Completely missed that one!
I see that I can get the wiring rules from the VI Info > Flags array and the terminal data from the VI Terminal Types variant array.
That certainly saves a lot of work, if only I'd seen it sooner.
10-18-2018 03:45 AM - edited 10-18-2018 03:49 AM
Edit: I was wrong. Get VI Information doesn't work directly for controls containing a Strictly Typed VI Reference and using the ConnectorPane.DataType variant. It needs the Strict Type variant from Get Refnum Information.
10-18-2018 04:53 AM - edited 10-18-2018 04:57 AM
The Type def is a VI, it has a front panel.
Use All Controls[], and get the first (and only) control. From there on, it's the same as any other control reference.
Do close some refs...
Untested (don't use much type defs anymore), but pretty sure it works.
10-18-2018 05:43 AM - edited 10-18-2018 05:44 AM
Thanks. That also works and has an immediate benefit of not requiring scripting. I wonder how it weighs up on efficiency when compared to using the Connector Pane : Data Type property.
I was worried that controls may have their front panel removed and converted into some special case when compiled, but it looks like it is always guarenteed to have one.