Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Synchronizing AI AO

I need to synchronize AI(4channels) & AO(2 channels). I use the board PCI-6115 and I adopted the solution given in FAQ of the board User Manual. But with that solution I cant sample(at least I think...)my input channels at 10 MS/s, only at 2.5MS/s(the AO Update Rate for 2 Channels) because they use the same clock. Is this correct?

What I wanted to do is to sample my 4 AI channels at 10 MS/s and sample my 2 AO at 2,5MS/s, with Synchronization between AI & AO. Is that possible? If someone has an example I would be gratefull.

Thanks in advance,

Pedro
0 Kudos
Message 1 of 5
(3,442 Views)
Try routing the ai sample clock to a counter. Program the counter to issue pulses based on the number of sample clock edges counter. Use the output of the counter as the sample clock for the AO. I threw this vi together in a hurry.
0 Kudos
Message 2 of 5
(3,421 Views)
Since the 6115 is not yet supported by DAQmx, you will need to use the Traditional DAQ driver for your solution. In this case, since both the AI and AO timing engines derive their timing from the same onboard timebase, all you should really need to do in order to synchronize them is to share a common start trigger. One way to do this is to use the AI start trigger generated internally by the device as the digital start trigger for your AO as well. In order to do this, look at the shipping example Cont Generation - E-series D-Trig.vi as a template. Notice that one of the options for your AO start trigger source is AI start trigger. With this selection, your AO task will now wait for your AI task to start before beginning its waveform generation. Also, with this selection, no external wiring is necessary for your trigger signal. The signal is routed internally on the board.

Finally, you can use the Acquire N Scans.vi shipping example as a template for your AI task. This VI uses a software start trigger, so the final thing to remember is to start your AO task before starting the AI task. Since the AO task is waiting for the AI task to start, this should ensure the two tasks are started at the same time. I haven't tested this approach in depth so I can't provide any details on what level of synchronization this will provide. If you find this doesn't produce a consistent phase relationship throughout time, you can try the approach previously mentioned which uses a counter to divide down the AI sample clock for use by the AO task. However, you will have to create a Traditional DAQ equivalent of the provided VI.
0 Kudos
Message 3 of 5
(3,414 Views)
I was not aware that the 6115 was not supported in DAQmx. But if you will forgive me, here are two more DAQmx VIs that illustrate two different methods for synchronizing AI and AO but at different sampling rates. The one called Shared Start trigger implements reddog's idea, which works well when the AI and AO are on the same board. The other called Divide Down method, like the first VI I posted, works even when the AI and AO are on different boards. This one sets the AO Sample Clock Timebase source to the AI Sample Clock. It sets the AO Sample Clock Timebase divisor to 4. Thus, the AO task will issue a point every 4 ticks of the AI Sample Clock.
0 Kudos
Message 4 of 5
(3,409 Views)
Apparently, I can post only one file at a time. Here is the Shared Start Trigger VI.
0 Kudos
Message 5 of 5
(3,408 Views)