Implement Callback Function

Determine the message content and the device, and add processing according to the message content, are necessary in the callback function.
About skeleton creation of the callback function, please refer to the tutorial Use Event.

The following parameters are passed to the callback function.

ID
The ID retrieved by function AioInit is passed. This ID is used to determine from which device event notification is sent when using event on multiple devices.

 

Message
Messsage ID is passed. For all event notifications used by API-AIO, the content of the event is determined by the Message ID.

The range of Message ID used by API-AIO is 1000H to 10FFH, it has 256 Message IDs.
The Message ID corresponding to the event related to the counter is as follows.

Counter message factor

Macro

Value

Event comparison count match

AIOM_CNTE_DATA_NUM

1042H

Event count overrun

AIOM_CNTE_ORERR

1043H

Count operation error event

AIOM_CNTE_ERR

1044H

 

wParam
The counter channel that generated the event is passed.

 

lParam
Not use now.

 

Param
The parameter set by the function AioSetCntCallBackProc is passed.