02-26-2014 09:20 AM
I get error -200621 sporadically with Continuous AO/AI in Non-Regeneration Mode. I repeatedly execute the following:
-Create tasks
-Write M samples to output buffer
-Start the tasks
-Read and write N samples in a loop. The timing is controlled by DAQmxReadAnalogF64 which waits until N samples are available.
-Stop and clear the tasks
(Note that M>=N but I found that the value of M has no influence)
Sampling frequency is 48 kHz, I am using one output and two input channels and N=16000 samples
The first time I do this always works. After that it sometimes throws the error after starting the tasks. If not the loop can continue indefinitely without error.
I have tried quite a few things without success. Switching to regeneration mode, switching DAQmxSetAODataXferReqCond, switching DAQmxSetAODataXferMech, changing DAQmxSetBufOutputBufSize
I suspect that it has to do with the timing of the data transfer from the PC to the device but have found no way to clear the buffer in the PC RAM.
Any ideas?
Martin
02-28-2014 06:58 AM
Hi,
what you describe seems similar to what is described in our Knowledge Base article :
http://digital.ni.com/public.nsf/allkb/D998B1DEB0F3C7198625732200518B42
Please let me know if that helps.
Aurelie
02-28-2014 09:08 AM
HI Aurelie,
Thanks for the suggestion! Unfortunately, it does not describe exactly what I experience. I should mention that it is not a VI but a C function that I am calling. I am calling the function once to start the tasks and then call it repeatedly (timed by the read function) to write new data. I can imagine if the time between the first call and the subsequent calls is too long, it will get buffer underflow. But even with 1 second worth of samples it does occur and this time should be plenty for the calls.
Is it maybe an issue with the timing of the output task and the input task (the latter providing the timing)?
Martin