LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A simple WHILE Loop takes an input once, such as TRUE or FALSE. How do I create a "wait" statement (WHILE) that will accept further input?

Using a WHILE loop as a "wait" condition with a TRUE or FALSE as an input to the WHILE statement seems to cause an infinite loop. How do I get the WHILE to accept the next input, short of using a Global Variable.
0 Kudos
Message 1 of 6
(2,802 Views)
I have created a VI that has 4 different ways to control a WHILE loop:

1) Direct boolean control access.
2) Getting the "value" of a boolean control through a reference and property node.
3) Getting the "value" of a boolean control through a linked property node.
4) Using a shift register and any of the other three methods (demonstrated using #3)

I hope it helps.

Naveen.
0 Kudos
Message 2 of 6
(2,802 Views)
I will check these out and reply later.
Thank you very much.
0 Kudos
Message 3 of 6
(2,802 Views)
> A simple WHILE Loop takes an input once, such as TRUE or FALSE. How
> do I create a "wait" statement (WHILE) that will accept further input?
>

Move all terminals and other data sources inside of the loop if you want
them to be read each iteration. Otherwise, they are read on the outer
diagram and that value is sent into the loop. To get a visualization of
this, you might want to turn on the execution hiliting -- the light
bulb. Then run the VI.

Greg McKaskle
0 Kudos
Message 4 of 6
(2,802 Views)
This is essentially what I did (it worked). I had a sub-VI that had a Cluster passed to it. There is a possibility that 12 instances of this VI would be called. The WHILE loop in question is within a sequence, within a larger WHILE loop. I created a local variable from the Cluster (read), put it within the target WHILE loop and used a Property Node (value),
combined with an unbundle to control the WHILE stop command. This seems to work. I'm still getting the handle on the intricacies of the symantics of LabView.
0 Kudos
Message 5 of 6
(2,802 Views)
I used the option #2 you presented, with a few additions. I have a sub-VI that had a Cluster passed to it. There is a possibility that 12 instances of this VI would be called, each with it's own independent PAUSE button. The WHILE loop in question is within a sequence, within a larger WHILE loop, in the sub-VI. I created a local variable from the Cluster (read), put it within the target WHILE loop and used a Property Node (value), combined with an unbundle to control the WHILE stop command. This seems to work. Not 100% sure why one works and not another, but I'm getting there.
0 Kudos
Message 6 of 6
(2,802 Views)