Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Error -200278

The error I get is "Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available." Can anyone help me correct this? The code is attached.
0 Kudos
Message 1 of 8
(7,401 Views)
Look at the DAQmx timing VI for your analog measurement section of the code. Herre you have given sample mode as 'finite samples'. Make it 'continuous samples'
0 Kudos
Message 2 of 8
(7,390 Views)
Hi - having a similar problem myself.  I'm capturing data using a USB-9215A (USB-9162+USB-9215) on a recently upgraded version of LV 8.20 (problem was occuring before the upgrade as well).

Just in case there's some minor difference, here is the full text of my error:
Error -200278 occurred at DAQmx Read (Analog 2D DBL NChan NSamp).vi:1
Possible reason(s):

Attempted to read a sample beyond the final sample acquired. The acquisition has stopped, therefore the sample specified by the combination of position and offset will never be available.

Specify a position and offset which selects a sample up to, but not beyond, the final sample acquired. The final sample acquired can be determined by querying the total samples acquired after an acquisition has stopped.

Attempted to Read Sample: 0

Property: RelativeTo
Corresponding Value: Current Read Position

Property: Offset
Corresponding Value:

Task Name: _unnamedTask<3F36>



0 Kudos
Message 3 of 8
(7,362 Views)
Here's a jpg snapshot of my problematic section of the code.

0 Kudos
Message 4 of 8
(7,359 Views)

What is the 'sample rate' and 'samples to read' values that you have set?

Althrough you are trying to perform continous acquisition, from you picture, it seems you are doing it wrong

Why have you put all the functions inside the while loop??

Put these functions outside the while loop: DAQmx create virtual channel, DAQmx timing , DAQmx start

Only DAQmx read must be inside while loop for continous acq

0 Kudos
Message 5 of 8
(7,357 Views)
Hi devchander... thanks for the reply.  Honestly I've been piecing this code together and I didn't give any thought to placing the other bits outside the while loop.  I've got it all inside a while loop because I'm using a ms timer to track real-time timestamps each time data is recorded.  I'm basically grabbing the data in continuous bunches, averaging it ("samples to read" = number of samples averaged in each loop), and recording it before going back and starting the capture again.

I've been varying sample rate from 1000-20,000Hz (upper limit for the 9215A I think)...

Samples to read is being set anywhere from 1,000-20,000 depending on how rapid data capture must be.  My experiement calls for some fast time-scale and some slow time-scale measurements.

I've moved the bits you suggested outside the loop and will leave it running to see what happens.

I should point out that the error doesn't occur immediately or at a fixed time/interval.  It's happened to be dozens of times and I can't isolate any particular event/timing that relates them all.  Sometimes it fails within minutes, other times it doesn't fail for 12+ hours.

Cheers.
0 Kudos
Message 6 of 8
(7,353 Views)

I should point out that the error doesn't occur immediately or at a fixed time/interval.  It's happened to be dozens of times and I can't isolate any particular event/timing that relates them all.  Sometimes it fails within minutes, other times it doesn't fail for 12+ hours.

That would depend on what processing that you are performing on the acquired 2D data
Once this processing becomes an overhead on acquisition, you can expect an error
0 Kudos
Message 7 of 8
(7,350 Views)
Let me see how this goes overnight... and if/when it fails again... I'll start asking advice on optimizing the rest of my code.  Overall it's fairly simple, but I know that I've overcomplicated it.
0 Kudos
Message 8 of 8
(7,347 Views)