User manual
Chapter 4 NI-DAQ Double Buffering
© National Instruments Corporation 4-5 NI-DAQ User Manual for PC Compatibles
For the previously described situation, NI-DAQ returns an overwrite
before copy warning (overWriteError). This warning indicates that the
data in the transfer buffer is valid, but some earlier input data has been lost.
Subsequent transfers will not return the warning as long as they keep pace
with the DAQ device as in Figure 4-1.
The second potential problem occurs when an input device overwrites data
that NI-DAQ is simultaneously copying to the transfer buffer. NI-DAQ
returns an overwrite error (overWriteError) when this occurs. The
situation is presented in Figure 4-3.
Figure 4-3. Double-Buffered Input with an Overwrite
In Figure 4-3b, NI-DAQ has started to copy data from the first half of the
circular buffer into the transfer buffer. However, NI-DAQ is unable to copy
theentirehalfbeforetheDAQdevicebeginsoverwritingdatainthefirst
half buffer (Figure 4-3c). Consequently, data copied into the transfer buffer
might be corrupted; that is, it might contain both old and new data points.
Future transfers will execute normally as long as neither of the problem
conditions re-occur.
Incoming
Device Data
Circular Buffer
Transfer Buffer
Empty
Buffer
Untransferred
Data
Transferred
Data
Corrupted
Data
a.
b.
c.
Overwrite Error










