Using DAQ Device to Generate a PWM Wave in NI VeriStand

Updated Oct 31, 2022

Environment

Hardware

  • PXI Multifunction I/O Module
  • PXI Analog Output Module

Software

  • VeriStand

The PXI Multifunction I/O Module provides a mix of analog I/O, digital I/O, counter/timer, and triggering functionality in a single PXI module. If you want to use this module to generate a PWM wave in NI VeriStand, you find that the amplitude is only 5V using the counter function. This article explains how you can generate PWM of different amplitudes in NI VeriStand.

You can use Waveforms-Generation-Custom-Device with NI VeriStand. The custom device is using the AO channel to generate the PWM wave, instead of the counters channel. The AO channel's range of the PXI Multifunction I/O Module is -10V to 10V, so it can generate a square wave whose amplitude is more than 5V. In addition, if 12V amplitude is needed, the PXI Analog Output Module PXIe-4322 can be chosen to meet the requirement.

Please note that this custom device is provided as-is and is not supported by NI. The source code can be downloaded from the Github page. It includes a LabVIEW project configured with source distribution for the Configuration and Engine LLBs necessary to use the custom device in VeriStand. Build these LLBs in the LabVIEW version corresponding to the version of VeriStand you are using. Refer to Building a Custom Device for more information.