Error -200279 when Running Data Acquisition with Python and NI-DAQ™mx

Updated Aug 4, 2023

Reported In

Driver

  • NI-DAQ™mx

Programming Language

  • Python

Issue Details

Error -200279 as below occurred after doing continuous acquisition for a certain amount of time.
Increasing the buffer only prolong the time before the error happened, and did not solve the error.

The application is not able to keep up with the hardware acquisition.
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.
Property: DAQmx_Read_RelativeTo
Corresponding Value: DAQmx_Val_CurrReadPos
Property: DAQmx_Read_Offset
Corresponding Value: 0

Task Name: _unnamedTask<0>

Status Code: -200279

Solution

If Python visualization tools such as matplotlib library is used in the same loop as task.read(), the processing by the visualization tools can affect the overall task.read() execution rate which leads to buffer overflow.
Reducing the acquisition rate might solve the issue but it might not be the best solution when a higher acquisition rate is required.
Ultimately, placing the visualization process in another loop so the data acquisition and visualization run in parallel is the recommended way to prevent hardware buffer overflow.