LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is wrong with my vi?

Solved!
Go to solution

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!

0 Kudos
Message 1 of 11
(3,506 Views)

ReadError.PNG

 

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.

 


Alex Thomas, University of Manchester School of EEE LabVIEW Ambassador (CLAD)

0 Kudos
Message 2 of 11
(3,504 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 11
(3,496 Views)

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. 

0 Kudos
Message 4 of 11
(3,470 Views)
Solution
Accepted by topic author Brandon170078

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.

0 Kudos
Message 5 of 11
(3,461 Views)

It takes about 200ms...

0 Kudos
Message 6 of 11
(3,450 Views)

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

0 Kudos
Message 7 of 11
(3,447 Views)

How do I adjust the buffer?

0 Kudos
Message 8 of 11
(3,441 Views)

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.

0 Kudos
Message 9 of 11
(3,435 Views)
0 Kudos
Message 10 of 11
(3,417 Views)