Programming instructions

Chapter 7 Buffering Your Way through Waveform Acquisition
©
National Instruments Corporation 7-9 LabVIEW Data Acquisition Basics Manual
(your acquired data) as possible, so that you only have to make one trip to
the store. In this case, imagine that you must prepare a meal and you are
unable to go shopping—yet periodically you need things from the store for
your recipe. If you send someone else to the store for you, you can continue
to prepare dinner while someone else retrieves the other items you need.
You can compare this scenario to circular-buffered data acquisition, shown
in Figure 7-9. Using a circular buffer, you can set up your device to
continuously acquire data in the background while LabVIEW retrieves the
acquired data.
Figure 7-9.
How a Circular Buffer Works
A circular buffer differs from a simple buffer only in how LabVIEW places
the data into it, and retrieves data from it. A circular buffer is filled with
data, just as a simple buffer; however, when it gets to the end of the buffer,
it returns to the beginning and fills up the same buffer again. This means
data can read continuously into computer memory, but only a defined
amount of memory can be used. Your VI must retrieve data in blocks, from
one location in the buffer, while the data enters the circular buffer at a
different location, so that unread data is not overwritten by newer data.
Incoming Data
from the Board
to the PC
(AI Start.vi)
End of Data
Current Read Mark End of Data
Data transferred from PC
buffer to LabVIEW
(AI Read.vi)
Current Read Mark End of Data
End of Data Current Read Mark