User manual
Chapter 3 Software Overview
© National Instruments Corporation 3-73 NI-DAQ User Manual for PC Compatibles
The first step for an application is to call
DIG_Grp_Config
to configure
individual ports as a group. Although the steps have been left out of the
diagram, you can alter the handshaking mode and enable pattern generation
as shown in Figure 3-24, and explained in the Digital Group Block I/O
Applications section earlier in this chapter. Next, enable double buffering
by calling
DIG_DB_Config
(second step of Figure 3-25). To start the
digital block input or output, call
DIG_Block_In
or
DIG_Block_Out
.
After the operation has started, you can perform unlimited transfers to or
from the circular buffer. Input operations transfer new data from the digital
buffer for storage or processing. Output operations transfer new data to the
digital buffer for output.
To transfer to or from the circular buffer, call the
DIG_DB_Transfer
function. After you call the function, NI-DAQ waits until it can transfer
the data before returning to the application. To avoid the waiting period,
call
DIG_DB_HalfReady
to determine if NI-DAQ can make the transfer
immediately. If
DIG_DB_HalfReady
indicates that NI-DAQ is not ready
for a transfer, your application can do other processing and check the status
later.
After the final transfer, you can call
DIG_Block_Check
to get the current
progress of the transfer. For example, if you are using double-buffered
output, NI-DAQ requires some time after the final transfer to actually
output the data. In addition, if NI-DAQ completes the block operation prior
to a
DIG_Block_Check
call,
DIG_Block_Check
automatically calls
DIG_Block_Clear
to perform cleanup work.
The final step of a double-buffered block operation is to call
DIG_Block_Clear
, which performs the necessary cleanup work after
a digital block operation. You must explicitly call this function if
DIG_Block_Check
did not already call it.
Note DIG_Block_Clear
halts any ongoing block operation. Therefore,
call
DIG_Block_Clear
only if you are certain the block operation is complete or if
you want to stop the current operation.










