Normally when a
loop, such as a while loop, finishes executing one iteration, it immediately begins running the next. However, it is often beneficial to control how often a loop executes as this will allow the processor to complete other tasks such as updating and responding to the user interface. In the following figures, the processor usage for a simple VI with a while loop running untimed and timed are shown.
Untimed Loop Timed Loop Executing at 1000 Times a Second
In LabVIEW, it is possible to control the loop execution rate and synchronize multiple activities using functions
Wait (ms) and
Wait Until Next ms Multiple. For example, multiple loops can be configured to execute at each multiple of 200 ms. The difference between these two functions is addressed in
this article.
This tutorial explains how to implement timing structures in LabVIEW and helps to visualize how loop time affects number of iterations of a loop. Before completing this tutorial, it may be helpful to review information on
LabVIEW For Loops and While Loops. This is a tutorial suited for LabVIEW beginners. For more resources on LabVIEW basics, look into the
Introduction to LabVIEW getting started material.