User`s guide
PCIS-DASK Application Hints
•
63
case WM_INT: //interrupt event occurring message
… .
break;
… .
case WM_DESTROY:
//Disable interrupts
DIO_INT1_EventMessage (card, INT1_DISABLE, hMainWnd,
NULL, NULL);
DIO_INT2_EventMessage (card, INT2_DISABLE, hMainWnd,
NULL, NULL);
//Release card
if (card >= 0) Release_Card(card);
PostQuitMessage(0);
break;
… .
}
}
… .
//call back function
LRESULT CALLBACK cbfn()
{
… .
}
2. Through a Win32 wait function
[Example Code Fragment]
card = Register_Card(PCI_7230, card_number);
DIO_SetDualInterrupt(card, INT1_EXT_SIGNAL, INT2_EXT_SIGNAL,
hEvent);
… .
//wait for INT1 event
if (WaitForSingleObject(hEvent[0], INFINITE) == WAIT_OBJECT_0) {
ResetEvent(hEvent[0]);
… …
}
…..
//wait for INT2 event
if (WaitForSingleObject(hEvent[1], INFINITE) == WAIT_OBJECT_0)
{
ResetEvent(hEvent[1]);
… …
}
… ..
if (card >= 0) Release_Card(card);