User`s guide
PCIS-DASK Application Hints ? 27
4
.3.3 Non-double-buffered Asynchronous Continuous Digital input programming Scheme
This section described the function flow typical of non-double-buffered asynchronous digital input operation. While
performing continuous DI operation, the DI configuration function has to be called at the beginning of your application.
In addition, for asynchronous DI operation, the SyncMode argument in continuous DI functions has to be set as
ASYNCH_OP.
DI_xxxx_Config
(
xxxx means the card type,
e.g. DI_7200_Config
)
DI_ContReadPort /
DI_ContReadPortToFile
DI_AsyncCheck
Operation complete?
Yes
No
With SyncMode=ASYNCH_OP
DI_AsyncClear
[Example Code Fragment]
card = Register_Card(PCI_7200, card_number);
…
DI_7200_Config(card,TRIG_INT_PACER, DI_NOWAITING, DI_TRIG_FALLING, IREQ_FALLING);
DI_AsyncDblBufferMode (card, 0); // non-double-buffered mode
DI_ContReadPort(card, 0, pMem, data_size, (F64)sample_rate, ASYNCH_OP)
do {
DI_AsyncCheck(card, &bStopped, &count);
} while (!bStopped);
DI_AsyncClear(card, &count);
…
Release_Card(card);
4.3.4 Double-buffered Asynchronous Continuous Digital input programming Scheme
This section described the function flow typical of double-buffered asynchronous digital input operation.
While performing continuous DI operation, the DI configuration function has to be called at the
beginning of your application. For asynchronous DI, the SyncMode argument in continuous DI
functions has to be set as ASYNCH_OP. In addition, double-buffered DI operation is enabled by
setting Enable argument of DI_AsyncDblBufferMode function to 1. To learn more about double buffer
mode, please refer to the Double-Buffered AI/DI operation section for the details.