Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI 6211 - running 2 AO channels simultaneously

Solved!
Go to solution

Hello,

 

I'm trying to use NI USB-6211 DAQ's 2 AO channels to run simultaneous sawtooth waves. AO0 to run continuous sawtooth at 40000 Hz, with 1024 sample. AO1 to run one cycle of sawtooth at 40Hz, with 512 sample. I use sample clock as a trigger pulse to camera which has to sync with AO0's sample rate.

When I run my code, AO0 works fine (sawtooth, static move, all works) but AO1 doesn't work. Can anyone suggest what I'm doing wrong?

 

Thank you.

Download All
0 Kudos
Message 1 of 4
(2,836 Views)

 

Yeah, you need to construct your code so that both AO channels are part of the *same* hardware-timed task.  There's only one timing engine available for the AO subsystem on the board, so multiple channels need to be part of the same task.

 

As a consequence, you'll probably end up running at 40 kHz.  You'll need to carefully plan out your 2 AO channels as a 2D matrix of values.  Since this *sounds like* some kind of raster scanning app, you'll probably have AO0 vary at every sample while AO1 will probably repeat the same value for 1000 (or maybe 1024?) samples, then change once and repeat again.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 2 of 4
(2,814 Views)

Hi Kevin,

 

You are exactly right, this is a scanning program that I need to run AO0 continuous sawtooth at 40KHz and AO1 run one sawtooth cycle at 40Hz then stay at 0. It sounds like I won't be able to do this running one channel continuously and the other channel run one cycle....

0 Kudos
Message 3 of 4
(2,791 Views)
Solution
Accepted by topic author dk91

Right, both channels need to be in the same task and you need to define sample data for both channels at the fast (40 kHz) rate.

 

It's not so bad though, not really.   AO0  wants to repeat a sawtooth of 1024 samples.  (Or maybe it'll sweep in reverse on alternate lines?).  AO1 wants to make a slower sawtooth of 512 samples.   All together you've got 1024*512 samples per channel for your 2 channels.  Not a big deal.

 

Attached is an example vi to generate a 2D array of AO0 and AO1 data.  There's an option to have AO0 sweep in reverse on alternate lines.  You can feed this 2D array of data to a finite AO task set to generate 1024*512 samples.

 

 

-Kevin P

 

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 4 of 4
(2,736 Views)