LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Buffer Overflow Issues with Analog Data Acquisition

 

Hello,

 

I am using NI DAQ 9188 chassis with an analog input card to sample 4 analog voltages at 50hz for durations up to ~ 1 hour. I need to log the data with timestamps. 

 

I set up a very basic VI using the DAQmx assistant VI and the write to measurement file VI (flushing to excel every other iteration of the while loop). This worked fine with 50 samples to read at 50hz for 3 analog input channels. Now I have moved to 4 analog input channels, I keep getting error -200297 (hardware error, buffer overflow) after about 15 mins of running the VI. I have tried increasing and decreasing samples to read to no avail. I have tried flushing to excel only once instead of iteratively which also didn't work. I have tried flushing to excel less often (every 30 times in the attached version) which also doesn't work. I have read all the relevant help pages on the NI website as well but haven't found a working solution yet. I have tried the producer/consumer architecture with channels to transfer data from the daq loop to the logging loop but I couldn't get that to work. I have added the timer as suggested by NI to see how long the loop takes to run, and it seems to take the amount of time dictated by the 'samples to read', with a little fluctuation. However, if samples to read is small (5-20) then a significant spike in time elapsed in while loop can be seen on the iterations where data is flushed to excel which can even lead to variations in sample frequency. This spike is not seen/noticeable for say, 50 samples to read. 

 

I want to understand why the automatically allocated buffer is overflowing and what is the simplest way to achieve my goal of continuous, time stamped data acquisition. I have tried writing to lvm/csv file but that provided other errors and I would prefer to write directly to .xslx if possible. I don't have much experience using Labview so any advice would be very much appreciated, thank you!

 

0 Kudos
Message 1 of 3
(159 Views)

Hi QA,

 


QA1234!@ wrote:

I set up a very basic VI using the DAQmx assistant VI and the write to measurement file VI (flushing to excel every other iteration of the while loop). This worked fine with 50 samples to read at 50hz for 3 analog input channels. Now I have moved to 4 analog input channels, I keep getting error -200297 (hardware error, buffer overflow) after about 15 mins of running the VI.


It's because there are too many bended wires those stall the dataflow! 😄

 

More reasonable:

  • You use too many ExpressVIs for no good reason! ExpressVIs are good for "quick and dirty tests", but not for "run an important measurement for hours"…
  • You write to an Excel file: this is slow. Really sloooow! And so once the file gets bigger it will be too slow to write to…
  • There is senseless code: why do you need to merge an empty waveform and then even append an empty waveform???

Why are there locals? Where's their terminal?

Why is there a coercion dot at the time calculation?

Why don't you cleanup your code?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 3
(136 Views)

I recommend using shipping example from Help >> Find Examples >> Hardware Input and Output >> DAQmx >> Analog Input >> Voltage - Continuous Input.vi

The example uses the built-in TDMS logging feature.

 

If you want some data processing before the data logging, you can refer to Producer/Consumer Read Waveform Data and Write to TDMS at Two Different Rates

 

TDMS files can be opened with Excel.

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
-------------------------------------------------------
https://github.com/ZhiYang-Ong
Message 3 of 3
(86 Views)