Application Case 5—Software-Timed I/O
Requirement
"My I/O tasks are of types that do not support hardware-timed operations."
Solution
Apply software timing to your time-critical loop by using the Timed Loop.
Configure your NI-DAQmx tasks to use on demand timing.
Advantages
- Can perform I/O control loops with operations that are not hardware-timed.
- Read, process, and write operations are confined to the software timing period that you define with the Timed Loop.
Restrictions
I/O samples suffer from software jitter.
Sample Application
An example of this kind of application is a digital I/O control loop. The application monitors the state of several discrete inputs and toggles the corresponding output based on the control algorithm. Hardware timing is not available for single-point digital I/O tasks in NI-DAQmx.
Sample Timing Diagram

Sample Implementation
- A Timed Loop running off the system's time sources (millisecond or microsecond resolution) accomplishes the task. Configure the Timed Loop to run at the desired rate.
- Configure all tasks to be software-timed (on demand).
- The Timed Loop provides feedback to the application as to whether the previous iteration completed in time. It does this through the "Finished Late [i-1]" node.
Sample Block Diagram

Notes
- The Timed Loop allows the application to adjust its period from within the loop, allowing the implementation of dynamic timing algorithms for control.
- Lower-priority processes can execute while the Timed Loop waits until its next iteration.
- Other software timing methods include the use of the Wait and Wait Until next multiple VIs (with microsecond or milliseconds resolution). These methods provide no feedback when the application falls behind.