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 Module | Frequencies |
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 9472 | 1 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, 20 kHz |
NI 9474 | 1 Hz, 50 Hz, 250 Hz, 500 Hz, 1 kHz, 5 kHz, 10 kHz, 20 kHz |
NI 9475 | 1 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.