Error -200361: Buffer Overflow Error

Updated Aug 16, 2024

Reported In

Hardware

  • USB-6000
  • USB-6002
  • USB-6008
  • USB-6009
  • USB-6211

Software

  • LabVIEW
  • Measurement & Automation Explorer (MAX)

Driver

  • NI-DAQmx

Issue Details

I'm taking some measurements with my DAQ device, and I get the error -200361: Buffer Overflow Error, especially when I open or close a window in my computer, or have a scan running in the background using my antivirus software. I also get the error in NI MAX and in LabVIEW when I increase the sample rate or decrease the samples to read in a measurement input task.

Error -200361 occurred at an unidentified location

Possible reasons: Onboard device memory overflow. Because of system and/or bus-bandwidth limitations, the driver could not read data from the device fast enough to keep up with the device throughput.

Reduce the sample rate, or reduce the number of programs your computer is executing concurrently.

Solution

This issue is related to the fact that the DAQ devices have an onboard FIFO that can hold a finite number of samples, and therefore, it does not take long for the FIFO to overflow if you are acquiring at a high rate. Unfortunately, operations such as opening other programs, minimizing/maximizing windows, and running virus scans are very CPU intensive, especially with Windows OS. Consequently, when you perform these operations, the driver cannot retrieve data from the device, the FIFO overflows, and you get error -200361.

The best solution is to minimize all other operations on the computer.  This will reduce instances of buffer overflow. If possible, actually close down as many other applications as possible.

Another solution is to decrease the sample rate to avoid the overflow of samples in the buffer or to increase the number of samples to read using the DAQmx Read.vi, which will help empty the PC buffer faster.

Check Additional Information for less common solutions.

Additional Information

Less Common Cause:
It has been observed that rarely, after an unexpected power loss, a USB-6009 device may start throwing this error even when only trying to read 1 data point (On Demand acquisition) in a test panel. The devices appear in Measurement & Automation Explorer, pass the self-test, and appear properly configured in the Windows Device Manager.

To restore proper function, the devices had to be uninstalled from the Windows Device Manager and removed from the USB bus. Upon reconnection, the devices were detected, installed as normal, and proper function was restored.

Another Possible Cause:
NI has discovered that the likely cause of repeatedly seeing error -200361 is a bug in the Windows 7 EHCI driver when handling split transactions (which occur when queueing multiple IRPs on USB Full Speed devices such as the 6000/6008/6009).  Since NI does not have control over the Windows USB stack, the best we can do for now is to provide a workaround.  Limiting the number of outstanding transfer requests will prevent split transactions from occurring and thus will prevent error -200361 from being thrown incorrectly (there is still a possibility that -200361 is being thrown legitimately if the data transfers over USB cannot keep up with your sample rate for some other reason).
 
The following procedure is enabled by default in versions of DAQmx 9.6 or greater. If you are using any version later than this, you do not need to set this property. You can view the ReadMe which shows this linked below (CAR ID 331459).

To fix this issue, add a DAQmx Channel property node before starting the DAQmx task and select Analog Input»General Properties»Advanced»Data Transfer and Memory»USB Transfer Request Count Property.  This property is shown below.

If this property cannot be found, there are two solutions:
  • You need to upgrade to DAQmx 9.4 (this was when this property was added) or later
  • Right-click the property node and choose "Select Filter..."
  • Change the Filter Settings to "Show All Attributes":
After changing these filter settings, you should now be able to select the USB Transfer Request Count option from the channel property node.

Once you have the property node on the block diagram, right-click the property node and click Change All To Write.  Wire an unsigned 32-bit constant with the value 1 to the property node and place the property node before the start task as shown below.
  • Error -200361 may get thrown if the native USB Host Controller on the computer being used is not compatible with the USB device. If this is the case, we suggest moving to a different model of computer. 
  • You can receive Error-200361 in case of a spontaneous CPU frequency drop due to the corrupted PC hardware or third-party software causing the CPU to overload. Try to monitor the CPU Utilization and the CPU Speed