Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

While Loop

LabVIEW 2013 Help

Edition Date: June 2013

Part Number: 371361K-01

»View Product Info

Owning Palette: Structures

Requires: Base Development System

Repeats the code within its subdiagram until a specific condition occurs. A While Loop always executes at least one time.

Components of a While Loop

Subdiagram—Contains code that the While Loop executes once per iteration.
Iteration Terminal (i)—Provides the current loop iteration count. The loop count always starts at zero for the first iteration. If the iteration count exceeds 2,147,483,647, or 231-1, the iteration terminal remains at 2,147,483,647 for all further iterations. If you need to keep count of more than 2,147,483,647 iterations, you can use shift registers with a greater integer range.
Conditional Terminal—Evaluates a Boolean input value to determine whether to continue executing the While Loop. To specify whether the loop stops for a TRUE or FALSE Boolean value, configure the continuation behavior of the loop. You also can determine when the loop stops by wiring an error cluster to the conditional terminal.
To create a While Loop that automatically wires a stop button to the conditional terminal, add the While Loop from the Execution Control palette.

Configuring a While Loop

Troubleshooting a While Loop


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit