LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How this while loop is stopped

The attached VI is an LabView example VI and I did a little modification. If I want to stop this VI, I will have to click the Wait loop stop button then click Set Occurrence button twice, finally click the Set loop stop button to stop the program. My question is, if we click the Wait loop stop button and click Set Occurrence button once, the conditional terminal sees the True signal, it's supposed to stop, but it doesn't stop until we click the Set Occurrence button again then click the Set loop stop button. We can see it from the Wait and Wait 2 LEDs. Any one can give some explanation? Thanks.
 
Guangde
0 Kudos
Message 1 of 3
(2,607 Views)
"Any one can give some explanation?" 

Certainly. It's because when you start the VI, the "Wait" button has already been read. Thus, it doesn't matter what you do to it. The bottom loop won't see the new value until the next iteration, at which point the loop is waiting for the occurrence again.
0 Kudos
Message 2 of 3
(2,602 Views)
Thank you for responding to my question.  I think I understand it now. The first click of the Set Occurrence button, the lower loop gets out of the current iteration. At next iteration, even though the conditional terminal sees the True signal, it can not exit because it's waiting for the loop to finish. Only after we send the Occurrence again then the loop will finish it's task and exit. Again, thank you for your help.

Guangde
0 Kudos
Message 3 of 3
(2,583 Views)