Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
4 rating:
 1.5 out of 5     Rate this Document

Understanding and Avoiding Overwrite and Overflow Errors with Traditional NI-DAQ

Primary Software: Driver Software>>NI-DAQ
Primary Software Version: 7.1
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>Professional Development System
Hardware: Multifunction DAQ (MIO)>>E Series

Problem:
I am receiving Error -10845 (Overflow Error) or Error -10846 (Overwrite Error) when performing a buffered analog acquisition using Traditional NI-DAQ.

Solution:
Error -10845 is a hardware buffer (FIFO) overflow error and Error -10846 is a software buffer overflow error. 

Overflow Error -10845

What it is:
Overflow error -10845 occurs when the NI-DAQ driver cannot read data from the DAQ device's FIFO buffer fast enough to keep up with the acquired data as it flows into the buffer (i.e., the FIFO buffer overflows before all the original data can be read from it).  This is usually due to limitations of your computer system, most commonly the result of slow processor speeds (< 200 MHz) in conjunction with PCMCIA DAQ boards, which have small FIFO buffers (e.g., the DAQCard-500).  Another cause of the -10845 error could be due to an interrupt-driven acquisition.  For example, PCMCIA bus does not support Direct Memory Access (DMA).  If the system is tied up processing another interrupt (like performing a screen refresh or responding to a mouse movement) when it is time to move data from the board, then that data may get overwritten.

How to fix it:
Sometimes using a DAQCard with a larger FIFO can solve the problem, but a better solution is to lower the acquisition rate or move to a faster system.  You may also want to try reducing the number of devices sharing the PCI bus. 

Overwrite Error -10846

What it is:
LabVIEW uses an internal acquisition buffer to store data as it is acquired.  If you acquire more data than will fit in the buffer, then the buffer acts as a circular buffer and is filled more than once. You will get an overwrite error (-10846) if you do not read data out of the buffer before it is overwritten with new data.

How to fix it:
This problem can be solved by adjusting the parameters of your data acquisition, such as lowering the scan rate, increasing the buffer size, and/or increasing the number of scans to read from the buffer on each buffer read.  A good rule of thumb to start with is to make your buffer size 2 - 4 times as large as the number of scans to read.  Also consider performing less processing in the loop to help avoid the -10846 error.  If upgrading your PC's processor is an option, you may also want to think about doing so since a faster computer may be able to transfer data between the PC buffer and the application buffer at a higher rate.

The "Cont Acq&Chart [buffered].vi" shipping example allows you to set the scan rate, the size of the data buffer, and the number of scans to read at a time from the Front Panel.  If your buffer is too small, or you are not reading data out of it fast enough, then you will get the overwrite error. If your buffer is too big, you may get an out of memory error.

If you ignore Error -10846, you can continue to acquire and read data, but you must remember that data has been lost.  Furthermore, the iteration of AI Read which returns this error does not return data.  If you configured AI Read to output a scaled array, the array will be empty.  If you configured AI Read to output a waveform, the waveform will contain a t0 equal to the t0 from the next iteration of AI Read.  The y array contained in the waveform will be empty.  The next iteration of AI Read after receiving the error, assuming this iteration does not return an error, will have a correct t0 and y array.  The screenshot attached below, Error -10846.gif, illustrates this behavior.

Related Links:
KnowledgeBase 4D3AI5Q7: Understanding and Avoiding Overwrite and Overflow Errors with NI-DAQmx
KnowledgeBase 3HHCUO40: Overflow and Underflow Errors with Traditional DAQ

Attachments:

Error -10846.gif






Report Date: 10/23/2007
Last Updated: 11/13/2007
Document ID: 4EMEEPQ7

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit