Event Handlers
61
NetLinx Programming Language Reference Guide
Event Handlers
The NetLinx language provides a special program section called
DEFINE_EVENT
to define handlers for
incoming events/notifications. These handlers are stored in an event table providing quick access to code
that must be executed when an event is received. There are handlers to support five types of events:
Button events include pushes, releases, and holds, which are associated with a push or release
on a particular device-channel.
Channel events occur when an output change (On/Off) is detected on a device-channel.
Data events include commands, strings, status, and error messages.
Level events are received as a result of a level change on a particular device.
Timeline events trigger events based on a sequence of times.
All incoming events are stored in a queue pending processing. Messages are processed in the order they
are received. The steps to processing an event are:
1.
Check all events for a handler matching the specified event. If a handler is found, run it.
2.
If there is no event handler, run
MAINLINE
.
The event handler descriptions are:
DEVICE
refers to a device specification:
The processing of an event associated with a given member of a device, channel,
device-channel, level, or device-level array must be completed before processing can
begin on another event associated with the same array.
FIG. 1
Steps involved in processing an event
Run Mainline
Event
handler
available?
Start
Stop
Run event
handler
NO
YES
More than one handler can be defined for the same event. In this case, the handlers
are executed in the order in which they are defined in the program.
DEVICE
A single device number constant
D:P:S
A constant device specification such as 128:1:0
DEV[ ]
A device array
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...