Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Understanding and Avoiding Overwrite and Overflow Errors with NI-DAQmx

Primary Software: LabVIEW Development Systems>>Professional Development System
Primary Software Version: 8.0
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>Full Development System
Hardware: Multifunction DAQ (MIO)>>E Series>>PCI-MIO-16E-1

Problem:
What are overwrite and overflow errors, and how can I avoid them when using NI-DAQmx?

Solution:

Part I - Overwrite Errors in NI-DAQmx

An overwrite error is the most common error you might encounter when performing a circular buffered acquisition.  The error indicates that information has been lost and occurs when LabVIEW does not read data from the PC buffer quickly enough.  Samples that had been written to the circular PC buffer have been overwritten before they could be read into Application Development Environment memory.

To avoid an overwrite error, you need to increase the buffer size, read faster, or write slower.  Consider taking one or several of the following actions:

1.  Increase the number of samples per channel with the DAQmx Timing VI.  (Increases buffer size)
2.  Increase the number of samples per channel to read with the DAQmx Read VI.  (Reads faster)
3.  Decrease the samples per channel rate with the DAQmx Timing VI.  (Write slower)

You may also consider implementing a Producer/Consumer Design Pattern architecture.  The Producer/Consumer architecture allows you to read faster by removing analysis and presentation steps to a second loop.  The attached LabVIEW 8.0 example program demonstrates one way to implement a continuous acquire and graph algorithm using the Producer/Consumer architecture.

You may also consider using a faster computer, if that is an option.  A faster computer may enable you to transfer data between the PC buffer and the Application Development Environment memory at a higher rate.  

Part II - Overflow Errors in NI-DAQmx

An overflow error is another commonly encountered error when performing a circular buffered acquisition.  Overflow errors are more serious than overwrite errors because they indicate that information has been lost earlier in the data acquisition process.  Overflow errors indicate that the First In First Out (FIFO) memory buffer onboard your data acquisition card has reached its maximum capacity for storing acquired samples and can no longer accept new samples.  An overflow error is symptomatic of a bus transfer rate that falls short of the requested data input rate.




To avoid an overflow error, you need to use a Direct Memory Access (DMA) transfer mechanism, decrease the requested data input rate, or reduce the number of devices sharing the PCI bus.  Consider taking one or several of the following actions:

1.  Use a Direct Memory Access (DMA) transfer mechanism rather than an Interrupt Request (IRQ) data transfer mechanism.  DMA is faster than IRQ and can improve performance significantly.  For more information about using DMA, refer to the NI-DAQmx Help and the DAQmx Channel Property Node, Data Transfer Mechanism property.  (Note: DAQCard and USB devices do not support DMA.)
2.  Decrease the samples per channel rate with the DAQmx Timing VI.
3.  Disconnect other devices that may try to share the PCI bus.

You may also consider purchasing a device with a larger FIFO buffer.  Increasing the onboard memory will decrease the PCI bus bottleneck.  Another option is to purchase a computer with a faster bus to expedite data transfer from the FIFO buffer to the PC buffer.



Related Links:

KnowledgeBase 4EMEEPQ7: Understanding and Avoiding Overwrite and Overflow Errors with Traditional NI-DAQ 



Attachments:
ProducerConsumerExample.vi




Report Date: 09/04/2007
Last Updated: 11/13/2007
Document ID: 4D3AI5Q7

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