User manual

Chapter 4: PowerDAQ Software (SDK)
77
Method C. Continuous Acquisition using ACB
See SDK Examples Stream2.c
Method C uses the PowerDAQ Advanced Circular Buffer mechanism.
Acquisition runs continuously and each time an event occurs, the
application takes control. You can create separate threads in your
application to run the acquisition process.
Analog input configuration is very similar to Method B, however the
buffer is setup is a different way:
Set up the buffers
Allocate and register the buffer with the board
# _PdAllocateBuffer(…)
Use as big a buffer as you need. The buffer size is limited
by the amount of memory installed on your PC. You can
specify from two to N frames to use. Frame size (in scans)
notifies the driver when the application wants to receive
eFrameDone events. In the case of two frames per buffer
we’re dealing with the classic double-buffering mechanism.
The larger number of frames makes the operations elastic
and decreases probability of buffer overflow.
_PdRegisterBuffer(…)
Set dwWrapAround = AIB_BUFFERWRAPPED to use
the circular buffer. The circular buffer mechanism is
explained in Appendix C.
Applications should process events in a different way. Each time it
detects eFrameDone events it means that one or more frames were
filled with data.
Acquisition
Wait for event notification