LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Read Error -200279

Hi,

 

I am reading a few channels of data at a fairly high speed during hours from a USB-6221 DAQ.

During setup I set...  RSE, 1000Hz, Continuous Samples, a buffer of 10.000 samples per channel.

Then I loop through the DAQmx Read for hours with Timeout=-1 and NumberOfSamplesPerChannel=5 and after having retrieved the data for each iteration I do some plotting and such (but no disk access) and return for the next iteration (for a total of 400.000 iterations).

 

The aim of the task is to collect data (for hours) on a continuously fed sheet at every 5 millimeters and at the highest possible sheet feed speed.

 

When the conditions are more relaxed, it works fine, but with the settings above I get an error which halts the execution (until responded to)

 

The Error is -200279 DAQmx Read (Analog id nfm nchan nsamp).vi Attempted to read samples that are no longer available.

 

I believe that that means that my housekeeping chores on average take too long such that eventually the 10k buffer fills up and data starts getting overwritten.

 

It seems a good idea to make sure that I always get to the DAQ Read in time, but I am not certain what would be the best strategy to ensure that that would happen. Any suggestions are welcome.

 

I would also be helped by a "buffer utilization meter", but I have found no way to realize that. Any ideas how to feed back to the operator that "your buffer is filling up at a rate of X% per minute, unless you change something it will overflow in about 30 minutes".

 

Any ideas about how this task should be performed to make sure it works (or at least gracefully degrades 😉

I think there is some knowledge still missing, so any fresh ideas are most welcome.

Attached is the portion of the diagram.

 

Kind regards / Ake

 

 

0 Kudos
Message 1 of 4
(2,899 Views)

Why do you just read 5 Samples per call of DAQmx Read.vi ?

To don't get an overflow of the buffers you will need to read that 5 Samples with a loop-rate of 200kHz.

 

 

Christian

0 Kudos
Message 2 of 4
(2,889 Views)

The plain and simple explanation is that the project started at an immensely lower sheet speed, By then it seemed natural to to read the data "every 5mm". So I just increased the reading rate as the sheet speed increased, until the error...

 

But, would reading, say 100 data points, and then executing a secondary loop 20 times, to extract the 5 ms averages I want, really make a difference. The only time saved (?) would be that of the DAQmx Read I suppose (all the other code has to be run once per 5 ms sample anyhow).

 

So maybe the answer is to, either increase the buffer (how large can I make it), or never to sample more often than the rest of the loop allows (by measuring the loop time).

 

In the latter case it would be nice to have this "bargraph" turning more red as the free buffer decreased.

 

Kind regards / Ake

0 Kudos
Message 3 of 4
(2,882 Views)

Let us see where this error is coming from.

Actually there are three buffers, one at the card (FIFO), one in the RAM allocated by DAQmx and another one in the RAM allocated by LabVIEW.

So when you acquire with 1KS/s and you only read the data with a slower rate in LabVIEW, the buffers fill up until the FIFO of the card gets an overflow and DAQmx returns error -200279.

 

With a little search you will find lots of discussions regarding this error at this forums.

This KB is giving you more information regarding the error and several steps how to avoid it.

In general it is to read data faster or more frequently, to increase the buffer size (RAM) or to acquire slower.

 

Btw, to monitor the buffer just use the DAQmx Read property node with the "Available Sampels Per Channel" property.

 

 

Christian

0 Kudos
Message 4 of 4
(2,876 Views)