From 12:00 PM - 8:00 PM CST on Thursday, October 18, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Table Of Contents

Hardware-Timed Input, Software-Timed Output

Last Modified: September 15, 2017

  • 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—Hardware-Timed Input, Software-Timed Output

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

LabVIEW Example—Hardware-Timed Input, Software-Timed Output

spd-note-note
Note  

Although this example is written for LabVIEW users, the principles apply if you are using another ADE, such as LabWindows/CVI.

  • Set the Report Missed Samples property for the analog input operation to True.
  • The analog input operation returns an error if new samples are available before the read operation finishes converting samples from the previous iteration.

Sample Block Diagram

spd-note-
ni__notes  
  • If, when an Analog Input Read overflow error occurs, you prefer to receive a warning rather than an error, set the Convert Late Errors to Warnings property to True.
  • Do not use the Wait For Next Sample Clock VI and the Report Missed Samples property within the same LabVIEW loop.
  • Only hardware-timed single-point analog input tasks support the Report Missed Samples property.
  • Because the analog output task is software timed, the value is written out as soon as the write call is initiated. It does not wait for a hardware clock to output the data.

Recently Viewed Topics