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. |