06-28-2013 08:39 AM
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
06-28-2013 09:49 AM
Have you tried using the minimum of requested samples and available samples? Like this:
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
06-29-2013 04:00 AM
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