LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Want to stop one while loop with another while loop

Hi! I have two while loops running. When one loop stops (when a certain parameter exceeds a user inputed value), I want my other while loop to stop. I've seen an example of this using local/global variables, but it was with T/F boolean variables. I doubt this is much different, but I can't figure out how to do it.

Thanks,
katie
0 Kudos
Message 1 of 3
(2,734 Views)
yes, this is not much different. Anyway, you supply a boolean value to your while-loop termination termainal. So just pass a copy of this value to other loop through a local variable (this can be any hidden boolean control or indicater). If both of those loops can initiate terminal conditions the technic is the same but a little bit more tricky. See an example I've attached. This is not at all an only possible solution, but this will work 🙂
0 Kudos
Message 2 of 3
(2,734 Views)
katie,
i'm assuming you compare the user input value against your 'certain parameter', the output of which is probably boolean. wire this output to a boolean indicator. then, right-click this indicator and select create>local variable.
Place this local variable inside your second loop and wire it to the stop button.
0 Kudos
Message 3 of 3
(2,734 Views)