LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

My vi won't (completely) stop

Has anyone else ever encountered this problem?...
 
I have a vi running that controls a daq box.  When I click the stop button on the front panel that's connected to all my while loops, the vi stops. The meters I had running stop updating, none of the switches I have work, and the front panel stop button swiches back to the default state, but the arrow in the tool bar still shows running, and I have to click the hard stop button next to it to get it to really stop.  It seems like my stop button on the front panel is working, so why it completely stop.  I looked all around and couldn't find anything its waiting on?  Any ideas?
0 Kudos
Message 1 of 5
(3,560 Views)
It sounds like your front panel stop button might be outside at least one of the while loops. A control must be inside a loop to be read once the while loop starts. That is basic dataflow programming. If you have a single stop button, put it inside any one of the while loops and a simple way to stop the others is to read from a local variable of the stop button in the other loops.
0 Kudos
Message 2 of 5
(3,554 Views)
Yes, I do use one stop button and link them all using a local variable.  Here's something new i just observed: everything stops correctly when I run the vi in "highlight execution" mode.  When I don't is when I encounter the problem.  Does this mean anything?
0 Kudos
Message 3 of 5
(3,551 Views)
If you are using local variables, do you reset the local to false somewhere in your code.  I imagine you have a race condition where all your loops are reading the local deciding if they should stop.  Most of them read it and stop, and then you reset the value to false.  However, one of the loops hasn't read it yet so it keeps looping.
 
Make sure you have enforced a dataflow dependency on all the loops before you set the local back to false.
0 Kudos
Message 4 of 5
(3,547 Views)
How about posting your VI here, so one of us would take a look at it 🙂
Ian F
Since LabVIEW 5.1... 7.1.1... 2009, 2010, 2014
依恩与LabVIEW
LVVILIB.blogspot.com
0 Kudos
Message 5 of 5
(3,543 Views)