LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Attempted to read samples that are no longer available.

I am in the process of putting together an acquisition application that takes input data from a DAQCard 6036E; but whenever I try to read the input at a scan rate of 25600 and 100 samples per channel I get an error message that tells me:

Attempted to read samples that are no longer available.
The requested sample was previously available, but has since been overwritten.

Increasing the buffer size, reading the data more frequently, or specifying a fixed number of samples to read instead of reading all available samples might correct the problem.

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:

Task Name: _unnamedTask<1>

I tried to manipulate the buffer but had no luck.

Can anyone provide me with some directions in what I am doing wrong?
Are there some limitations on the card that I need to be aware of?

Any input would be greatly appreciated.

Thank you.





0 Kudos
Message 1 of 7
(10,574 Views)

Just increase the number of samples to read to a more optimal value and it will work fine

equal or half or one tenth of the scan rate and it should work fine.

Note : these valuse are no standard specs for this parameter, i just suggest them to avoid buffered values being overwritten

 

0 Kudos
Message 2 of 7
(10,565 Views)
What if I need to scan at a high frequency but with low resolution?
It seems that everything I try will not solve the problem.


Thank you.
0 Kudos
Message 3 of 7
(10,557 Views)

Minguccio,

When that error message is displayed, the DAQ card has run out of room to store data in your PC buffer.  This is caused when your application is not reading data out of the buffer fast enough. In DAQmx you do not need to specify the buffer size because the driver selects a value for you based upon the samples per channel on the DAQmx timing vi.  You can set the buffer size though the DAQmx configure input buffer vi, but this is usually not necessary.

If you change the value called 'number of samples per channel' on the DAQmx Read, you might be able to get past this problem.  Typically 25- 50% of your buffer is recommended.

Regards,

Jesse O.
Application Engineering
National Instruments

Jesse O. | National Instruments R&D
0 Kudos
Message 4 of 7
(10,548 Views)
Hi I am getting the same error "Attempted to read samples that are no longer available. The requested sample was previously available, but has since been overwritten" (see WordPad Doc attached) and I am using the DAQmx with sample rate of 1KHz and reading 100 samples continuosly.
 
The interesting thing however, is that if I run the VI continuosly then I don't get any problem, but when I run the VI as part of a Test Stand Sequence, then it fails only on the second run of the sequence (passes the first time I run the sequence).
 
I have tried my samples to read (buffer) value with 100, 200 500 samples and I get the same error every time. Please help... as I have tried whatever I can think of, and this VI runs fine by itself, but fails on a second pass in a sequence.
 
Shoab
0 Kudos
Message 5 of 7
(10,368 Views)
Is there some amount of time passing between the first run of the test stand sequence and the second run?
 
I'm visualizing this:
1.  Daqmx task is configured and run.
2.  Data is read in during the first test stand sequence for a while.
3.  Other stuff happens for awhile and data is not being read in.
4.  The second run of the test stand sequence is started.
 
But during #3, the Daqmx task is still loading data into the buffer and overwriting it when the buffer fills up.  When the next data point is read in #4, the LV throws an error saying that the requested data has been discarded.
 
Perhaps a way to stop or pause the Daqmx task at the end of #2 and restarting it at the beginning of #4 will solve the problem?
Message 6 of 7
(10,363 Views)
After trying a couple of things, one thing worked. I wired the output of the For-Loop iteration, after comparing it to the # of Loop Count, to the STOP input of the DAQmx. So once the iteration reached the # of loops, that the FOR loop is supposed to run, it stops the DAQmx and then on the second pass of the sequence this problem does not show up anymore.
 
Thanks again for looking into this.
 
Shoab
0 Kudos
Message 7 of 7
(10,346 Views)