LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I am having trouble stopping a sub VI from the front panel of my main VI.

Whenever I try to stop my sub VI from the main panel i cannot get it to work. It has entered the value of the switch from the main VI and does not update it within the sub VI after it has started the sub VI and hence does not look for a changed value on the switch. Is there any way that I can get the sub VI to check the state of the switch on the Main VI on each loop?

Thanks

Ross H
0 Kudos
Message 1 of 5
(3,309 Views)
If I understand your question correctly, you need to send a message from the main VI the subVI when the stop button on the main VI is activated. A good way of doing this would be to use a notifier: the main VI sends a notification when stop is activated, and the subVI will need to check the notifier periodically to see when it should exit.
0 Kudos
Message 2 of 5
(3,309 Views)
This link may show you one of many ways:

http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=137&HOID=5065000000050000006B390100&HTHREAD=000080235&UCATEGORY_0=_49_%24_6_&UCATEGORY_S=0

Cheers!
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
Message 3 of 5
(3,309 Views)
Ross,

One way to monitor data in a main VI from a subVI is to pass a control reference between the two. If a subVI has the reference to a main VI control or indicator, it can use the Value property to find the current value of that control. Please see the attached example that demonstrates a subVI monitoring a front panel boolean to determine when to stop its execution.

Matt Friedman
Applications Engineer
National Instruments
Message 4 of 5
(3,309 Views)
Hi,

I am including 3 VI programs, here main vi controls the sub vi, i mean sub vi can be stopped either from main vi or from stop button put on its front panel. Also main vi still works incase sub vi is running.

Hope it works. If above does not answer your problem completely, Pl. do write.

Best Regards,
Nirmal Sharma
India
Download All
0 Kudos
Message 5 of 5
(3,309 Views)