09-16-2025 01:15 PM
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!
09-16-2025 02:22 PM - edited 09-16-2025 02:23 PM
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:
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?
09-16-2025 08:25 PM
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.