While Keywords; While; Medium_While; Long_While - AMX AXCESS CONTROL SYSTEM PROGRAM Instruction Manual

Programming language
Table of Contents

Advertisement

While Keywords

While Keywords
This section decribes the While keywords (WHILE, MEDIUM_WHILE, and LONG_WHILE).

WHILE

The WHILE family of keywords allow the program to loop through a certain section of a program
until a condition becomes true. If the condition is false, Axcess skips the statements immediately
following the WHILE. If the condition is true, Axcess executes the statements, and rechecks the
WHILE's conditional expression. If the condition is still true, the statements are executed again.
This sequence continues until the condition is evaluated as false.
The amount of time Axcess spends executing any WHILE cannot exceed 0.5 seconds. This is
because the Central Controller updates AXlink (the communications bus between all Axcess
devices) between each pass through mainline. If AXlink is not updated at certain time intervals,
problems could develop during bus communications. To prevent an Axcess program from stalling
mainline too long, there is a 0.5 second time-out on WHILE loops. Axcess will forcibly exit the
WHILE after 0.5 seconds, regardless of the operation it is executing.

MEDIUM_WHILE

During the execution of a LONG_WHILE, Axcess scans AXlink, as it does when running
mainline. It is during this scanning that Axcess receives information about input changes from
devices such as Softwire Panels and Touch Panels. This activity also takes place after each loop
through a LONG_WHILE. Therefore, if a user presses a button while Axcess is looping through a
LONG_WHILE, the input change is lost to any programming outside the LONG_WHILE loop.
If this becomes a problem, the MEDIUM_WHILE keyword can be used. This keyword operates
like a LONG_WHILE, but ignores input changes from Axcess devices. These input changes are not
lost, but remain pending until the Central Controller scans for them again-either before the next
pass through mainline, or after a pass through a MEDIUM_WHILE.

LONG_WHILE

Unlike WHILE, after each LONG_WHILE loop, the AXlink bus is updated. This makes the
statement or compound statement following a LONG_WHILE a mini-mainline, for as long as the
condition is true. Therefore, LONG_WHILE has no time-out period. You must provide a way out
of your LONG_WHILE (by allowing the condition to become false), otherwise the program will
become stuck inside the LONG_WHILE and code outside the loop will not be executed.
If the condition associated with one of these in your program can never become false, your
program could get stuck in an infinite loop, requiring a reset of the Central Controller or maybe
even reloading of the system's programming.
Axcess Programming Language
69

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Axcess

Table of Contents