User`s manual

Application Hints 75
PCIS-DASK
DAQ Event Message Programming Hints
Example code fragment:
card = Register_Card(PCI_9118DG, card_number);
AI_9118_Config(card,P9118_AI_BiPolar|P9118_AI_SingE
d,
P9118_AI_DtrgPositive|P9118_AI_EtrgPositive|P911
8
I_AboutTrgEn,0,postCount);
AI_AsyncDblBufferMode(card, 1); //double-buffer mo
// Enable half buffer ready event notification
AI_EventCallBack (card, 1, DBEvent, (U32
)
DB_cbfn );
//Enable AI completeness event notification
AI_EventCallBack (card, 1, AIEnd, (U32) AI_cbfn );
AI_ContScanChannels (card, channel, range, NULL,
data_size, (F64)sample_rate, ASYNCH_OP); or
AI_ContReadChannel(card, channel, range, NULL,
data_size, (F64)sample_rate, ASYNCH_OP)
....
Release_Card(card);
//Half buffer ready call back function
void DB_cbfn()
{
//half buffer is ready
AI_AsyncDblBufferTransfer(card, ai_buf); //transfe
to user buffer
….
}
//AI completeness call back function
void AI_cbfn()
{
//AI is completed ]
AI_AsyncClear(card, &count);
//Transfer the remainling data into the user buffer
AI_AsyncDblBufferTransfer(card, ai_buf);
….
}