Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating a square wave from digital output on usb-6281

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.

0 Kudos
Message 1 of 4
(980 Views)

You can instead generate a pulse train using counters.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 2 of 4
(953 Views)

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.

0 Kudos
Message 3 of 4
(914 Views)

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.

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
0 Kudos
Message 4 of 4
(906 Views)