LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sample to read vs recording speed ( hopefully quick question)

    I have a DAQ Assistant in a while loop that monitors 4 analog channels at 6000 Hz.  They are set for continous read, and "samples to read" is set for 1000.  I have this streaming to a LabView measurement file, and also some gauges.  The question i have is would I see better results if I set the samples to read higher? Maybe somthing like 3000 or 4000? Would I get any benefit out of this?  Since I have the channels set as continous does the buffer length even matter?   The way I understand it is that the "samples to read" is just setting a buffer length.  Also there isn't anything else going on in that loop. 
 
V/r,
Chris
 
0 Kudos
Message 1 of 2
(2,501 Views)
Hello Chris,

If I am understanding your question correctly, you are trying to determine the best samples to read for your application.  To best understand what will work best, I think it is easiest to explain exactly what that value is.  The only thing that you really care about is that the Samples to Read value determines the number of samples returned each loop iteration. It is a blocking function, so if the value is high, everything will wait until that number of samples are available for the loop iteration to end.  It does do some buffer sizing stuff, but DAQmx takes care of all of that behind the scenes.  We usually recommend that the Samples to Read be set at about 10% (or greater) than your sampling rate.  This usually takes samples out of the buffer fast enough to avoid problems.  However, because you are writing to a file each loop (which takes significant time) you probably want higher than this.

Take a look at this article.  It describes the different errors people most often get when it comes to buffer stuff (and Samples to Read) and should clear things up.

So in short:  Your 1000 Samples to Read should be fine. So would a higher value.
Neal M.
Applications Engineering       National Instruments        www.ni.com/support
0 Kudos
Message 2 of 2
(2,465 Views)