12-20-2022 03:03 AM
Hi everyone.
I'm using a usb-6281 DAQ. I need to generate a square wave through a digital output line, and I'm controlling the entire operation with the python ni-daqmx library.
Can anyone point me in the right direction? I looked it up in the documentation and saw there are specific parameters for doing this through an AO line but since all I need is a square wave with a constant max/min value DO should technically be enough.
Thanks in advance,
Aya.
12-20-2022 02:54 PM
You can instead generate a pulse train using counters.
12-26-2022 07:33 AM
Hey, can you maybe specify how to do this or drop an example?
I googled pulse train and it lead me to counter channels, but I don't quite understand the parameters and how to use them.
Thanks a bunch.
12-26-2022 05:48 PM
This is a good example to start with - https://github.com/ni/nidaqmx-python/blob/master/nidaqmx_examples/co_pulse_time.py
You should be able to refer to the PyPI documentation and modify this to take in frequency and duty cycles instead of high and low times.