LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Finite sampling NI USB 6008

I am very new to Labview but have managed to get my NI USB 6008 to sample two channels of data, save to a file etc. However, I am trying to get it to just collect, say, 1000 samples and stop. It does this but stops with an error. The VI I am using stared life as an example from "Labview for everyone". I have spent a lot of time trying to figure out how get it to stop cleanly once the 1000 samples have been collected, but no matter what I do, the error always occurs: "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."

 

I have also read many of the posts on this forum relating to finite sampling. I have tried some of the things suggested in them but to no avail.

 

I would be very grateful if someone could take a look at the attached VI and tell me what I need to do, please. I have tried so many things that I thought something would have worked by now, even if only by chance!

 

Very many thanks,

 

Peter

0 Kudos
Message 1 of 3
(2,617 Views)

Have you tried using the minimum of requested samples and available samples?  Like this:

 

Screen Shot 2013-06-28 at 9.45.09 AM.png

 

Right now you take the maximum.  This means that on the last loop iteration you request more samples than are available and you get an error.  Taking the minimum you will never ask for more than are available.  You may however loop faster than necessary (i.e. you will grab all available samples as fast as possible rather than in the specified chunk size).

 

~Simon

 

 

0 Kudos
Message 2 of 3
(2,601 Views)

Hi Simon,

Very many thanks for your helpful suggestion. I am on a steep learning curve but enjoying it >most< of the time!

Best wishes,

Peter

 

0 Kudos
Message 3 of 3
(2,575 Views)