DAQmx Read or Property Node Error -200279 in LabVIEW NXG

Updated Jun 25, 2018

Reported In

Software

  • LabVIEW NXG

Driver

  • NI-DAQmx

Issue Details

When I run a DAQmx application in LabVIEW NXG using DAQmx Read to acquire data continuously, I get the following error:
 
 
Possible reason(s):
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.

 
What causes this error, and how do I resolve it?

Solution

Error -200279 occurs because data in the DAQmx PC Buffer is being overwritten by data from the DAQ device before it has had time to be pulled into your DAQmx application by DAQmx Read.
 
 

Typically, data is overwritten in the DAQmx PC Buffer for one of two reasons:
 
  1. The Read rate for the DAQmx application is slower than the sample rate, causing samples to build up in the DAQmx PC Buffer until an overwrite occurs.
  2. The DAQmx PC Buffer is too small to hold the amount of data required by the task, causing an overwrite in the DAQmx PC Buffer before data has been acquired at all.

If addressing these two issues does not eliminate the error, it may also be worth reading through the following Additional Information at the bottom of this document. 

 

Reason 1:  Slow Read Rate

 
The read rate for your DAQmx application is determined by two factors -- the number of samples acquired per read, and the number of reads per second:
 
 
Error -200279 is often the result of the read rate above being slower than the sample rate of the DAQmx task, which is the rate specified via the DAQmx Timing property below:
 
 
When troubleshooting this error, the first step should be to ensure that the read rate and the sample rate for your application are the same.  
 
Since the read rate for your DAQmx application depends on both the number of samples you are requesting per DAQmx read, as well as the number of times that DAQmx Read is called in a second, you can adjust the read rate by explicitly controlling the number of samples required by the DAQmx Read, or by explicitly controlling the number of times that the while loop containing your DAQmx Read executes in a second using nodes such as Wait (millisecond):
 
 
Note:  DAQmx Read will automatically wait until the requested number of samples are available, so it is usually only necessary to control one of these factors in a particular application.
 
If you believe that your programmed read rate and sample rate are the same, you can also use loop benchmarking techniques, such as those shown below, to verify that the while loop is actually performing at the speed you expect:
 
 
If the while loop is performing more slowly than expected, you may need to implement a Producer/Consumer architecture in order to move other processes, such as logging, post-processing, analysis, and user interface (UI) functionality outside of the acquisition loop.  
 
Review Application Design Patterns: Producer/Consumer for more information about how to implement a basic producer/consumer architecture. 
 
Note:  If increasing the while loop performance is not an option, you may need to lower the sample rate for your application instead.
 

Reason 2:  Inadequate PC Buffer Size

 
Occasionally, this error can be resolved by simply increasing the size of the host side data buffer manually.  However, keep in mind that if the error is occurring because data is not being read out of the DAQmx buffer fast enough (see reason 1), increasing the buffer size will only delay the occurrence of the error -- it will not eliminate it completely.  

For information on how to increase the buffer size please refer to How Is the DAQmx Buffer Size Allocated for a Finite or Continuous Acquisition?

Additional Information

Buffer Monitoring with DAQmx Property Nodes

During a continuous, buffered acquisition, the buffer can be monitored to gain more information about how the current configuration affects the buffer.  If the number of available elements continuously increases during the acquisition, take one of the actions listed above to avoid eventually overflowing the buffer. To monitor the amount of data available in the buffer, use a DAQmx Read Property Node to read the Status:Available Samples Per Channel property.
 

Controlling LabVIEW NXG Dataflow to Avoid Overwrite Errors

In a continuous DAQmx acquisition, data is written to the buffer from the time that the DAQmx Start Task function executes until a DAQmx Stop Task function or DAQmx Clear Task VI executes. Between the time that the DAQmx Start Task VI executes and when the first DAQmx Read executes, the DAQmx PC buffer is being filled with data. If this interval is too long, then the buffer may be completely filled and the initial data will be overwritten before the DAQmx Read VI takes it out of the buffer, causing Error -200279.
 
The code snippets below show a common scenario in which dataflow execution can cause a buffer overflow error. In the first snippet, you can see that there is no guarantee that the DAQmx Start Task VI will execute after the Open/Create/Replace file VI (which will generate a pop-up dialog), so measurements will be filling up the buffer while you select a file, meaning that there is danger of a PC buffer overwrite.
 
 
To avoid this issue, connect the error input and output terminals of each function to ensure that the DAQmx Start Task VI executes after the Open/Create/Replace File VI has finished executing, as the second snippet shows:
 
 

Sample Rates with Dynamic Signal Acquisition (DSA) Devices

National Instruments DSA devices use a 24-bit delta-sigma analog-to-digital converter (ADC) that maximizes signal integrity by shaping noise and reducing distortion. These specialized ADCs use a master timebase that is divided down by discrete integer multiples to achieve several available sample rates; as a result, all DSA devices have a limited number of available sample rates. 

For example, the NI 9234 has a total of 31 possible sample rates, with a minimum sampling rate of 1.652 kS/s.  The number and value of available sample rates varies by DSA device and should be specified in your device specifications manual.

If the sampling rate for the 9234 device is set below the minimum rate using a DAQmx Timing VI or Property Node, the actual sample rate will be coerced up to the minimum rate available for the device in the background of the DAQmx API. Consequently, you may have designed an application with a read rate appropriate for a much lower sample rate than is actually occurring, which could lead to Error -200279.  

If you are using a DSA device for your acquisition, always consider the possible sampling rates and design your application appropriately.

Note: Consider using a DAQmx Timing property node and reading the Sample Clock:Rate property to verify which sample rate is actually being used by the device, regardless of the rate set at the DAQmx Timing VI.
 

WAS THIS ARTICLE HELPFUL?

Not Helpful