APX-3302 User's Manual (OM110000019A)
-94 -
6.14
Notes for interrupt event, callback function
■
About delayed event and lost an event
The thread in Acap library performs notifying interrupt event and calling callback function. So if delay occurs
in performance of thread in state where CPU load are high, calling registered callback function and
response of function AcapWaitEvent might be delayed. Notification would disappear by degree of load.
[Concept of “Notice”]
Figure6-33
: Concept of “Notice”
[Troubleshoot issues of delayed event]
For example, when “the one-frame input completion interrupt” is standing by in state of heavy load, the
followings might occur.
Example: Delay of callback function occurs by inputting 5 frames
// Callback function that is preformed every 1 frame input
void
CALLBACK CallbackFunc (
int
nChannel, DWORD dwEvent,
int
nFrameNo,
int
nMemoryNo)
{
printf(
"CallbackFunc called. nChannel[%d] dwEvent[%d] nFrameNo[%d] nMemoryNo[%d]¥n"
,
nChannel, dwEvent, nFrameNo, nMemoryNo);
}
<< Output result>> * If number of transfer destination memory = 3
CallbackFunc called. nChannel[1] dwEvent[2] nFrameNo[1] nMemoryNo[1]
CallbackFunc called. nChannel[1] dwEvent[2] nFrameNo[2] nMemoryNo[2]
CallbackFunc called. nChannel[1] dwEvent[2] nFrameNo[3] nMemoryNo[3]
CallbackFunc called. nChannel[1] dwEvent[2] nFrameNo[5] nMemoryNo[2]
*Delay occurs
CallbackFunc called. nChannel[1] dwEvent[2] nFrameNo[5] nMemoryNo[2]
Hardware
Register
Monitor thread:
Acap library
User
application
Driver
Interrupt
(Priority: High)
Notify event
(Priority: Normal)
Notify event
(Priority: Normal)
Notify callback
(Priority: High)
Since it is notice process via a system, delay
(disappearance) might occur by effect of CPU
load (or process of threads etc).
Since callback function is also executed by thread in Acap
library, it is affected if process of thread is delayed.
Содержание APX-3302
Страница 1: ...APX 3302 User s Manual ...