Pulse-Width Modulation Using Scan Interface with C Series Modules

Updated Dec 19, 2023

Environment

Hardware

  • NI-9401
  • NI-9472
  • NI-9474
  • NI-9475
  • NI-9402

Based on the project requirements there might be a need of generating a pulse width modulation (PWM) signal for different kinds of tasks. NI C Series High-performance Digital I/O modules support this functionality when used alongside CompacRIO devices in Scan Engine mode.

The pulse width modulation can be done statically by configuring the module from within the LabVIEW Project Explorer or dynamically in the LabVIEW environment. See Software Support for CompactRIO, CompactDAQ, Single-Board RIO, R Series, and EtherCAT for supported modules and follow the steps below to perform PWM under the RIO Scan Interface.

1. Once the module has been added to the Scan Interface, as shown in the image below, right-click on the module, then select Properties.
 


2. When the C Series Module Properties configuration window is visible select Specialty Digital Configuration from the Category window, then select Pulse-Width Modulation from the Speciality Mode window. Now you will be able to select the Frequency of the PWM signal for each channel, as shown in the image below.

Additional Information

Possible frequencies on supported modules are as follows:
 
C Series ModuleFrequencies 
NI 9401*1 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, 20 kHz
NI 9402*1 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, 20 kHz
NI 94721 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, 20 kHz
NI 94741 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, 20 kHz
NI 94751 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, 20 kHz

If there is a need to configure a Custom Frequency or Custom Duty Cycle of a signal, use the attached VIs ("Constant 50 percent duty cycle signal generation.vi" and "Duty Cycle Control.vi").

For these modules, you must also configure the required Line Direction for the lines of the module, which is done from within the C-Series Module Configuration window under the Module Configuration section.

NOTE: The PWM Modulation is only supported in LabVIEW 32-bit version.