Define_Mutually_Exclusive; Define_Program; Define_Start; Define_Toggling - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)
DEFINE_MUTUALLY_
EXCLUSIVE

DEFINE_PROGRAM

DEFINE_START

DEFINE_TOGGLING

DEFINE_TYPE

NetLinx Programming Language Reference Guide
When a channel is turned on in a mutually exclusive set, it activates its physical
output as long as the button is pressed. When the button is released, the phys-
ical output stops. Even after the physical output stops, the feedback still indi-
cates the channel is on until another channel in the mutually exclusive set is
activated. The status remains on to indicate which channel in the set was acti-
vated last (last button pushed feedback). When a channel or variable in a mutu-
ally exclusive set is activated, all other members of the set are turned off
beforehand (break before make logic).
Members of a mutually exclusive set are placed in parentheses underneath the
DEFINE_MUTUALLY_EXCLUSIVE keyword. The double period (..) specifies a
range of channels on the particular device to be defined as mutually exclusive.

DEFINE_MUTUALLY_EXCLUSIVE

([RELAY,SCREEN_UP], [RELAY,SCREEN_DOWN])
DEFINE_TOGGLING
[RELAY,SCREEN_UP][RELAY,SCREEN_DOWN]
The last entry specifies a set of mutually exclusive variables - VCR_SELECT,
CD_SELECT, and CASS_SELECT. If any one of the three variables is turned on
(e.g., "ON [VCR_SELECT]") the other two are turned off.
If a channel is defined to be both mutually exclusive and latching, it has the
same behavior described above except that the channel stays on even after the
button that activated it is released. Theoretically, a channel in a mutually exclu-
sive latching set cannot be turned off without activating another channel in the
same set. In NetLinx, you can bypass this rule by using TOTAL_OFF. The
TOTAL_OFF function turns a channel or variable off. Unlike OFF, TOTAL_OFF
turns off the status of a channel or variable that is in a mutually exclusive set.
This keyword defines the mainline code, which is executed continuously to pro-
cess input and to provide device feedback.
See the Mainline section on page 97 for more information.
This keyword contains instructions that are executed once at program startup;
in other words, at power-up or after a system reset.
When a channel is defined as mutually exclusive and latching, there is no way
to turn off the channel without activating another. Mutually exclusive toggling
allows a channel to be turned on or off by successive presses of the same but-
ton, like a normal latching channel. The channel is still affected by its mutually
exclusive characteristics; if the channel is on, it can be turned off by activating
another channel in the set. The status of a mutually exclusive toggling button
operates the same way as a mutually exclusive latching button.
In order to make a channel toggling, it must be defined as both mutually exclu-
sive and toggling, as shown below:
DEFINE_MUTUALLY_EXCLUSIVE([RELAY, SCREEN_UP], [RELAY,
SCREEN_DOWN])DEFINE_TOGGLING[RELAY, SCREEN_UP][RELAY,
SCREEN_DOWN]
This keyword section defines custom data types such as structures and arrays.
An example DEFINE_TYPE section is shown below.
DEFINE_TYPE
STRUCTURE MyStruct
{
LONG Num
CHAR Name[30]
}
See the Data Types section on page 10 for a discussion of structures.
Reserved Identifiers
115

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents