03-11-2011 01:29 PM
Hi all,
I am using NI PCI-6251 on Labwindows. Basically i am acquiring two analog signals one of freq 200 Hz
and the other of freq 1 KHz using "ContAcqIntClk" example that is shipped with CVI.
The problem is that on the default settings that are
Samples per Chan = 1000
Sampling Rate = 10000
The program works fine but when i changed the sampling rate that is
Samp per chan = 1000
Sampling Rate = 20000
After running for approximately 25 seconds. The DAQmx gives the Error (-200279)
"DAQmxErrorSamplesNoLongerAvailable" . Why is this so?
It is mentioned in the specs of 6251 that it is capable of sampling at the rate of 1 MS/s,
so why it is giving error for only 20 Ksamples per second per chan.
I want to add one thing more that I am also writing the samples of the acquired signals
to the separate text files in the same while loop in which i am using DAQmxReadAnalogF64.
Any help will be greatly Appreciated.
03-14-2011 03:57 PM
Hello,
This could be due to a buffer overflow. The following Knowledge Base articles should be able to walk you through how to avoid this.
3WAC2E3Q: "Overwrite Unread Samples" Overwrite Mode causes Buffer Overflow Error -200279
http://digital.ni.com/public.nsf/allkb/64243F5D9995450B8625714F007C81F6?OpenDocument
2XQEAPQJ: Common NI-DAQmx Error Codes and Solutions
http://digital.ni.com/public.nsf/allkb/001DA4DB6A31CF8886256D33006FA857?OpenDocument
Hope this helps!
03-15-2011 01:14 PM
Hi Cody
I can not access the first link.
03-21-2011 08:15 AM
Me neither...
03-22-2011 05:19 PM
Good Afternoon,
I apologize, that didn't work. In order to work around this issue you must use the read position to seek to a virtual sample that is available for reading. In other words, set the RelativeTo DAQmx Read property to "Most Recent Sample" and set the Offset property to a negative number indicating how many samples you want to pull from the buffer. The attached example details how to do this. Hope this helps!
-Cody C
03-22-2011 05:55 PM
As explained in the second document linked to by Cody, this error is more related to overall program efficiency rather than daq device capabilities; this error arises when the samples you want to read had been overwritten by the daq card before you are ready to read them. This may be due to other activities your program is doing while acquiring. To answer your question with a second question: is your program capable of sustaining such an acquisition speed?
You said you are streaming measures to disk while during acquisition: this and other activities you are performing in your loop may reduce program eficiency until that sample rate can't be sustained over time. You may need to revise your code and move some of the stuff out of the loop (after acquisition completes) or use more efficient methods: output a subset of measures on screen instead of all measures, reduce or optimize measurement management / analysis, use binary files instead of text files, accumulate a chunk of data in memory and move them to disk only once in a time... the optimal strategy is heavily dependent on your actual needs and processing activity.