Hardware-Timed Input, Software-Timed Output

NI-DAQmx Key Concepts

Hardware-Timed Input, Software-Timed Output

Requirement

An analog input task must be hardware-timed. The output task does not need hardware synchronization with the sample clock edge.

Solution

Use the DAQmx real-time Report Missed Samples attribute/property, which returns an error if new samples are available before the read operation finishes converting samples from the previous iteration.

Advantages

  • Input samples are hardware-timed.
  • Read, process, and write operations can overflow into the next sample period, as long as enough time remains for the subsequent read operation to complete on the next set of input samples. An application that acquires data from multiple channels on multiplexed devices (such as E Series and M Series) has to wait for the device to convert input samples before the read operation can return. By allowing process and write operations to overflow into the next sample period, the application takes advantage of otherwise idle time. This enables the application to achieve higher control-loop rates.

Restrictions

Output updates suffer from software jitter because they are not hardware-timed.

Sample Application

An example of this kind of application is an analog control loop that reads samples from a specific number of multiplexed analog input channels, processes the data using a control algorithm (such as PID), and writes the new control values to the analog output channels using a software-timed task.

Timing Diagram

Related Topic

LabVIEW example for hardware-timed input, software-timed output