LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While and For loop exit conditionally scenario

Solved!
Go to solution

Hi all,

 

Say I have a loop that I want to iterate 5 times (for or while), OR exit conditionally using a stop button at any time. say each iteration takes 5 mins to complete, and halfway through iteration 2 I decided I wanted to stop the process, currently what happens (and i appreciatte this is normal behaviour) is the loop finishes iteration 2 and then continues for one for one iteration. Therefore stopping after iteration 3.

 

Is there any way to prevent it from starting iteration 3 at all?

 

Many thanks

0 Kudos
Message 1 of 4
(2,591 Views)
Solution
Accepted by topic author labnoob

Force your stop control to be read after the process is finished. Smiley Happy

 

Stop.png


Regards,

Peter D

Message 2 of 4
(2,585 Views)

Can you post a small example of what you are describing? When the stop condition is true then that will be the final loop iteration. It might be that you are making the stop decision at the wrong time.

 

Ah! Pete beat me to it with a nice screenshot and everything Smiley Very Happy

=====================
LabVIEW 2012


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

DOh, cheers guys. you know, I was thinking along those lines. instead, i was trying to put the conditional terminal in the second frame of a flat seq... Smiley Very Happy

 

 

0 Kudos
Message 4 of 4
(2,573 Views)