03-18-2008 04:56 AM - edited 03-18-2008 04:58 AM
03-20-2008 08:39 AM
While a circular buffer works well in many applications, two possible problems can occur with this type of acquisition: Your application might try to retrieve data from the buffer faster than data is placed into it, or your application might not retrieve data from the buffer before NI-DAQmx overwrites the data into the buffer. When your application tries to read data from the buffer that has not yet been collected, NI-DAQmx waits for the data to be acquired and then returns the data. If your application does not read the data from the circular buffer fast enough, you receive an error, stating that some data has been overwritten and lost. If losing data in this way is not important to you, change the setting of the DaqStream.ReadOverWriteMode property. So for example, suppose you had a Task object named inputTask. Therefore to set this property you would say something like:
inputTask.Stream.ReadOverwriteMode = ReadOverwriteMode.OverwriteUnreadSamples;03-20-2008 10:46 AM
03-20-2008 12:05 PM
03-21-2008 04:29 AM - edited 03-21-2008 04:35 AM
Hi Jonathan,
Thanks for your reply.
Sorry about the unclarity I've made. I do set ReadOverwriteMode property to OverwriteUnreadSamples by myTask.Stream.ReadOverwriteMode = ReadOverwriteMode.OverwriteUnreadSamples before I call the method BeginReadMultiSample and I still get the error message: Attemp to read samples that are no longer available...
In my case, my calculations indeed take quite long time and probably the previous data are overwritten by the new ones.
But since I have already set the property, I do think the read operation could gain the new data in the buffer rather than an error message. Is there any possible that I misunderstand the property?
Thanks again.
03-21-2008 07:43 AM
03-21-2008 11:56 AM
03-22-2008 10:05 AM - edited 03-22-2008 10:13 AM
03-22-2008 10:34 AM
03-22-2008 07:07 PM