LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get value of local variable based off of list of names

Hey All,

 

I recently posted some test code, where I could take in an array of variables, and then append a message from a list onto a string, based off of each local variable being true or false.  This code works, but it occurred to me that it is not very modular, and might be much easier to use if, instead of providing the vi an array of bools and an array of messages, I could provide it an array of the NAMES of the bools.

 

Is there a get variable value based off it's name function?

 

Thanks! 

--
Jim S
GRA/Colorado School of Mines
0 Kudos
Message 1 of 4
(2,579 Views)
You could create an array of references of the controls or indicators that the local variables refer to.  Then you can feed that reference into a property node for Value.  That way you can loop through the array of references and use other property nodes like Label.Text to determine if you are looking at the reference you are interested in.
0 Kudos
Message 2 of 4
(2,572 Views)

Could you clarify on creating an array of references?  The property node part makes sense, I'm unsure as to where I should look for the reference for the local vars.

 

 

--
Jim S
GRA/Colorado School of Mines
0 Kudos
Message 3 of 4
(2,564 Views)

Hi Jim,

 

you don't get references to local vars - you get references to controls and indicators (front panel objects).

 

Either you get the reference of the panel to get an array of references of all included controls etc. or you use a simple "build array" with the needed references...

Best regards,
GerdW


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