LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

breaking out of nested for loops

Hello,

I have nested for loops inside of a while doing some computations and storing them in an array. These for loops execute over a period of 30 mins, as I have put time delay inside them.

Now my problem is, that in case something goes wrong, and the user wants to stop the execution of the VI, how can he do it , or in other words, how can I break out of the for loops, when the STOP button is pressed in the VI.

Is there any other way of doing it without nested for loops ?

Thanks,

birapxi
0 Kudos
Message 1 of 4
(2,670 Views)
I dont know if it got implemented in later versions of labview or not (Im using 7.0) but there was a discussion about putting a for loop with a break in the structures pallete. If it isnt there, your best best is to convert your for loops to while loops (it just requires a little more effort to look after iterations and ending cases) then you can include a breaking case for the user pressing the stop button.
 
Hope that helps
Jeff


Using Labview 7 Express
0 Kudos
Message 2 of 4
(2,667 Views)
either that or use the abort vi button at the top...but that is not recommended at all. I heard someone compare it to stopping your car with a tree. It works, but there may be consequences. (I would give credit to whoever said that, but I forget where I saw it, it was just rather memorable).
Jeff


Using Labview 7 Express
0 Kudos
Message 3 of 4
(2,665 Views)
LabVIEW 8.5 introduced the for loop with a conditional terminal. Upgrade or use while loops like Jeff said.
0 Kudos
Message 4 of 4
(2,658 Views)