LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

While loop control using hardware.

Hi

I would like to be able to run a while loop until i get a signal from my hardware (either on a counter channel or a regular AI channel).


Any Ideas??

R
0 Kudos
Message 1 of 4
(2,492 Views)
Once you determine what the signal needs to be, put a boolean value (T/F) to it and wire that result to the While loop "run/stop" input.
For Example, if your signal to stop the loop is a specific value (eg counter = 100), use an "Equal?" vi to 100 and wire into a Select vi (from the comparison palette). When the counter = 100, have a constant "True" go out, else a constant "False" (which is wired to the while loop "run/stop" input).
Good luck with it, Doug
0 Kudos
Message 2 of 4
(2,492 Views)
Why use the select vi? the "Equal?" vi has a boolean output that can be used to directly control the while loop. Other than that, you've hit the nail on the head - assuming that the data acquisition is inside the while loop.

Rob
0 Kudos
Message 3 of 4
(2,492 Views)
You're correct Rob - thanks...I was thinking of other values he might have been expecting and that the Select vi would give that 2nd set of options, however, based on my example concerning just 1 compare, you bring up a good, corrective point - of which you always tactfully do.
Doug
0 Kudos
Message 4 of 4
(2,492 Views)