10-15-2014 10:50 AM
Hi all,
I need to output several analog waveforms, while at the same time acquiring analog input, and synchronise the two. For this, I'm using a cDAQ-9178, a 9264 module for AO, and 9220 for AI.
I managed to this all right following this example: http://www.ni.com/example/26527/en/ (NI-DAQmx: Simultaneous AI and AO Using a Shared Clock). The problems started when I moved the waveform generation inside the main while loop to be able to modify the waveform parameters on-the-fly: now I get Error -200018 as soon as I start the VI, or Error -200284 those few times when the VI manages to run some iterations.
This does not happen if I omit the source of the sample clock for the two tasks, but then I lose the synchronisation between input and output.
Any idea of what's going on?
Thanks!
Nathan
10-15-2014 11:19 AM
Can you please post the VI in LabVIEW 2011 or attach a snippet of the code?
The error code is explained here
10-15-2014 11:27 AM
Here it is!
What I don't understand is why I get the errors with the clock, and not without.
10-16-2014 04:16 AM - edited 10-16-2014 04:31 AM
Hi all,
After reading some more on the topic (this in particular: https://forums.ni.com/t5/Multifunction-DAQ/poor-analog-output-performance-error-200018/m-p/1528622#M... ), I got rid of the "Wait until next ms multiple" in the while loop, and now everything runs smoothly!
But the input and output signals still look out of sync.
Any ideas?
10-16-2014 04:28 AM - edited 10-16-2014 04:29 AM
10-16-2014 04:39 AM
Hi GerdW,
I did look at that example, and used it as foundation to my VI. As far as I understand, the synchronisation depends on the shared clock (as explained here too: http://www.ni.com/white-paper/4322/en/ ).
This works beautifully if I generate the waveform outside the main loop, but if I put it inside, so that I can change frequency, amplitude etc. while running the test, suddenly input and output are randomly shifted.
10-20-2014 06:10 AM
To any fellow newbies: the pdf attached to this example offers a good explanation of why it's not always a good idea to "slow down" the while loop via timing functions in buffered acquisition/generation: https://decibel.ni.com/content/docs/DOC-15893 .
10-20-2014 09:32 AM
Hi again,
I've been tweaking my VI: at this point it's a hybrid between the "Multi-Function-Synch AI-AO" GerdW was mentioning, and the shared-clock approach found in the "Timing and synchronisation" white paper. Still, the input signal shows random fluctuations of the phase with respect to the output.
Any ideas?
10-20-2014 09:36 AM
10-20-2014 09:53 AM
That was the best I could do! Here's the VI, hope it makes things easier.