Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

PWM generation by using NI-DAQMX & Python with NI-PXIe 6363 Card

I'm trying to generate PWM signal by using NI PXIe-6363 card and NI-DAQMX library and Python but not able to get PWM.

Can anyone help me for same.

Is it possible to generate PWM by using NI-DAQMX library and Python.

0 Kudos
Message 1 of 3
(835 Views)

I'm no help with any of the specific Python syntax, but here's a general outline:

 

1. You should create a task for Counter Output to generate PWM

2. When you configure Timing properties for the task, you'll likely need to use "Continuous Sampling" and "Implicit Timing".

3. And now here's the tricky thing, at least under the LabVIEW API.  I suspect this is a device and/or DAQmx quirk and that it will also be true under Python though.
    PWM control usually involves a constant frequency with a potentially variable duty cycle.  But under DAQmx, you must also write to the frequency property to make it "digest" anything you write to the duty cycle property.   So you probably need to write the new duty cycle first and then re-write the same old frequency to get DAQmx to "digest" both values.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 2 of 3
(793 Views)

You can refer to nidaqmx-python/examples/co_pulse_time.py at master · ni/nidaqmx-python. Use add_co_pulse_chan_freq and nidaqmx.types.CtrFreq instead.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
Message 3 of 3
(778 Views)