Retriggerable Tasks in NI-DAQmx


The National Instruments Getting Started with NI-DAQmx Series is aimed at helping you learn NI-DAQmx programming fundamentals. Through video and text tutorials, this series will take you from verifying your device's operation in Measurement & Automation Explorer (MAX) to programming data acquisition applications using LabVIEW. It is intended for both the beginner who wants to learn how to use the DAQ Assistant, as well as the experienced user who wishes to take advantage of advanced NI-DAQmx functionality.


With NI-DAQmx it is possible to define hardware triggered analog, digital, and counter tasks. Additionally, X Series multifunction data acquisition devices (DAQ) natively support retriggerable tasks. A retriggerable task will acquire or generate a finite number of samples each time a digital trigger signal is received. An example of this can be seen in Figure 1. For each edge of the trigger signal, there will be four pulses of the sample clock (the device will acquire or generate four samples). This document discusses how to configure retriggerable tasks with X Series DAQ devices, as well as how to achieve similar functionality with previous generation DAQ devices using onboard counters.

Figure 1. Retriggered Sample Clock.

Hardware and Software Requirements

Only National Instruments X Series multifunction DAQ devices (63xx) natively support retriggerable tasks. However, most National Instruments multifunction DAQ devices, such as M Series (62xx), can be used to implement similar functionality. To determine if your device supports this functionality, see Retriggerable Data Acquisition with NI DAQ Devices for more information.

The NI-DAQmx API is available for LabVIEW, along with text-based development environments such as LabWindows/CVI, .NET, and C++. Refer to the NI-DAQ Readme to ensure that you have a version of NI-DAQmx that supports your device.

Application Architecture

To create a retriggerable Task with an X Series device, use the Start:More:Retriggerable property shown in Figure 2. This property specifies whether a finite task resets and waits for another hardware start trigger after the task completes. When you set this property to TRUE, the device performs a finite acquisition or generation each time the start trigger occurs until the task stops. The device ignores a trigger if it is in the process of acquiring or generating signals.

Figure 2. Retriggerable Task Creation With an X Series DAQ Device.

To achieve retriggerable functionality with previous generation DAQ devices, the hardware start trigger must be used to generate finite digital pulses using the two onboard counters. These pulses will internally be used as the clock source for the analog input task. Figure 3 illustrates this application architecture.

Figure 3. Retriggerable Analog Acquistion Using Onboard Counters.

Shipping Example

NI-DAQmx versions 9.5 and earlier ship with LabVIEW examples that demonstrate using retriggerable analog input and output tasks with X Series DAQ devices. For previous generation DAQ devices, the example Multi-Function-Ctr Retrigg Pulse Train Generation for AI Sample demonstrates retriggerable functionality using counters. This example can be accessed through the LabVIEW Example Finder (Help»Find Examples»Hardware Input and Output»DAQmx» Synchronization» Multi-function).

NI-DAQmx versions 9.5.5 and newer do not include retriggerable examples for LabVIEW 2012.  The previous examples are available in the Additional Resources section below.