Generate Software Timed Trigger with NI-DAQmx in LabVIEW

Updated Oct 22, 2023

Reported In

Hardware

  • CompactDAQ Chassis
  • CompactRIO Chassis
  • PXI Chassis
  • PXI Digital I/O Module
  • Digital I/O Device
  • Analog Output Device
  • C Series Universal Analog Input Device

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

  • I have a NI hardware configuration and I want to use one input signal to trigger a particular task or operation on my LabVIEW code.
  • I want to synchronize two tasks to execute one after the other and my NI hardware configuration does not have the physical channels to perform a hardware trigger.

Solution

A software timed trigger can be done monitoring within a while loop the status of the input signal of one device to check if a certain condition has taken place. If this condition occurred then the LabVIEW program will execute the desired task using a case structure.

For example, if we want to create a software timed trigger, where a DAQmx Voltage Digital Input Task will trigger a DAQmx Analog Input Task, the following implementation can be done:

Block Diagram:

False Case:

Additional Information

The software timed configuration will run at one rate determined by the computer's Operating System and how it prioritizes the tasks currently ongoing. In this way, we should expect a high latency on the application.