APX-3302 User's Manual (OM110000019A)
-92 -
■
The setting example for software
The sample code to register extended callback function that occurs at "input start interrupt" or "1 frame input
completion interrupt" or "input end interrupt" for ch2 is as follows.
<Sample code>
void
CALLBACK CallbackFuncEx (
int
nChannel, DWORD dwEvent,
int
nFrameNo,
int
nMemoryNo,
void
*
pParam)
{
DWORD Param = *((DWORD*)pParam);
printf(
"CallbackFuncEx
called.
nChannel[%d]
dwEvent[%d]
nFrameNo[%d]
nMemoryNo[%d]
*pParam[%d]¥n"
, nChannel, dwEvent, nFrameNo, nMemoryNo, Param);
}
// Register extended callback function at main routine
int
rtn;
int
channel = 2;
// Plural specifications by
“OR”
DWORD dwEvent = ACL_INT_GRABSTART | ACL_INT_FRAMEEND | ACL_INT_GRABEND;
DWORD Param = 123456;
// Parameter that gives at 5
th
argument
rtn = AcapRegistCallback(hDevice, channel, dwEvent, (EVENT_FUNC_EX)&CallbackFuncEx, (
void
*)&Param);
// Input 5 frame
rtn = AcapGrabStart(hDevice, channel, 5);
// Use ACL_INT_GRABSTART at input start of each frame
// Use ACL_INT_FRAMEEND at input completion of each frame
// Callback function of ACL_GRABEND is called when 5 frame input is completed
<< Output result>> * If number of transfer destination memory = 3
CallbackFuncEx called. nChannel[2] dwEvent[1] nFrameNo[0] nMemoryNo[3] *pParam[123456]
*Note
CallbackFuncEx called. nChannel[2] dwEvent[2] nFrameNo[1] nMemoryNo[1] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[1] nFrameNo[1] nMemoryNo[1] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[2] nFrameNo[2] nMemoryNo[2] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[1] nFrameNo[2] nMemoryNo[2] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[2] nFrameNo[3] nMemoryNo[3] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[1] nFrameNo[3] nMemoryNo[3] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[2] nFrameNo[4] nMemoryNo[1] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[1] nFrameNo[4] nMemoryNo[1] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[2] nFrameNo[5] nMemoryNo[2] *pParam[123456]
CallbackFuncEx called. nChannel[2] dwEvent[4] nFrameNo[5] nMemoryNo[2] *pParam[123456]
*Note
:
Since first GRABSTART interrupt does not input any frame, “0” is got for nFrameNo and number
of register memory (3) is got for nMemoryNo.
Содержание APX-3302
Страница 1: ...APX 3302 User s Manual ...