Device Array Examples; Device-Channels And Device-Channel Arrays - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

The index of the last member of the array for which an event notification was received can be determined
by calling
referenced in a particular notification message.

Device array examples

The command below sends
DEV DeviceSetA[ ] = {Device1, Device2, Device3}
SEND_COMMAND DeviceSetA, 'CHARD10'
The command below sends
SEND_COMMAND DeviceSetA[3], 'CHARD10'
and is equivalent to:
SEND_COMMAND Device3, 'CHARD10'
The intent of the feedback statement is to set channel 1 in every device in
off, depending on the value of the right-hand expression; it is unclear what the right-hand expression
evaluates to. The compiler will issue a warning indicating the syntax is unclear and that
DeviceSetB[1]
example:
[DeviceSetA, 1] = [DeviceSetB[1], 2]

Device-channels and device-channel arrays

As the name implies, a device-channel (
represented internally as a
representing the device with a field representing the channel number.
STRUCTURE DEVCHAN
{
}
The first component of a device-channel pair represents the device number, port, and system. It can be
specified as either a single device number, a constant
device specified in a device-channel pair should be defined in the
Channels are expressed as integer constants. A
or
DEFINE_CONSTANT
" are all valid representations of device-channel pairs.
5]
A
DEVCHAN
curly braces does not, as illustrated below:
DEFINE_VARIABLE
DEVCHAN dc1 = {128:1:0, 1}
DEVCHAN dcset[ ] = { {128:1:0, 1}, {128:1:0, 2}, {128:1:0, 3} }
DEFINE_PROGRAM
IF ( [dc1] || [128:1:0, 2] )
[dc1] = 1
dc1 = {129:1:0, 2}
[dc1] = {129:1:0, 2}
NetLinx Programming Language Reference Guide
GET_LAST(MydeviceSet)
'CHARD10'
'CHARD10'
is assumed. To avoid this warning, specify a particular device in the array. Here's an
structure. This structure combines the fields of a
DEVCHAN
DEV
//Device
INTEGER
//Channel
section. For example, "
enclosed within square brackets implies an evaluation, whereas a
. This is useful for determining which device in an array is
to all devices in the array,
DeviceSetA
to the third device in the array,
(* Correct *)
) is a combination of a device and a channel. It is
DEVCHAN
structure or as a D:P:S specification. Each
DEV
DEFINE_DEVICE
is declared in either the
DEVCHAN
", "
[128, 1]
[CONSTANTDPS, 9]
// evaluation of 2 devchans
// feedback
// assigns a new value to dc1
// Syntax Error!
Language Elements
.
,
DeviceSetA
to either on or
DeviceSetA
structure
DEV
section.
DEFINE_VARIABLE
" and "
[128:1:0,
enclosed within
DEVCHAN
43

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents