Define_Call; Define_Combine; Define_Connect_Level; Define_Constant - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Keywords & Run-Time Library Functions (Cont.)

DEFINE_CALL

DEFINE_COMBINE

DEFINE_CONNECT_
LEVEL

DEFINE_CONSTANT

NetLinx Programming Language Reference Guide
This keyword defines the implementation of a NetLinx subroutine.
DEFINE_CALL '<name>' [(P1,P2,...)]
{
// body of subroutine
}
The subroutine name cannot be a previously defined device name, constant, or
variable, or a name assigned to a buffer or a wait statement. DEFINE_CALL
names are case sensitive and may contain spaces.
Note: Subroutines must be defined before they can be used. For this reason,
DEFINE_CALLS should appear before the DEFINE_START, DEFINE_EVENT,
and DEFINE_PROGRAM sections.
This keyword defines the combination of functionally identical devices, such as
identically programmed touch panels. When the program references one of
these devices, all other combined devices are also referenced. The devices in
a given combine must be enclosed in parentheses.
The first device in the list (the primary device) must be a virtual device.
DEFINE_COMBINE(VDevice, Panel1, Panel2, Panel3)
The example below uses a device array (DEV[ ]) instead of specifying the indi-
vidual devices (Panel1, Panel2, and Panel3). Any input events for any device in
the array will appear to the program as coming from the virtual device. Output
changes directed to the virtual device or any device in the set is sent to all
devices in the array.
DEFINE_COMBINE(VDevice, DEV[ ])
See COMBINE_DEVICES,on page 108, for more information on virtual devices
and device arrays.
This keyword defines level connections. A single connection is defined by list-
ing the device-level pairs inside parentheses.
The first level in the list (the primary level) must be a virtual level (a level on a
virtual device). A virtual level does not actually exist but merely represents one
or more levels on physical devices.
The example below combines the levels [Device1, Level1] and
[Device2, Level2].
(VDevice, Level1, Device1, Level1, Device2, Level1)
The next example combines all levels in the device-level array. Changes to any
level listed in the connection will automatically be reflected in the other levels so
that all level values are the same.
DEFINE_CONNECT_LEVEL(VDevLev, MyDL[ ])
By specifying a virtual level as the primary level, NetLinx code targets the virtual
level but operates on each physical level. Since the primary level is virtual, the
primary device (a virtual device) cannot be taken off-line or removed from the
system.
This keyword defines program constants; the value of a constant cannot be
changed within the program.
DEFINE_CONSTANT
PLAY = 1
STOP = 2
STRING='HELLO'
Reserved Identifiers
113

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents