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

For Loop

NI LabVIEW 8.6 Help
June 2008

NI Part Number:
371361E-01

»View Product Info

Owning Palette: Structures

Installed With: Base Package

Executes its subdiagram n times, where n is the value wired to the count (N) terminal. The iteration (i) terminal provides the current loop iteration count, which ranges from 0 to n-1.

After you create a For Loop, you can use shift registers to pass values from one iteration to the next. If you wire an array to a For Loop, you can read and process every element in that array by enabling auto-indexing. You also can enable auto-indexing by configuring a For Loop to return an array of every value generated by the loop.

You can add a conditional terminal to configure a For Loop to stop when a Boolean condition or an error occurs. A For Loop with a conditional terminal executes until the condition occurs or until all iterations complete, whichever happens first. To add a conditional terminal to a For Loop, right-click the For Loop border and select Conditional Terminal from the shortcut menu. You must wire the conditional terminal and either wire the count terminal or auto-index an input array for the loop to execute and for the VI to run.

For Loops produce default data when the iteration count is zero.

To convert a For Loop to a While Loop, right-click the For Loop and select Replace with While Loop from the shortcut menu.


Resources


 

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