05-29-2016 09:27 PM
All,
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 great...as 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
05-30-2016 05:44 AM
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.
05-30-2016 09:07 AM
Sir,
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