LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop while loop?

I want to stop while loop automatically, after i collect the data e.g. 20 seconds.
0 Kudos
Message 1 of 4
(3,172 Views)

Hi

Did you read help file for While Loop?

It says: Repeats the subdiagram inside it until the conditional terminal, an input terminal, receives a particular Boolean value. The Boolean value depends on the continuation behavior of the While Loop. Right-click the conditional terminal and select Stop if True or Continue if True from the shortcut menu. You also can wire an error cluster to the conditional terminal, right-click the terminal, and select Stop on Error or Continue while Error from the shortcut menu. The While Loop always executes at least once. The iteration (i) terminal provides the current loop iteration count, which is zero for the first iteration

bogdani

0 Kudos
Message 2 of 4
(3,166 Views)
0 Kudos
Message 3 of 4
(3,165 Views)
Typically, data collection occurs at a defined rate so you should be albe to calculate the number of desired iterations beforehand.
 
If your loop rate is really random, you just need to keep track of the elapsed time. See attached example (LabVIEW 7.0).

Message Edited by altenbach on 02-27-2006 10:30 PM

0 Kudos
Message 4 of 4
(3,162 Views)