labview

How to Change Control Value in Main VI to Update Control in Sub VI in real time? LabVIEW


In a Sub VI, I have a numeric control, which is an input to the Sub VI, inside of an event structure triggered when a button is pressed. This control is used to update a specific result in the Sub VI. I also have a control in my Main VI that is wired to the Sub VI so that the Sub VI control assumes this value. The issue is that when I run the program, and it gets to the part of the program where it is handling the event structure, I can no longer update the control on my Main VI front panel. It only updates correctly if I change the value on the Sub VI panel.

I understand that this is because of basic data flow, and the initial value of the control has already passed from the Main VI to the Sub VI, but is there a way to bypass this so that user-made changes to the control in the Main VI front panel will update the Sub VI live even when the execution is in the Sub VI awaiting the event structure to be triggered?


Solution

  • Instead of the value of the control, pass a reference to it to the SubVI, and update it via the value property node. You can even use the Value(Signaling) to generate a value change event in the main VI.