Axcess/Netlinx Incompatibility - AMX NETLINX PROGRAMMING LANGUAGE Manual

Programming language
Table of Contents

Advertisement

Axcess/NetLinx Incompatibility

According to previous versions of each of their language reference manuals, Axcess and NetLinx each
give the operator
following code, however, the two systems behave differently. In reality, Axcess gives the operator
lowest precedence.
DEFINE_VARIABLE
C D E
DEFINE_CALL 'GO' (A,B)
{
C = !A && B
D = B && !A
E = !B && !A
}
DEFINE_PROGRAM
PUSH[1,1]
CALL 'GO' (0,0)
PUSH[1,2]
CALL 'GO' (1,0)
PUSH[1,3]
CALL 'GO' (0,1)
PUSH[1,4]
CALL 'GO' (1,1)
Axcess RESULTS
A
0
1
0
1
NETLINX RESULTS
A
0
1
0
1
The problem applies whether A and B are channels, variables, or expressions, and for
To solve the problem, AMX always recommends the use of
and this is critical, some programs out there are taking advantage of the logic flaw. Where the Axcess
programmer intended the truth table of
desired result. If these systems are converted to NetLinx Masters, the logic will not work as desired.
Please be aware of this difference as you support programs being converted from Axcess to NetLinx.
When it occurs, Axcess-like operation can generally be achieved by including all the conditions to the
right of the
IF (SYSTEM_POWER && ![VCR,PLAY] || [VCR,RECORD])
becomes:
IF (SYSTEM_POWER && !([VCR,PLAY] || [VCR,RECORD]))
NetLinx Programming Language Reference Guide
highest precedence while giving
NOT
B
!A && B
B && !A
0
1
0
1
1
1
1
0
B
!A && B
B && !A
0
0
0
0
1
1
1
0
!(A && B)
in a single set of parentheses. For example:
NOT
and
lowest. As demonstrated in the
AND
OR
!B && !A
0
1
0
1
1
0
0
1
!B && !A
0
1
0
0
1
0
0
0
(!A) && B
he/she may have coded
NetLinx Programming Overview
NOT
as well as
OR
AND
instead of
; however,
!A && B
and gotten the
!A && B
.
9

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Netlinx studio 2

Table of Contents