# ConnectEvent()
| Valid For | #HMI |
|---|---|
| Applies To | HMI430 |
This instruction registers a subroutine that will be called when specific events occur.
Function Prototype
# ConnectEvent(
ev:EventHandler )
| Parameter | Option | Description |
|---|---|---|
| ev | mandatory | The name of the subroutine that will be called when an event occurs. |
Description
On a controller, this event is called for the reasons in the table below.
| Event | Description | Parameters |
|---|---|---|
| Backlight Change | This event signals a change in the backlight state, meaning the backlight is now either HIGH, MEDIUM or OFF. The backlight state as well as the actual level is passed in the parameter list. | State,Level |
| PowerOnTouch | This event signals the user has been pressing the touch screen for 2 seconds since power on. This is useful for activating touch screen calibration. | nil |
A module that looks after processing the event message is available for download here:
Either #Include this file or place it in a build script. Full details on ui_utils.spt can be found on this page.
NOTE: ConnectEvent() in a touch screen controller (like the HMI430) is very different to ConnectEvent() in the Android & Windows implementation of SimpleHMI. After all, the LCD is always connected in a touch screen controller, therefore it's used for different things.
