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

For Loops and While Loops

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Use the For Loop and the While Loop to control repetitive operations. A For Loop executes a subdiagram a set number of times. Similar to a Do Loop or a Repeat-Until Loop in text-based programming languages, a While Loop executes a subdiagram until a condition occurs.

If you open a refnum inside a For Loop or While Loop, close that refnum for each iteration of the loop because LabVIEW repeatedly allocates memory for the refnum and does not free the memory until the VI finishes running.

Note  You also can use a Timed Loop to execute one or more subdiagrams or frames sequentially each time the loop iterates at the period you specify.

Resources


 

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