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: 

Is there a way to reference the property node value of a control in another VI?

Let's say that I have a situation like the one shown in the attached image.

I have an interlock system which is basically a bunch of booleans

If for example the "RF Enable" button in the "interlock VI" is true, then I should be able to flick the ON switch in my other VI (in the back), but if the value is FALSE, then it shouldn't allow it.

In other words, how do I check the value of a control across 2 separate VIs (running simultaneously)?


Thanks!!
0 Kudos
Message 1 of 8
(3,478 Views)
Is one VI launched by the other, or are they launched independently? If it's the former then you just need to pass the control reference to the subVI via terminal node. If it's the latter there are a variety of ways to handle this:
  • Use a global variable - somewhat "sloppy" as it requires a global variable, and can lead to race conditions. In the "Interlock" VI you just set the value of the global variable when you change the value of the Boolean. In the other you're just reading it.
  • Action Engine - Ben wrote a Community Nugget a while back. Similar concept to a global variable.
  • Queue - The "Interlock" VI simply pops an element onto the queue with the value. The other VI just monitors the queue for a new element. It just needs to have something like a shift register to keep track of the last state.
  • Use the VI Server to access the controls of the "Interlock" VI. You can do this by accessing the "Interlock" VI's pane and get the control references. With the control reference you just need to get the value with a property node.
  • ... (I'll let others chime in)
0 Kudos
Message 2 of 8
(3,467 Views)
Yes, they are launched independently.

I see your suggestions, I thought about global variables too....but wasn't totally sure........I will research a bit more on the other options..

Meanwhile, any other suggestions?
0 Kudos
Message 3 of 8
(3,459 Views)
Here's a simple example using the VI Server:




NOTE: This assumes the "Interlock" VI is loaded into memory.

Message Edited by smercurio_fc on 02-15-2008 02:57 PM
0 Kudos
Message 4 of 8
(3,457 Views)
Hi again,

smercurio_fc, I like your solution using the VI server and would like to implement it.

However, I could only find the open & close VI reference function icons, where are the other functions? what are they called?

Thanks!


Message Edited by emerino on 02-18-2008 10:59 AM
0 Kudos
Message 5 of 8
(3,422 Views)
The center VI is an Invoke node, which allows you to perform actions on the called VI (on the Application Control palette).  The Control Value:Get method returns variant datatype, which you can force to a different data type with Variant to Data (on the Cluster and Variant palette)
0 Kudos
Message 6 of 8
(3,412 Views)
Left to right:
  1. Open VI Reference (Application Control palette)
  2. Invoke Node (Application Control palette)
  3. Variant to Data (Cluster & Variant palette)
  4. Close Reference (Application Control palette)
0 Kudos
Message 7 of 8
(3,411 Views)
It works!

I only made a couple of changes, but the overall idea is the same.....

Thank you...!
0 Kudos
Message 8 of 8
(3,392 Views)