Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

With DAQmx, how to use AO start trigger for AO/AI synchronization with finite AI sampling

I am a new user to DAQmx and I am trying to synchronize AI (finite samples) with AO in LabVIEW 7.1 using a PCI 6229 card. I want to generate a finite waveform (AO) and, subsequently, collect a finite number of voltage samples (AI). I would like to repeat the AO-AI cycles in a while loop.

Alternatively, I could use an infinite AO generation and collect finite number of voltage samples on AI but always exactly at the same spot of the AO buffer.

Using traditional DAQ and a 6024E card, I used a counter triggered by AO start trigger signal (example attached). I have problems with translating this example into DAQmx.

Please help!

Ruber
0 Kudos
Message 1 of 5
(4,513 Views)
Hi Ruber,

You can synchronize AI and AO by sharing the analog output sample clock (i.e. setting the AI sample clock as the source for the AO sample clock). Try the sample attached with the input, output, and trigger channels appropriate for your application.

Thanks,
Lesley Y.
Message 2 of 5
(4,507 Views)
Lesley,

Thank you very much for your suggestion. Late last night I actually tried a to use AI start trigger instead of AO start trigger and it worked (since I tried the AI & AO to start simultaneously, it does not matter what triggers what), even in the loop. The devil is in details, as I had to carefully wire the number of data points and what to place inside/outside the loop.

The problem with shared clock is that I need to sample the AI and AO at different rates but using AO and AI clock separately did not seem to affect the performance.
I still want to try to use the AO start trigger (as you suggest) because I would like to delay the AI by a few ms from the AO. Is there a simple way to to that?

I suppose, switching from traditional DAQ to DAQmx requires your brain to be rewired - after playing with it for a couple of days and nights I developed a "feeling" for it. One of the differences was that, in order to use this example in the loop, one has to use 'stop task' inside and 'clear task' outside the loop.

Thanks again!

Radek Uberna
0 Kudos
Message 3 of 5
(4,501 Views)
Hi Radek,

If you're only looking to start the operations together, you can simply use the same trigger and use a different clock for each to achieve a different sampling rate. I was under the impression that you wanted them to sample at the same time (simultaneously).

If you're interested in more examples, you can also check out the LabVIEW example (Help >> Example Finder. At the Browse Tab, Hardware Input and Output >> DAQmx >> Synchronization >> Multi-Function >> Multi-Function-Synch AI-AO.vi

Glad to hear you're getting the feel of things in DAQmx. Good luck with your application!!

L. Yu
0 Kudos
Message 4 of 5
(4,496 Views)
You can delay the start of either the AO generation or the AI acquisition from the start trigger by using the Start->More->Delay and Start->More->Delay Units attributes in the Trigger Property Node. This will give you a common reference point in time for starting each task while allowing a configurable delay from the reference point.
0 Kudos
Message 5 of 5
(4,490 Views)