Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

USB 6215 AI & AO synchronized at different rates

Hello guys,

 

I'm using a NI USB6215 to generate drive signal at AO0 port to my circuit and collect signal at AI0 from my circuit.

My plan is that AO works at 10KS/s while AI at 100KS/s and synchronized with AO. That means at the beginning AO outputs and AI inputs at the some moment, then another 9 AI inputs ,and then  AO outputs and AI inputs at the some moment again, and so on.

How can I realize this?

Right now I have to make both AO and  AI work at 100KS/s, but every ten AO outputs are set to the same value. This makes the program runs slow. I hope to find better solution.

0 Kudos
Message 1 of 4
(3,452 Views)

Hi,

 

It would help tremendously in suggesting possible architectures if you could post your code.  Thanks!

0 Kudos
Message 2 of 4
(3,437 Views)

The code is attached. Thanks.

 

无标题.jpg

0 Kudos
Message 3 of 4
(3,420 Views)

I'm assuming a stimulus-response arrangement so that the first AO sample occurs before any AI samples.  Here's what I'd try:

 

1. Configure both AO and AI to trigger off a counter output that you'll control.  Set the AO task to trigger off the rising edge and the AI task to trigger off the falling edge.

2. Configure your counter output with a width of about 2-5 microseconds.  You may need to look at some things on a scope or do a deep dive into timing specs to figure out the best time to use.  Too low and the first AI sample may lead the first AO sample.  Too high and you may have only 9 rather than 10 AI samples at the time of the 2nd AO sample.

3. Being on the same board, both AO and AI will derive their sample clocks from a common timebase.  Whatever their time phasing is at the beginning will stay constant, no skew will develop over time.

4. Be sure to start both AO and AI tasks before starting the counter task that fires the triggering pulse.

 

 

-Kevin P

ALERT! LabVIEW's subscription-only policy coming to an end (finally!). Permanent license pricing remains WIP. Tread carefully.
0 Kudos
Message 4 of 4
(3,404 Views)