Timing Loops

NI-Motion

Timing Loops

National Instruments recommends that you use the loop timings discussed in the following sections.

Status Display

When you are displaying status information to the user, such as position, move status, or velocity, an update rate faster than 60 ms has no value. In fact, there is no need to update a display any faster than 22 Hz because the human eye can detect flicker only at refresh rates slower than 22 Hz.

However, you might see flicker in monitors at around 60 Hz, because of interference with artificial light from light bulbs that run on a 60 Hz AC signal. The recommended standard is 60 ms because one might need multiple function calls within one loop to acquire all the necessary data.

Graphing Data

When acquiring data for graphing or tracking purposes, a 10 ms update time suits most applications. MAX, for example, updates its motion graphs every 10 ms. This update time equates to 100 samples every second and provides enough resolution for typical applications. Consider how accurate the graph display is when choosing the timing for the loop.

Event Polling

Use a polling interval of 5 ms when polling for a time-critical event that must occur before the program continues. This interval is fast enough to satisfy most time-critical polling needs, although certain high-speed applications may require a faster interval. Consider the allowable response time when choosing a polling interval.

For example, to synchronize the motion with the acquisition in an application where a user places an object under the scan area and clicks a Scan button, you create periodic breakpoints every 10 counts to trigger a data acquisition over RTSI. In this example, the loop needs only to read the position and wait for the move to complete before ending the scan. Although the program polls for an event (move complete), no action is being triggered by the move complete. Because there is no need for instantaneous action, there is no need to update the position any faster than 60 ms, and 60 ms is acceptable for monitoring the move complete status as well.