User Guide

Axcess Basics
10
Axcess Programming Language
DEFINE_DEVICE
VCR = 1 (* AXC-IR/S: VCR *)
CD = 2 (* AXC-IR/S: CD PLAYER *)
CASS = 3 (* AXC-REL8: VCR *)
RELAY = 4 (* AXC-REL8: SCREENS AND DRAPES *)
LIGHTS = 5 (* AXC-REL8: LOW VOLTAGE LIGHTING *)
VPROJ = 6 (* AXC-IR/S: PROJECTOR *)
TP = 128 (* AXU-CVA COLOR VIDEO PANEL *)
From this point on, you can reference device 1 with the name VCR, device 2 with the name CD,
and so on.
The Push window at the bottom of the screen is changed. If the devices in the previous example are
on AXlink, Axcess modifies the window to use the given device name instead of the device's
number. This provides a quick reference tool for future programming.
There is one more reason for using DEFINE_DEVICE. When you compare devices using the
Compare Current Devices... option in the Diagnostics menu, Axcess checks all the devices listed
under DEFINE_DEVICE. Next, it checks which devices are on AXlink. Axcess then tells you the
devices that you did not define in your program. These devices cannot be used or referenced until
they are defined, so check that all devices are under this heading.
AMX encourages the practice of starting control panel device numbers at device 128. This includes
radio frequency (RF) receivers, touch panels, softwire panels, and all other control panels and
receivers.
DEFINE_CONSTANT
Constants are identifiers whose values remain unchanged throughout the entire program. The
process of defining them is very similar to defining devices. Assigning a value to an identifier in
this section locks that value to the identifier for the entire program, making it possible to use
descriptive names instead of just numbers in your program.
In your system, the VCR, CD player, and cassette deck devices have channels that activate the
various transport functions, such as Play and Stop. As a general rule, Play is usually channel 1 and
Stop is channel 2. You could define these channel numbers as constants in your program to make it
more readable.
DEFINE_CONSTANT
PLAY = 1 (* VCR, CD AND CASS CONSTANTS *)
STOP = 2
PAUSE = 3
FFWD = 4
REW = 5
FSRCH = 6
RSRCH = 7
REC = 8
SCREEN_UP = 1 (* RELAY CONSTANTS *)
SCREEN_DN = 2
SYSTEM_POWER = 3
DRAPES_OPEN = 4
DRAPES_CLOSE = 5
DRAPES_STOP = 6
AMP_POWER = 7