Implement Callback Function

It is necessary for the callback function to identify the message content and device, and add processing according to the message contents.
For creating the skeleton of callback function, please refer to the tutorial of Use Event.

The following parameters are passed to the callback function.

ID
Pass the ID obtained by function AioInit. This ID is used to identify which device uses event notification, when using events on multiple devices.

 

Message
Pass the message number. For all event notifications used by API-AIO, the content of event is judged by the message number.

The range of message number used by API-AIO is 256 from 1000H to 10FFH.
The message number corresponding to the analog output event is as follows.

Analog Output Message Factor

Macro

Value

Event that DA conversion start

AIOM_AOE_START

1020H

Event that repeat end

AIOM_AOE_RPTEND

1021H

Event that device operation end

AIOM_AOE_END

1022H

Event that the specified number of data are outputted

AIOM_AOE_DATA_NUM

1023H

Event that generating clock period error

AIOM_AOE_SCERR

1025H

Event that DA conversion error

AIOM_AOE_ADERR

1026H

 

wParam
Not use.

 

lParam
Pass the specific parameter of each event.

Event Factor

Parameter

Event that DA conversion start

None

Event that repeat end

Current number of repeat times

Event that device operation end

Current number of generating times

Event that the specified number of data are outputted

Current number of generating times

Event that generating clock period error

Current number of generating times

Event that DA conversion error

Current number of generating times

 

Param
Pass the parameters set by function AioSetAoCallBackProc.