User manual
Chapter 4 NI-DAQ Double Buffering
NI-DAQ User Manual for PC Compatibles 4-4 ni.com
Potential Setbacks
The double-buffered coordination scheme is not flawless. An application
might experience two possible problems with double-buffered input. The
first is the possibility of the DAQ device overwriting data before NI-DAQ
has copied it to the transfer buffer. This situation is illustrated by
Figure 4-2.
Figure 4-2. Double-Buffered Input with an Overwrite Before Copy
Notice that in Figure 4-2b, NI-DAQ has missed the opportunity to copy
data from the first half of the circular buffer to the transfer buffer while
the DAQ device is writing data to the second half. As a result, the DAQ
device begins overwriting the data in the first half of the circular buffer
before NI-DAQ has copied it to the transfer buffer (Figure 4-2c). To
guarantee uncorrupted data, NI-DAQ must wait until the device finishes
overwriting data in the first half before copying the data into the transfer
buffer. After the device has begun to write to the second half, NI-DAQ
copies the data from the first half of the circular buffer to the transfer
buffer (Figure 4-2d).
Incoming
Device Data
Overwrite Before
Copy
Circular Buffer
Transfer Buffer
Empty Buffer
Untransferred Data Transferred Data
a. b.
c. d.










