Generate a Software Timed Pulse Train Using a Digital Output

Updated Feb 28, 2024

Reported In

Hardware

  • Digital I/O Device
  • Counter/Timer Device
  • C Series Digital Output Device
  • PXIe-6366

Software

  • LabVIEW

Driver

  • NI-DAQmx

Issue Details

  • I want to generate a pulse width modulated (PWM) output, but the cycle time and precision are not critical. I'm looking at two devices, one with a counter that is capable of generating a pulse train while the other does not. Can I use a digital output instead of a counter in this instance?
  • How do I generate a pulse width modulated (PWM) output without counters?

Solution

If the application does not have tight requirements with respect to speed and precision (cycle time is in the seconds range with possibility of milliseconds of delay) a digital output can be used with software timing control for pulse train or PWM generation. 

An example where this application can be used is the control of a relay with a minute period and half a second of precision. The Software Timed Pulse Width Modulation LabVIEW example shows one method of implementing PWM with software timed digital I/O.

Additional Information

Counters are preferable for generating PWM output, since they are hardware timed. This makes them much faster and more precise than digital I/O lines. Not all modules have counters or access to counters, however. The number of counters on a chassis is finite as well, and a software timed output may be necessary to provide resources for other tasks.