Waits and Timer Keywords
In this example, Axcess waits 20 seconds, turns on the Screen Up relay, waits 20 more seconds,
then turns off the Screen Up relay. Any timed sequence of events can be accomplished with or
without nested WAITs. In many cases, using nested WAITs is more readable than non-nested
WAITs
Special Uses of Wait
A WAIT time of Ø is a special case. The code following the WAIT will be executed directly after
the current pass through mainline. This is because the WAIT goes into the wait list. At the end of
mainline when the Central Controller checks the list for expired WAITs, the WAIT Ø will execute.
Wait Ø is only used in special cases.
Any one WAIT can only be placed in the wait list once. If a particular WAIT is already in the wait
list, it cannot be placed into the list a second time until the first instance is canceled or expired. For
example, suppose the following line appears in mainline where it will be executed every pass
through mainline:
WAIT 5 FLASH = NOT FLASH
The first time this is executed, the WAIT is placed into the wait list. If this line is executed again
before the WAIT expires, the line is ignored, because the WAIT is already in the wait list. 1/2
second after the first execution of this statement, the value in variable FLASH is inverted. If
FLASH was Ø it will be changed to 1, and if it was non-zero it will be changed to Ø. On the next
pass through mainline, the WAIT will again be placed into the wait list, and the cycle will repeat for
the duration of the program. This, in effect, creates a variable whose state inverts every half-second.
The Wait_Until Keyword
The WAIT_UNTIL keyword is not a true timing keyword, in that Axcess does not wait for a certain
amount of time to elapse. Instead, Axcess checks to see if a condition is true. When the condition
becomes true, Axcess executes the statements listed directly below the WAIT_UNTIL statement.
All WAIT_UNTILs go into another list which is similar to the wait list, called the WAIT_UNTIL
list. Just as it does with WAITs, Axcess checks to see if any WAIT_UNTIL conditions have become
true with each pass through mainline. For each one that has, Axcess immediately executes the
sequence below the WAIT_UNTIL statement. If not, Axcess keeps the WAIT_UNTIL in the
WAIT_UNTIL list until its condition becomes true.
Misusing Wait_Until
Since Axcess only checks the status of pending WAIT_UNTILs after completely running mainline,
be sure that its condition has a chance to become true, or the purpose of the WAIT_UNTIL
statement will be defeated.
Axcess cannot detect this sort of logic error, so be sure that each WAIT_UNTIL
statement can become true.
Axcess Programmnig Language
83
Need help?
Do you have a question about the AXCESS CONTROL SYSTEM PROGRAM and is the answer not in the manual?