NetLinx Programming Overview
17
NetLinx Programming Language Reference Guide
PUSH[MSP_GROUP,1] (* MSP_GROUP IS A DEV SET *)
[RELAY, 1] = ![RELAY, 1]
[MSP_GROUP, 1] = [RELAY, 1]
- or -
PUSH[MSP_PRESET1] (* MSP_PRESET1 IS A DEVCHAN SET *)
[RELAY,1] = ![RELAY, 1]
[MSP_PRESET1] = [RELAY, 1]
Conditionals & Loops
Axcess supports two types of conditional statements and three types of loops:
 Conditional statements:
 IF...ELSE statements
 SELECT...ACTIVE statements
 Loops:
 WHILE statements
 MEDIUM_WHILE statements
 LONG_WHILE statements
NetLinx supports:
 Conditional statements:
 IF...ELSE statements
 SELECT...ACTIVE statements
 SWITCH...CASE statements
 Loops:
 FOR statements
 WHILE statements
 LONG_WHILE statements
MEDIUM_WHILE statements are obsolete in NetLinx due to eliminating the timeout of WHILE loops.
LONG_WHILE loops now differ from WHILE loops in the way input change notifications are processed
during the programming loop.
WHILE, MEDIUM_WHILE and LONG_WHILE statements are all still
accepted syntax to provide compatibility with existing Axcess programs.
SWITCH...CASE statements
NetLinx adds the SWITCH...CASE conditional statements. The SWITCH...CASE statements provide
selective execution of code blocks evaluated by a single condition. The value of the
SWITCH expression
is tested against each
CASE value (which must be a numeric constant or a string literal). If a match is
found, the statements associated with the
CASE are executed. All other CASE statements are ignored. If
no match is found, the
DEFAULT case statements (if any) are executed. The SWITCH expression is
evaluated only once.
The following rules apply to
SWITCH...CASE statements: