Channel Events - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

NetLinx Programming Overview
The following is an example of how a block of existing Axcess code can be rewritten using the NetLinx
BUTTON_EVENT
button push and will repeat the 'A' string every 0.5 seconds until the button is released.
Axcess Language
DEFINE_PROGRAM
.
.
PUSH[TP1,10]
{
SEND_STRING KC1, 'A'
ON[REPEAT_KC]
}
RELEASE[TP1,10]
{
CANCEL_WAIT 'REPEAT KC'
OFF[REPEAT_KC]
}
IF (REPEAT_KC)
{
WAIT 5 'REPEAT KC'
SEND_STRING KC1, 'A'
}
[TP1,10] = REPEAT_KC
.
.
In addition to evaluating the push within the event handler structure, you can see the simplified logic for
creating the repeating 'A' string using the

Channel Events

Channel Events are similar to Button Events. Channel Events are generated by
. The format for a Channel Event is shown below:
MIN_TO
CHANNEL_EVENT[<device>,<channel>]
{
}
Like Button Events, the
DEVCHAN
In the following example, a Channel Event is defined to turn off a video projector every time the
projector lift is raised. In Axcess, you need to include the code to turn off the projector whenever 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.
22
handler. The code below will send an 'A' to an RS-232 port defined as KC1 upon a
ON:
{
(* on event handler code *)
}
OFF:
{
(* off event handler code *)
}
[<device>, <channel>]
device-channel set in addition to individual device and channel declarations.
NetLinx Language
DEFINE_EVENT
.
.
BUTTON_EVENT[TP1,10]
{
PUSH:
{
TO[TP1,10]
SEND_STRING KC1, 'A'
}
RELEASE:
{
}
HOLD[5,REPEAT]:
{
SEND_STRING KC1, 'A'
}
}
.
.
DEFINE_PROGRAM
.
.
event handler.
HOLD
declaration can contain a
NetLinx Programming Language Reference Guide
,
,
,
, or
ON
OFF
PULSE
TO
device set, or a
DEV

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents