AMX NETLINX PROGRAMMING LANGUAGE Manual page 181

Programming language
Table of Contents

Advertisement

Axcess does not support making elements of an INTEGER array mutually exclusive.
Cause: This has always worked this way, even in Axcess.
Resolution: Use ON to set variables if they are members of a mutually exclusive set:
DEFINE_VARIABLE
INTEGER var[4]
INTEGER x
DEFINE_MUTUALLY_EXCLUSIVE
(var[1],var[2],var[3],var[4])
DEFINE_PROGRAM
WAIT 20
{
x++; IF (x > 4) x = 1;
ON[var[x]] // This will work as expected - only one element of var will have a
value of 1 at any time
}
This issue does not occur with DEVCHAN's. Using ON or assigning them a non-zero value will work as
expected:
DEFINE_DEVICE
dvRelay = 305:1:0
DEFINE_VARIABLE
INTEGER x
DEFINE_MUTUALLY_EXCLUSIVE
([dvRelay,1]..[dvRelay,4])
([dvRelay,5]..[dvRelay,8])
DEFINE_PROGRAM
WAIT 20
{
x++; IF (x > 4) x = 1;
ON[dvRelay,x] // This works as expected: only 1 relay of relays 1 to 4 will be on
at a time
[dvRelay,x + 4] = x // This works as expected: only 1 relay of relays 5 to 8 will
be on at a time
}
NetLinx Programming Language Reference Guide
Reserved Identifiers
165

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents