User manual
Chapter 3 Software Overview
© National Instruments Corporation 3-47 NI-DAQ User Manual for PC Compatibles
Double-Buffered Waveform Generation Applications
You also can configure waveform generation as a double-buffered
operation. Double-buffered operations can perform continuous waveform
generation with a limited amount of memory. For an explanation of double
buffering, refer to Chapter 4, NI-DAQ Double Buffering. Figure 3-17
outlines the basic steps for double-buffered waveform applications.
First, enable double buffering by calling
WFM_DB_Config
asshowninthe
first step of Figure 3-17.
Although every step is not in the diagram, you might also call
WFM_Rate
and/or
WFM_Scale
as described in the basic waveform application outline.
There are two ways in which your application can start waveform
generation. The first way is to call the high-level function
WFM_Op
.
The second way is to call the following sequence of functions—
WFM_Group_Setup
(only required on the AT-AO-6/10),
WFM_Load
,
WFM_ClockRate
or
WFM_Set_Clock
,
WFM_Group_Control
(operation=
START
). The
WFM_Group_Setup
function assigns one
or more analog output channels to a group. The
WFM_Load
function
assigns a waveform buffer to one or more analog output channels.
This buffer is called a circular buffer.The
WFM_ClockRate and
WFM_Set_Clock
functions (see the NI-DAQ Function Reference Online
Help file for the function that supports your device) assign an update rate
to a group of analog output channels. Calling
WFM_Group_Control
(operation=
START
) starts the background waveform generation.
WFM_Group_Control
returns to your application after the waveform
generation begins.
After the operation begins, you can perform unlimited transfers to the
circular waveform buffer. To transfer data to the circular buffer, call the
WFM_DB_Transfer
function. After you call the function, NI-DAQ waits
until it is able to transfer the data before returning to the application. To
avoid the waiting period, you can call
WFM_DB_HalfReady
to determine
if the transfer can be made immediately. If
WFM_DB_HalfReady
indicates
NI-DAQ is not ready for a transfer, your application is free to do other
processing and check the status later.
After the final transfer, you can call
WFM_Check
to get the current transfer
progress. Remember, NI-DAQ requires some time after the final transfer to
actually output the data.










