Start the acquisition, Transferring results, Stop the acquisition – Measurement Computing WaveBook rev.3.0 User Manual
Page 138: Shut down wavebook, Book…… 8-4

8-4 Theory of Operation,
6-24-99
WaveBook User’s Manual
Start the Acquisition
Before beginning an acquisition, WaveBook must be configured for which channels to sample, how often to
scan, how many scans to acquire, and the trigger parameters. The daqAdcArm command starts the
acquisition. If the acquisition mode is pre/post-trigger, then WaveBook will immediately begin acquiring
the pre-trigger scans. Otherwise, WaveBook will wait for the trigger before sampling. Samples enter a
buffer, after being acquired by WaveBook. The PC reads the samples from the buffer.
Transferring Results
When samples are read from WaveBook, they are placed into a user-supplied data buffer whose size is
limited only by the PC's memory. The daqAdcTransferBufData command informs WaveBook about
the size and location of this buffer. It also specifies if the buffer is circular or linear, and if the command
should wait for the transfer to complete. As data is transferred into the buffer, the
daqAdcTransferGetStat
command may be used to retrieve the amount of data that has been placed
into the buffer and the state of the acquisition: Active or inactive.
Circular buffers are used when the data is processed as it is being received, or if only the last buffer-full of
data is of interest. As data is transferred into a circular buffer, if it becomes full, the data transfer continues
at the beginning of the buffer, overwriting old data. The daqAdcBufferRotate command may be used
to arrange a circular buffer into chronological order. Circular buffers are discussed in more detail later.
Linear buffers are not overwritten. If they become full during transfer, then the transfer stops until a new
buffer is provided.
The daqAdcTransferBufData command can wait until the transfer is stopped or can immediately
return to the user's program. In the "background" non-waiting mode, the user's program continues during the
transfer but must periodically check the status of the transfer. In the simpler "foreground" waiting mode, the
user's program cannot perform other operations during the data transfer. Foreground and background modes
are discussed in greater depth later in this chapter.
The acquired data may be automatically written to disk with the daqAdcSetDiskFile command that
must be invoked before the acquisition begins.
With WaveBook/512 only, for ease of interpretation, the 12-bit samples are normally transferred as 16-bit
words; but for increased efficiency, the data may be packed to transfer four samples in three 16-bit words.
The daqAdcSetDataFormat command controls this packing, and the daqCvtRawDataFormat
command may be used to unpack the received data.
Stop the Acquisition
The daqAdcDisarm command immediately stops data acquisition. The N-shot and pre/post-trigger
acquisition modes automatically stop when they are complete; however, both the N-shot with re-arm and the
infinite post-trigger acquisition modes will continue to collect data until they are explicitly stopped with the
daqAdcDisarm
command. The daqAdcDisarm command may also be used to stop N-shot and
pre/post-trigger acquisitions before they complete.
Shut Down WaveBook
After all the acquisitions are complete and WaveBook is no longer being used, it should be shut down with
the daqClose command. This helps to guarantee the proper operation of any printer attached through
WaveBook and assures that the hardware and software are in a consistent, stable state.