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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Extract variable name

Solved!
Go to solution

Hi,

 

I'm trying to modify the OpenG changed? subVI (shown below) so that it will write the new value of the variable sent to "Variant" if changed to disk (using the config VI suite). To do this I need to somehow extract the variable name of the variable (any type) which has been connected to the variant input of the changed? subVI by the calling VI so that I can use it as a key name. Is this possible? Is this information even forwarded to the subVI?

 

 

changed.png

0 Kudos
Message 1 of 6
(3,123 Views)
The "Get Data Name" VI from the OpenG LabVIEW Data Tools library will return the name of the control.
0 Kudos
Message 2 of 6
(3,107 Views)
Solution
Accepted by topic author budtz

If you are using openg, there is a 'Get Data Name' function that extracts the name of the data passed into the variant.

 

 

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 6
(3,104 Views)

Thanks for the reply guys! I hadn't noticed that little gem.

 

A follow-up question: is there a way to create a reference to a variable (in the self-VI) purely based to the variable label name and then setting the variable value? This, of course, is the "Read config file" part of the above.

 

Casper

0 Kudos
Message 4 of 6
(3,075 Views)

Not sure if this is what you are after:

 

Get callers name

Open reference to caller VI

Get Vi property Controls[]

Itterate on controls ref until name property is a match

Set the vaule variant on the control.

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 5 of 6
(3,061 Views)
@OP: You should be a little more precise in your terminology. In LabVIEW there are no variables. You can consider wires to be variables, but that's more for text-based programmers. Front panel items are either controls, indicators, containers, or decorations.
Message Edited by smercurio_fc on 06-24-2009 11:52 AM
0 Kudos
Message 6 of 6
(3,055 Views)