07-23-2009 10:10 AM
Hello,
I am using DAQ assistant for acquiring data and displaying the data in a graph indicator.My device is PCI 6221 and DAQ board is SCB 6221.Now my problem is after running the program after 3-4 times it starts giving me an error message which says as follows:
"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."
My acquisition mode is continuous and I am giving samples to read a value 1000(which I guess the buffer size) and my sampling rate is 1kHz.Now if I change my samples to read to a value 10000 the graph gets too much noisy.And also at some point the program hangs.
I increased the sampling rate to 10K and my samples to read had a value of 100 but still it gave the error message.
Any suggestions would eb appreciated.
Thnaks
Solved! Go to Solution.
07-24-2009 03:03 PM
Hello,
I was able to run this code without any errors. Your error is being caused by this: The DAQ card is writing samples to the RAM at the sample rate (1K). Your loop is pulling 100 sample chuncks off. If your loop cant read at least 1000 samples in a second, the buffer will overwrite the unread samples eventually. Benchmark your while loop to make sure it is excuting at least 10 times a second. Use Highlight execution to make sure that write measurement filw VI is opening and closing properly.
If you change the sample rates, you dont want to use the same samples to read as the sample rate. The samples to read should always be less than the sample rate to allow the loop to go faster than the card writes data. But the other stuff in the loop is causing overhead which slows down the overal loop execution time, if it has to execute frequently. Making the samples to read approx 80% of the sample rate will give a good ratio.
07-25-2009 04:07 PM
Thnaks a lot for your reply.It works now.But now I am in a very starnge problem.Here is the description of my problem:
The sensor that we are using is supposed to measure the shear force when we move one stage on the other.Now even though there is no force applied in the stage or the stage is not moving and we run the program we get a signal and weird thing is it continuously decreases with time.So we cant rely on our force that we measure when the stage is running since the signal is continously decreasing with time.We also get an offset when the program starts running,in stead of starting from zero it starts from -0.103.
We checked the amplifier settings (our sensitivity of the amplifier is 7.5 pC/MU)and we are getting the signal from the right channel.
Any suggestions would be greatly appreciated.
Thanks