Channel Events
Channel Events are similar to Button Events.
Channel Events are generated by ON, OFF, PULSE, TO, or MIN_TO.
The format for a Channel Event is shown below:
Like Button Events, the [<device>, <channel>] declaration can contain a
DEV device set, or a DEVCHAN device-channel set in addition to individual
device and channel declarations.
The CHANNEL Object is available to the channel event handler as a local variable.
The following table lists the information contained in Channel Objects:
Channel Objects:
| Property Name | Type | Description |
|---|---|---|
Channel.Device |
DEV | Device |
Channel.Device.Number |
INTEGER | Device number |
Channel.Device.Port |
INTEGER | Device port |
Channel.Device.System |
INTEGER | System number |
Channel.Channel |
INTEGER | Device channel |
Channel.SourceDev |
DEV | Source Device of Channel Event |
Channel.SourceDev.Number |
INTEGER | Source Device Number |
Channel.SourceDev.Port |
INTEGER | Source Device Port |
Channel.SourceDev.System |
INTEGER | Source Device System |
If the event handler is specified using an array for DEV, CHANNEL, or a DEVCHAN array, GET_LAST can be used to determine which index in the array caused the event to run.
In the following example, a Channel Event is defined to turn off a video projector every time the projector lift is raised. In NetLinx, you define a Channel Event for the 'Projector Lift Up' relay and tell the system to turn off the projector every time this relay is turned on.
Since turning on or pulsing the relay does not produce a push, a Button Event is not generated.