07-24-2014 07:03 AM
I cannot seem to figure out what happened to my vi and why all of a sudden I am getting a buffer overrun error. It is attached.
This is the error I am getting
Error -200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi
Possible reason(s):
Measurements: Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten.
What I am trying to do is just read and plot the data as quickly and efficiently as possible with as high a sampling rate as possible. I tried to sample at a higher rate (1kHz) but then my data has giant gaps in it on my charts ( i am just reading a voltage though so I don't know why that would be the case) . I added a buffer greater than 1000 samples, tried to change the sample buffer like the ni error article suggested and I can't seem to figure this out. all the daqs except for dev 5 are the same. 5 has 16 analog input channels but im only using 10 of them.
07-24-2014 07:12 AM
1) Do not set the buffer size. With continuous samples, it defaults to as much as the DAQ card can handle.
2) You need to read more than 1 sample at a time. Reads 10 samples. At 1kHz, that would be 10ms worth of data at a time.
3). You have a lot of processing and saving to disk happening in there. Look into using a Producer/Consumer setup to put your logging to the TDMS file into another loop. It won't slow down your reading from the DAQ that way.
07-24-2014 07:16 AM
07-24-2014 07:20 AM
@labview12110 wrote:
Where would I set that read ten samples is that on the sample clock?
DAQmx Read. You want Multiple Channels, Mulitple Samples. Then there will be an input for the number of samples to read.
07-24-2014 07:24 AM
07-24-2014 07:34 AM
07-24-2014 07:42 AM
Yes, you will want a 2D array of doubles.
You could do your color calculations inside of two FOR loops (one inside of the other) or just take one sample out of the ones read.
07-24-2014 07:56 AM
07-24-2014 08:20 AM
Attached is a new VI with a queue system. My only issue is that my data is not all present in the file and is out of order. I also did not get all of it in the spreadhseet.