03-22-2023 04:18 PM
I am trying to use Python (with the nidaqmx module) to generate a PWM signal from a USB-6002 DAQ. I can read from and write to the analog and digital ports. However, I am not able to generate a pulsing signal.
I am using the example code from the nidaqmx repository:
https://github.com/ni/nidaqmx-python/blob/master/nidaqmx_examples/co_pulse_time.py
Is there a way to do this with my 6002, or do I need to get a different DAQ?
Thank you!
Solved! Go to Solution.
03-23-2023 05:44 AM
Unfortunately, the 6002 does not support counter output tasks. The best you could hope for is to toggle a DO line under software-timing control, but that's unlikely to work out in most apps that call for PWM in the first place. The output frequency will be limited (probably somewhere in the order of 1 kHz), and quite erratic (regularly dropping into the low 100's or less).
You might still get away with it if you're controlling something like heater rope and a decent-size thermal mass, as well as being clever about observing and compensating for timing irregularities. But for most PWM usages, you'll need a DAQ that supports counter output.
-Kevin P
(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
03-23-2023 09:59 AM
Thanks Kevin! That's very helpful. I had already tried generating my own PWM signal with the DO ports and the frequency I could get was, indeed, nowhere near fast enough for my application.