LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

occurrence example

Solved!
Go to solution

Hi

I'm using a code with occurances and I went to the examples to learn how they work. However, I added one extra while loop and the VI needs to press two times the stop button to go out of the loops. Is any explanation for this ? I suppose after pressing stop the condition becomes TRUE and the outer loop should stop immediately. I attach the modified VI

Thanks

0 Kudos
Message 1 of 4
(3,140 Views)

There is a very good reason. I suggest you turn on highlight execution and see what it is!

 

Hint:  look at the value of your "Loop Stop" global variable right after you hit "Stop" the first time.

0 Kudos
Message 2 of 4
(3,133 Views)

That's true. With the highlighting it is apparent that needs two times. But still I cannot get the point when Global Varible becomes True but the while loop continues for one more time the Outerloop. And then it's obvious that Stop should be pressed again to go out from Loop1 and 2.

0 Kudos
Message 3 of 4
(3,123 Views)
Solution
Accepted by topic author UserLab

Get rid of the global variable that is wired to the conditional terminal.  Wire from the True in the flat sequence structure directly to the conditional terminal.

0 Kudos
Message 4 of 4
(3,112 Views)