Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

read all available samples not working


   I have an experiment that generates several (always <10... 3 to 5 is the usual) triggers in the course of 1 second.  I am using a nice dg645 delay generator to produce this variable number of triggers (it varies depending on how long a camera uninhibits the delay generator's output), each of which is synched with my experiment.  The delay generator is set up to trigger my USB 6218 BNC DAQ.  If, after I start the attached VI, I allow the delay generator to create a number of pulses greater than 10 (the #of samples/channel fed to the input of the DAQMx timing vi), everything works soon as I stop the while loop, the samples are read and the data spits out.  


On the other hand, if I only allow 5 pulses to get to the usb6218 and then stop the while loop, I get an 200010 error and no data.  Note that I am using the read all available samples and a read finite samples sampling mode (see attached vi).  What am I doing wrong?  It all seems pretty simple what I am trying to do.  I know that there are probably lots of cheats around this, but I want to know how to use this function for future reference and it is driving me to drink.  


Any enlightenment is appreciated as I work on this holiday weekend.  J

Download All
0 Kudos
Message 1 of 3

With Finite Samples, the number of samples to read set to -1 on the DAQmx Read will try to read all samples defined.  This means that it is waiting for the task to complete (10 samples).  I would try setting the sample mode to be Continuous Samples.  Then the -1 will read all of the samples read so far.

There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 3


  Thanks for your response.  The Labview Help for the DAQMx read vi seems to disagree with you, however, as I have copied below:


"If the task acquires a finite number of samples and you set this input to -1, the VI waits for the task to acquire all requested samples, then reads those samples. If you set the Read All Available Data property to TRUE, the VI reads the samples currently available in the buffer and does not wait for the task to acquire all requested samples."


Still puzzled.  J

0 Kudos
Message 3 of 3