Device Arrays - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Language Elements
NUMBER:PORT:SYSTEM
Parameters:

Device arrays

In order to specify a group of devices for a command or event handler, NetLinx provides the capability to
define an array of
specification is required. The result provides a range of targets for the command or instruction where it is
used.
Device arrays are declared in the
DEV DSName[ ]
DEV DSName[MaxLen]
Each device name appearing on the right-hand side of the declaration should be defined as a device in the
DEFINE_DEVICE
DEFINE_CONSTANT
The first statement above declares a device array whose maximum length is determined by the number of
elements in the initialization array on the right-hand side.
The second form uses
number of elements in the initialization array determines the effective length of the device array. That
value can be determined at run-time by calling
device array can be determined by calling
The following program fragment illustrates device array initialization:
DEFINE_DEVICE
panel3 = 130
DEFINE_CONSTANT
DEV
integer panel2 = 129
DEFINE_VARIABLE
DEV dvs[ ] = {panel1, panel2, panel3}
The individual elements of a device array can be referenced by their defined names (
or by using array notation with the device array name. For example, the 3rd device in the device array,
MyDeviceSet
42
Device:Port:System (D:P:S): This notation is used to explicitly represent a device number,
port, and system. For example, 128:1:0 represents the first port of the device number 128 on
this system. The syntax:
Number 16-bit integer representing the Device number
16-bit integer representing the Port number (in the range 1 through
Port
the number of ports on the device)
System 16-bit integer representing the System number (0 = this system).
s and treat it as a device array. A device array may be used anywhere a device
DEV
DEFINE_VARIABLE
= {Dev1, Dev2, ..., Devn}
= {Dev1, Dev2, ..., Devn}
section; however, it can also be defined in the
section.
to specify the maximum length of the device array. In either case, the
MaxLen
panel1 = 128:1:0
// dvs is an array of three devices:
//
128:1:0
//
129:1:0
//
130:1:0
, would be referenced by
section of the program in one of two ways:
DEFINE_VARIABLE
. The maximum length available for a
LENGTH_ARRAY
.
MAX_LENGTH_ARRAY
.
MyDeviceSet[3]
NetLinx Programming Language Reference Guide
or
,
, etc.)
Dev1
Dev2

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents