Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating While Loops

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

The While Loop contains a subdiagram that executes until the conditional terminal receives a particular Boolean value.

Complete the following steps to create a While Loop.

  1. Place a While Loop on the block diagram.
  2. Place objects inside the While Loop to create a subdiagram that the While Loop repeats.
  3. Wire Boolean data, such as a Boolean control or an output from a Comparison function, to the conditional terminal . You also can right-click the terminal and select Create Constant or Create Control from the shortcut menu to create the Boolean object.
  4. (Optional) By default, the conditional terminal is set to Stop if True. You can change the behavior of the conditional terminal by right-clicking the terminal and selecting Continue if True.

Because the VI checks the conditional terminal at the end of each iteration, the While Loop always executes at least one time. The VI does not run if you do not wire the conditional terminal.

You can prevent code execution in the first iteration by placing a Case structure inside the loop.


Resources


 

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