
Waits and Timer Keywords
81
Axcess Programmnig Language
Multiple Waits
At this point, the System Power button completes two events, with a delay in between. In many
cases, you may want to initiate a series of several events by pressing one button.
In this section, you will make the System Power button accomplish several more things when the
power is turned on and off. For example, when the power is turned on, you may want a series of
timed events to take place. First, the rack power comes on. Simultaneously, the screen starts to
come down and the drapes start to close. 1 second later, the amp power comes on, just like before.
After a 20 second delay, the Medium lighting scene is selected.
When the power is turned off, a different sequence happens. First, the amp power is turned off,
lights go to the Full setting, the screen is raised, and the drapes are opened. After a 1 second delay,
the rack power turns off. 2 minutes later, the lights go to the Off setting.
Here is the code for the System Power Push for the scenario described above:
DEFINE_PROGRAM
PUSH[TP,8] (* POWER ON/OFF *)
{
IF ([RELAY,SYSTEM_POWER])
{
CANCEL_WAIT 'AMPS ON'
CANCEL_WAIT 'LIGHTS TO MED'
OFF[RELAY,AMP_POWER]
PULSE[LIGHTS,LIGHT_FULL]
PULSE[RELAY,SCREEN_UP]
PULSE[RELAY,DRAPES_OPEN]
WAIT 1Ø 'SYSTEM OFF'
OFF[RELAY,SYSTEM_POWER]
WAIT 2ØØ 'LIGHTS OFF'
PULSE[LIGHTS,LIGHT_OFF]
}
ELSE
{
CANCEL_WAIT 'SYSTEM OFF'
CANCEL_WAIT 'LIGHTS OFF'
ON[RELAY,SYSTEM_POWER]
PULSE[RELAY,SCREEN_DN]
PULSE[RELAY,DRAPES_CLOSE]
WAIT 1Ø 'AMPS ON'
ON[RELAY,AMP_POWER]
WAIT 2ØØ 'LIGHTS TO MED'
PULSE[LIGHTS,LIGHT_MED]
}
}
Notice the use of the PULSE keyword. This is done, as you may recall, because TO cannot be used
inside a WAIT. Since the lighting buttons are momentary, you use a PULSE to actuate the relay for
just a moment.
Содержание Axcess
Страница 1: ...instruction manual Software Axcess Programming Language ...
Страница 8: ...vi Axcess Programming Language Table of Contents ...
Страница 12: ...Introduction 4 Axcess Programming Language ...
Страница 22: ...Axcess Basics 14 Axcess Programming Language ...
Страница 38: ...Channel Characteristics 30 Axcess Programming Language ...
Страница 54: ...Levels 46 Axcess Programming Language ...
Страница 62: ...Operators 54 Axcess Programming Language ...
Страница 66: ...Variable Types and Conversions 58 Axcess Programming Language ...
Страница 70: ...Two Dimensional Arrays 62 Axcess Programming Language ...
Страница 80: ...While Keywords 72 Axcess Programming Language ...
Страница 86: ...Using Buffers 78 Axcess Programming Language ...
Страница 94: ...Waits and Timer Keywords 86 Axcess Programming Language ...
Страница 102: ...Using Subroutines 94 Axcess Programming Language ...
Страница 108: ...Include Files and System_Calls 100 Axcess Programming Language ...
Страница 120: ...Compiler Error Messages 112 Axcess Programming Language ...
Страница 124: ...The External_Control Protocol 116 Axcess Programming Language ...
Страница 143: ...Index 135 Axcess Programming Language ...