03-29-2024 07:31 AM
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.
03-29-2024 10:03 AM
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
03-30-2024 01:31 AM - edited 03-30-2024 01:33 AM
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
03-30-2024 01:32 PM
In your DAQ Read Loop you are: