08-12-2011 10:03 AM
I am reading from a USB 6008 using DAQmx. I was reading from the unit as fast as I could in a for loop, but I was getting an occasional zero in the data. By adding a 1 millisecond delay in the loop, I was able to reduce the quantities of zeros being read. My question is, how do I query the buffer in the 6008 to tell if the zero is an actual value, or a number returned in place of there not being a number in the buffer?
Solved! Go to Solution.
08-12-2011 10:08 AM
There are many ways to read. Can you show us some code?
08-12-2011 10:15 AM
Here you go.
08-12-2011 12:10 PM
Are you looking to see if you get any errors on the error wire?
If there was some problem with the acquisition, you should see an error, and it might also return the default datatype out of the DAQmx read which would be a zero for a double precision numeric.
08-12-2011 12:13 PM
Yes, I look for errors later in the code. It isn't giving any. I suspect it is returning the default datatype, but I would like to know if what is returned is in fact the default, or was it an actual reading of zero.
08-12-2011 12:36 PM
That's kind of an odd way to acquire 100 samples. Why don't you try setting the sample rate to 1000S/sec, number of samples to 100, DAQmx Read to NSamp and get rid of the for loop? Setting the timing with a 1 msec wait is just wishful thinking.
08-12-2011 03:29 PM - edited 08-12-2011 03:32 PM
Thanks, Dennis. I don't do much with hardware and LabVIEW (it's usually files and databases), so those settings were unknown to me. After some reading and digging, though, I am on the right track.
And an o'scope proves the zeros are real. But I'm still in the dark on how to know if the zero from the DAQ is the default or if it is a real zero, without using a scope.
08-12-2011 03:33 PM
@slipstick wrote:
Thanks, Dennis. I don't do much with hardware and LabVIEW (it's usually files and databases), so those settings were unknown to me. After some reading and digging, though, I am on the right track.
And an o'scope proves the zeros are real. But I'm still in the dark on how to know if the zero from the DAQ is the default or if it is a real zero.
I think if you get a value and there is no error it is safe to assume the data is accurate.