
Language Elements
44
NetLinx Programming Language Reference Guide
A
DEVCHAN
array is declared in the
DEFINE_VARIABLE
or
DEFINE_CONSTANT
section in one of two
ways:
Declare a
DEVCHAN
array whose maximum length is determined by the number of elements in
the initialization array on the right-hand side, as shown below:
DEVCHAN[ ] DCSName = {{Dev1,Chan1}, {Dev2,Chan2}, ...}
Use
MAXLEN
to specify the maximum length of the array, as shown below:
DEVCHAN[ ] DCSName[MAXLEN] = {{Dev1,Chan1}, {Dev2,Chan2}, ...}
In either case, the number of elements in the initialization array determines the effective length of the
array. That value can be determined at run-time by calling
LENGTH_ARRAY
. The maximum length
available for a
DEVCHAN[ ]
array can be determined by calling
MAX_LENGTH_ARRAY
.
The individual elements of a
DEVCHAN
array can be referenced by their defined names (
Dev1
,
Chan1
,
Dev2
,
Chan2
, etc.) or by using array notation with the device-channel array name. For example, the
third element in the device-channel array,
MyDCSet
, would be referenced by
MyDCSet[3]
.
Furthermore, since a
DEVCHAN
array is an array of
DEVCHAN
structures,
DEVCHAN
members can be
referenced using the dot operator notation such as
MyDCSet[3].Device
or
MyDCSet[1].Channel
.
A
DEVCHAN
array can be used anywhere a
[Device, Channel]
specification is required with the
result of providing a range of targets for the command or instruction where it is used. This implies an
alternate form for the following commands:
The index of the last member of the array for which an event notification was received can be determined
by calling
GET_LAST(MyDCSet)
. This is useful for determining which device and channel in an array
is referenced to in a particular notification message.
Device-level arrays
A device-level array (
DEVLEV
array) is an array of device-level pairs. Each element is represented
internally as a
DEVLEV
structure. This structure combines the fields of a
DEV
structure representing the
device with a field representing the level number.
STRUCTURE DEVLEV
{
DEV // Device
INTEGER // Level
}
The first component of a device-level pair (
Device
) represents the device number, port, and system. It
can be specified as either a single device number, a constant
DEV
structure or as a D:P:S specification.
Each device specified in a device-level pair should be defined in the
DEFINE_DEVICE
section. The
second component is the level number on the device. The level number is expressed as an integer
constant.
A
DEVLEV
array is declared in the
DEFINE_VARIABLE
or
DEFINE_CONSTANT
section in one of two
ways:
Button[(DEVCHAN)]
PULSE[(DEVCHAN)]
DO_PUSH[(DEVCHAN)]
PUSH[(DEVCHAN)]
DO_RELEASE[(DEVCHAN)]
RELEASE[(DEVCHAN)]
OFF[(DEVCHAN)]
TO[(DEVCHAN)]
ON[(DEVCHAN)]
Содержание NETLINX PROGRAMMING LANGUAGE
Страница 15: ...Table of Contents xiii NetLinx Programming Language Reference Guide...
Страница 16: ...xiv NetLinx Programming Language Reference Guide Table of Contents...
Страница 18: ...Introduction 2 NetLinx Programming Language Reference Guide...
Страница 76: ...Language Elements 60 NetLinx Programming Language Reference Guide...
Страница 106: ...Combining Devices Levels and Channels 90 NetLinx Programming Language Reference Guide...
Страница 112: ...Master To Master M2M 96 NetLinx Programming Language Reference Guide...
Страница 114: ...Mainline 98 NetLinx Programming Language Reference Guide FIG 1 Message and Mainline Processing in the NetLinx System...
Страница 182: ...Reserved Identifiers 166 NetLinx Programming Language Reference Guide...
Страница 204: ...NetLinx UniCode Functions 188 NetLinx Programming Language Reference Guide...
Страница 244: ...Appendix B Glossary 228 NetLinx Programming Language Reference Guide...
Страница 245: ...Appendix B Glossary 229 NetLinx Programming Language Reference Guide...