On-Demand Pulse Generation Without Recreating DAQmx Task

Updated Aug 13, 2026

Reported In

Software

  • LabVIEW

Driver

  • NI-DAQmx
  • NI-DAQ™mx

Issue Details

I would like to generate certain amount of pulses on-demand using DAQmx Counter Output Pulse Generation - Frequency VI. For example, after generating 5000 pulses, I would like to generate 8000 pulses, reusing the same task without stopping it.

Based on DAQmx User Manual, when generating pulses, I can only generate either a single pulse, a finite pulse train, or a continuous pulse train, which requires recreating the task again. Is it possible to generate counter pulses on-demand programmatically without stopping and creating a new task again?

Solution

It is possible to reuse the same task without restarting a new one by using the DAQmx Control Task VI. After starting the task and generate the first pulse, unreserve the task will free up the DAQmx resource and the task can be restarted to generate the second pulse. The LabVIEW snippet code below demonstrates the use of DAQmx Control Task VI for on-demand pulse generation without recreating DAQmx task.

 

Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW Diagram