Using Time, Date, And Day - AMX AXCESS CONTROL SYSTEM PROGRAM Instruction Manual

Programming language
Table of Contents

Advertisement

Using Time, Date, and Day

The system variables TIME, DATE, and DAY can be used to create timing functions. TIME
contains the current time in the form of the string HH:MM:SS, in which HH equals hours, MM
equals minutes, and SS equals seconds. The time is given in a 24-hour format (military time).
DATE contains the current date in the form of the string MM/DD/YY, in which MM equals month,
DD equals day, and YY equals year. Finally, DAY contains the current day of the year in the form
of one of the strings MON, TUE, WED, THU, FRI, SAT, or SUN.
The time and date mechanism is year 2000 compliant. For more details, see Newcalls.TXT and the
system call LONGDATE in the Axcess Docs directory.
These variables have the following restrictions:
!
!
Typically these variables are used with an IF statement. Once the condition is true, certain
statements are executed. For instance, suppose you wanted to turn off all of the lights at 11:00 PM
every night. The code would look like this:
DEFINE_VARIABLE
PULSING_LIGHTS
*)
DEFINE_PROGRAM
IF ((TIME = '23:ØØ:ØØ') AND (NOT PULSING_LIGHTS))
{
PULSE[LIGHTS,LIGHT_OFF]
ON[PULSING_LIGHTS]
WAIT 2Ø 'PULSING TIMEOUT'
OFF[PULSING_LIGHTS]
}
The statements following the IF statement will be executed every day at 11:00 PM. To change the
code so that the lights turn off at every hour, the statement would be changed to read:
IF ((TIME = '??:ØØ:ØØ') AND (NOT PULSING_LIGHTS))
{
PULSE[LIGHTS,LIGHT_OFF]
ON[PULSING_LIGHTS]
WAIT 2Ø 'PULSING TIMEOUT'
OFF[PULSING_LIGHTS]
}
The question mark (?) acts like a wildcard character, allowing any character to be in its place. Since
question marks are used in place of the hour, the comparison will be true, once an hour, when the
minutes and seconds are Ø, causing the lights to turn off.
Axcess Programming Language
They cannot be changed in the Axcess program. Instead, this is done with the terminal
emulator, or the SEND_COMMAND clock. For information on the terminal emulator,
refer to Terminal emulator in the Communications Menu section.
Individual storage locations cannot be referenced.
(* 1 IF PULSING LIGHTS SO IT HAPPENS ONLY ONCE
Using Time, Date, and Day
87

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the AXCESS CONTROL SYSTEM PROGRAM and is the answer not in the manual?

This manual is also suitable for:

Axcess

Table of Contents