Implement Event Message Routine

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

The following parameters are passed to the event message routine.

Message ID
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.

Message factor of counter

Macro

Value

Comparison count match event

AIOM_CNTE_DATA_NUM

1042H

Count overrun event

AIOM_CNTE_ORERR

1043H

Count operation error event

AIOM_CNTE_ERR

1044H

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.

Counter channel number
When more than one counter is used, the counter is identified by the counter channel number.

The way to pass those parameters is different by the language used.

Visual Basic .NET
Visual C#
Visual C++ (MFC)