07-24-2012 12:21 PM
Can anyone tell me why I keep getting the following error? "Error-200279 occurred at DAQmx Read (Analog 1D Wfm NChan NSamp).vi:2"
It runs for a few moments then shows me the preceding. I attached my vi. I am using an NI USB-6009 to read in signals from my sensors and then control my Velmex VXM (Stepper Motor Controller). However, the DAQ Assistant keeps giving me issues.
Also, I am using LabVIEW 9 if it makes a difference.
Thanks in advance!
Solved! Go to Solution.
07-24-2012
12:24 PM
- last edited on
05-14-2025
09:44 PM
by
Content Cleaner
You're reading too slowly, samples are filling up the data buffer and you're not taking them out fast enough, so the buffer overflows. If you're reading data then doing a lot of processing straight after, it'll increase the amount of time before you can read from the buffer again. Try optimising your algorithms, reducing loop timing, or implementing some concurrency in your VI, on top of the recommendations in the above window.
07-24-2012 12:33 PM
Did you try looking at the explanation?
Error -200279 occurred at an unidentified location Possible reason(s): 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.
It sounds like you are not reading the data from the DAQ card fast enough and the buffer is overflowing. How fast is your loop going? What is this LVMDriverLV8.vi? I see it's called a lot. If he is slow, that would explain your buffer overflow. From what I'm seeing, I would put your DAQ code in a different loop than the LVMDriver code. Then your DAQ can run as fast as it needs to.
07-24-2012 03:11 PM
In response to crossrulz,
I did look at the explanation. My first interpretation of the explanation was the same conclusion you drew. I'm not sure how fast my loop is going, nor do I know how to check. The "LVMDriverLV8.vi" refers to the driver prescribed by the VXM manufacturer. I have tried using two loops but the problem still arises.
07-24-2012 03:43 PM
Put a millisecond timer in the loop and feed it to a shift register. Subtract the new value from the value coming from the shift register and display it in an indicator. Perhaps also a waveform chart as well. That will tell you how many milliseconds each loop iteration is taking.
My guess is that it is taking longer than 100 milliseconds. Since you are only grabbing 100 samples of data on every loop iteration (at 1000 Hz rate), you are eventually filling your DAQ buffer.
07-24-2012 04:31 PM
It takes about 200ms...
07-24-2012 04:37 PM
Your choice is then to increase your buffer to handle more than 200 samples, or find a way to decrease your loop time.
Or some combination of the above. Make sure you are reading all of the samples available when you get to the read.
Rob
07-24-2012 04:52 PM
How do I adjust the buffer?
07-24-2012 04:56 PM
I think you would be better off fixing the program. You say you created two loops but did not post that code. Your acquisition loop should not have the file write code and it should not have the VISA communication if you want to do continuous acquisition. You can change to Finite Samples or use the producer/consumer architecture.
07-24-2012 09:44 PM
Here is what I've got so far.