beautypg.com

Background-circular transfers, Direct-to-disk transfers – Measurement Computing WaveBook rev.3.0 User Manual

Page 155

background image

WaveBook User’s Manual.

6-24-99

Theory of Operation 8-21

Background-Circular Transfers

Background-circular transfers may be used to allow processing to continue while acquiring just the last
buffer-full of data (like foreground-circular transfers), or they may be used to allow processing of all the
data while it is being acquired (like background-linear mode). It may also be used to allow the application
to continue during direct-to-disk transfers.

If only the final buffer of data is of interest, then background-circular transfer can be used just like
foreground-circular; but instead of the data being ready when daqAdcTransferBufData returns, the
application program will continue while the data is acquired and can use daqAdcTransferGetStat to
know when the acquisition is done. The application can then use daqCvtRawDataFormat, if needed,
and daqAdcBufferRotate to process the data.

If all of the data is of interest, then wbkGetBackStat can be used to monitor the acquisition's progress.
After some of the buffer has been filled, it may be processed while the remainder of the buffer is being
filled. Then, once the first part has been processed and some of the remainder filled, the new data may be
processed while the old data is overwritten. The alternating portions are processed until the acquisition is
complete.

Direct-to-Disk Transfers

WaveBook can automatically copy transferred data to a disk file. If such a direct-to-disk transfer is enabled
with the daqAdcSetDiskFile command, then WaveBook copies the data to the disk after it has been
transferred into the data buffer in the PC's memory. Direct-to-disk is easiest to use with foreground-circular
transfers, but it can be used with background transfers or linear buffers.

When used with a foreground-circular transfer, the direct-to-disk function is completely automatic: all of the
acquired data is automatically written to the specified disk file. Background-circular transfers are somewhat
more difficult; samples are written to disk only when daqAdcTransferGetStat is invoked. The
application program must invoke daqAdcTransferGetStat often enough to allow the data to be
written to disk before it is overwritten by new samples and lost.

Direct-to-disk may also be used with foreground-linear or background-linear transfers; but in these cases,
the application program must start new transfers as each linear buffer is filled.

Regardless of the transfer type, the data is written to disk in the same format: a continuous stream of data
words, exactly as received from WaveBook. If data packing is enabled (with WaveBook/512 only), then
the disk file will contain packed data (otherwise, unpacked data). The file does not contain any other type
of information. If any other information needs to be stored, such as the scan composition or rate, then the
program should write that information to the file before starting the acquisition and configure the direct-to-
disk transfer to append to the data file.

After the acquisition is complete, the application program can analyze the stored data by reading the file
and, if necessary, unpacking the data.