LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Simulated USB-6218 BNC device buffer error -200279

Hi all,

 

I am coding a simple continous AI DAQmx vi at home using signals from the simulated device above (no real device at home, just getting the basic architecture right first). I am sampling 5 channels at 2k each. The data are sent to a consumer loop where samples are presented via a waveform chart.

 

The DAQ runs fine initially... The DAQmx read buffer contains between 0-50 samples per loop iteration when reading 200 samples... After about 30sec the number of samples in the buffer suddenly starts to climb (DAQmx read slows down OR data removal from the buffer slows down?) and reaches the 10k limit where a -200279 error appears after about 45-50sec.

 

Nothing changes during when DAQ. I hit the "start" button, let the DAQ read and plot the data, and wait.

 

The same happens if I increase the samples to read to 400, but after 60s and 110-120 sec.

 

I don't understand why everything is initially ok for the first 30 seconds before the samples in the buffer start to climb. I would have thought if there were a problem the tne sample rate and samples to read the samples in the buffer would accumulate as soon as the DAQ is started.

 

Would anyone know why this behaviour is occurring?

 

Thanks.

 

 

 

 

   

0 Kudos
Message 1 of 4
(141 Views)

Code please?  (Preferably back-saved several LV versions, maybe pre-2020)

 

1. It could be a quirk in simulated devices.  I'm kinda inclined to say kudos to NI for even trying to simulate the possibility of a gradually building buffer backlog leading to an error.

 

2. If you were using a real device, I'd suspect a timing overconstraint.  This happens when your DAQmx Read implies a certain time per loop (200 samples at 2 kHz = 100 msec per loop) and then you also add something like a 100 msec wait timer in the same loop.  Eventually, those can get out of sync and you gradually build up a backlog in your buffer.   The best solution is to make sure you have one and only one thing controlling loop timing.  Usually that'll be DAQmx Read but there are exceptions.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 2 of 4
(98 Views)

Hi Kevin,

 

I have attached a simplified version of the main DAQ producer/consumer loops. I made a couple of small changes and the -200279 error when reading the data appears at about 1 min 40 secs...

 

If you watch the "Available Samples" indicator that is reading from the DAQ buffer, it reads quite low and is stable for some time, then quickly climbs to the 10,000 limit and overflows (5 channels x 2kHz)...

 

Any suggestions for why the buffer data suddenly increases and eventually overflows, when there is no initial problem, would be greatly appreciated...

 

The .vi is in 2014 SP1, which is the latest version I have.

 

I will go to work later today and see if this behaviour still occurs when using a real device and let you know.

 

Thanks.

Jack  

 

 

0 Kudos
Message 3 of 4
(62 Views)

In your DAQ Read Loop you are:

  1. Building an infinite array. You are constantly adding new points to it, eventually you will run out of memory along with take a too long time to transpose your array. Just send the newest points in the queue rather than the new and old points.
  2. You are reading a property node in your loop.This causes a switch to the UI thread; you want to avoid this. In this case it is better to use a local variable instead of a property node. HOWEVER, this is only a band aid. Look in the example folder for DAQmx with Events; you can use an event structure to stop your loop.
  3. Your diagram is too big. I can't find where the queue is sending data to.
0 Kudos
Message 4 of 4
(42 Views)