08-06-2012 01:23 PM
Hi All
I am stuck with a problem
I have two vi's. A MainVI and a SubVI. The SubVi is located within the MainVI. The Sub VI is like a continuous loop and can be stopped only by pressing a STOP button on the SUBVI front panel.
I need to control this STOP button from the front panel of the MainVI. But the problem is that, until the SubVI executes completely, no changes made on the MainVi will be read.
The following methods have failed
Tried to pull the STOP button from the SubVI as a terminal.
Using global variables.
Is there anything like reference variables that can achieve this task.
Any help will be much appreciated.
Solved! Go to Solution.
08-06-2012 01:42 PM
In the main VI create a reference to the control (right click create ref).
Wire that ref into the sub-VI.
Inside teh sub-VI use a property node >>> Value to read the state of the stop button in the main.
Please note that you must READ the property node to get an updated value.
Ben
08-06-2012 03:24 PM
I guess you do not have the control of the Main VI until the sub vi is done since the sub vi is running continously. You have 2 options
1. Create a seperate loop in the main vi where you are not calling the sub vi then make the sub vi property to floating so that you can access the main vi also. Keep the control in the seperate loop and pass the reference to the sub vi using a global variable or just pass the wire. So use the value property node inside the sub vi to read the value of the control in the main vi.
2. Create a sub panel in the main vi and call the sub vi into the main vi so you will have access to both the main vi and the sub vi at the same time.
good luck
08-06-2012 03:58 PM - edited 08-06-2012 04:00 PM
agree'd with ben...