You are here

Notification

During DLL initialization you choose how the library will notify your application when GPIO-24 adapter sends events or responses. The following options are available: event object, callback function, window messages or thread messages.

Notification settings are passed to GPIO_Init() function as GPIO_NOTIFICATION structure:

After you have chosen the notification type, you have to fill the rest of the structure members as described below:

type=ntEvent – In this case the DLL uses an event object to notify the application when GPIO-24 adapter sends events or responses.

Specify valid handle to the event object in event member of the GPIO_NOTIFICATION structure. As there is no possibility to pass parameters, handle to the device that generated the event is not sent. Specify HGPIO_ALL_DEVICES constant as the device handle when you call the GPIO_GetEvent() function.

You can use tracer.exe application source code as an example of event object notification.

Specify valid thread identifier in thread member of the GPIO_NOTIFICATION structure. Message ID should be chosen during the initialization and specified in msg member of the GPIO_NOTIFICATION structure.

The device handle is sent in wParam of the window message. If an event is generated by the DLL, HGPIO_DLL_NOTIFICATION constant is sent instead of device handle.

In this case you can use synchronous communication routines or send asynchronous commands but the application will receive no notifications. You can still call the GPIO_GetEvent() function to check whether the new events have arrived and get event details.