08-17-2009 06:10 AM
Hello,
We are using a PCI-6115 in continuous acquisition mode at 10MHz.
We read the samples by blocks of 10e7 samples (i.e., by blocks of one second). Before reading the samples using the VI "Daqmx Read Analog 2D I16 NChan NSamp", we test whether the samples are available using the property "Daqmx Read --> Status --> Available Samples per channel":
Unfortunately, we do not catch errors related to buffer overflows. I mean, I made tests. And, when a buffer overflow occurs, instead of getting an error related to a buffer overflow, the property "Daqmx Read --> Status --> Available Samples per channel" simply returns 0 indefinitly.
This behavior is not what we want. We want something robust to detect buffer overflows. Is there a VI or a property to check whether a buffer overflow occured?
Instead of testing ourselves whether the samples are available, is it better to let the VI "Daqmx Read Analog 2D I16 NChan NSamp" do that with timeout=-1 directly?
Thank you,
Kind regards.
Solved! Go to Solution.
08-17-2009 09:20 AM
xred,
I don't have the hardware necessary to test this at the moment, but I think DAQmx Is Task Done.vi will do what you want. The issue with using the Available Samples per Channel property is that it is valid to call this when the task is technically done (error, or after acquisition of all samples in a finite task) to determine how many samples can be read. Since the error you have is a buffer overflow, there are no samples that can be safely read, so the query returns 0. In your error case, I would expect that DAQmx Is Task Done.vi would return True for "task done?" output, and the error code you were expected from the "error out" output.
Hope this helps,
Dan
08-18-2009 03:33 AM
Dear McDan,
Thank you for your solution.
It works!
Kind regards.