User manual

© National Instruments Corporation 4-1 NI-DAQ User Manual for PC Compatibles
4
NI-DAQ Double Buffering
This chapter describes using double-buffered data acquisitions with
NI-DAQ. This chapter applies to counter operations. However, you can
read samples of any size.
Overview
Conventional data acquisition software techniques, such as single-buffered
data acquisition, work well for most applications. However, more
sophisticated applications involving larger amounts of data at higher
rates require more advanced techniques for managing the data. One such
technique is double buffering. National Instruments uses double-buffering
techniques in its driver software for continuous, uninterrupted input or
output of large amounts of data.
This chapter discusses the fundamentals of double buffering, including
specific information on how the NI-DAQ double-buffered functions work.
Note
Input and output refer to both digital and analog operations in this chapter.
Single-Buffered Versus Double-Buffered Data
The most common method of data buffering found in conventional driver
software is single buffering. In single-buffered input operations, a fixed
number of samples are acquired at a specified rate and transferred into
computer memory. After the memory buffer stores the data, the computer
can analyze, display, or store the data to the hard disk for later processing.
Single-buffered output operations output a fixed number of samples from
computer memory at a specified rate. After outputting data, the buffer
can be updated with new or freed data.
Single-buffered operations are relatively simple to implement, can usually
take advantage of the full hardware speed of the DAQ device, and are very
useful for many applications. The major disadvantage of single-buffered
operations is that the amount of data that can be input or output is limited
to the amount of free memory available in the computer.