LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compare two DAQmx Read modes

For a continuous DAQmx acquisition, generally a start VI is put before a loop structure to request DAQ board to begin  continuously  reading data into buffer,  and  within loop  a DAQmx read VI is used to  continuously  retrieve data from buffer.

My question is, for the DAQmx Read VI, is there any performance difference between  'Nchanel N Samples'  and 'NChannel  1 Sample'?  My understanding is, the former  read all data  available in  buffer,  so maybe we can use larger value for  waiting until ***ms function, and for the latter, since only one data is read in each loop, we need to use smaller waiting value, to catch up with the board acquisition speed, therefore meaning the loop structure need to be executed much faster.

For my application, read only one data in each loop is easier for teatment, but I am concerning whether more frequent loop execution may cause decrease of performance. Any suggestion?

Thanks.
-Dejun
0 Kudos
Message 1 of 4
(2,672 Views)
When you use NChannel NSamples, you can read all of the data in the buffer or any sample count greater than 1. The acquisition is hardware timed. The sample to sample timing is very precisely controlled. I'm pretty sure that when you change to 1Sample, you are no longer using the DAQ board timing and instead are using only the highly variable timing in the while loop. In other words, the sample to sample timing is not constant because it all depends on the wait function and whatever else the os is doing that can delay it.
0 Kudos
Message 2 of 4
(2,663 Views)
I don't agree with you, Dennis, but maybe I am wrong Smiley Very Happy

Even though I use '1Sample' within a loop, there is still a hardware timing Vi before the loop, so the timestamp of each data point should still be determined from hardware timing, this is my understanding. The difference between '1Sample' and 'NSample' is just how many data are read from buffer in each loop execution. As to the timestamps of data in the buffer, they are already determined by the hardware timing, and therefore should be independent of how they are read in loop structure (1Sample or NSample).

Message Edited by Dejun on 08-30-2007 05:16 PM

0 Kudos
Message 3 of 4
(2,656 Views)
It doesn't matter whether you have a timing function or not. When you use the 1Sample mode, it gets the one sample whenever the loop iterates and the function is called. The hardware timing you may have specified is just ignored.
0 Kudos
Message 4 of 4
(2,649 Views)