![background image](http://html1.mh-extra.com/html/amx/softkey-tx-sk/softkey-tx-sk_instruction-manual_2939359017.webp)
Programming
13
TX-SK+ SoftKey Transmitter
AXCESS Keywords (Cont.)
DEFINE_CONSTANT (Cont.)
More than one constant can have the same number. For example, PLAY
and FWD can both equal 1. You may see this if two cards do not have the
same channels for the same functions. For example, PLAY on the VCR
control card might be channel 1, and FWD on the slide control card could
also be channel 1.
By definition, the same constant cannot reference more than one num-
ber. This might seem obvious, but this type of error could work its way
into larger programs. If you make this mistake, Axcess notifies you with a
DUPLICATE SYMBOL error message upon compiling.
DEFINE_DEVICE
When you start writing a program, label each device in the system. Each
device on AXlink must have a unique device number. For example, card
1 may have device number 1, and card 2 may have device number 2.
Whenever you use this device name in your program, Axcess will auto-
matically use the corresponding device number to reference the device.
This is the function of the DEFINE_DEVICE section. It is placed at the
beginning of the program, and allows you to name the devices.
However, with a long list of devices connected to AXlink, these numbers
can be difficult to remember. Assigning actual names to these devices is
much easier.
The first step in writing a program is defining the devices in your system.
For example, you have a VCR, a CD player, and a cassette deck, and
you are controlling them with the first three cards in your CardFrame.
These cards have device numbers 1, 2, and 3. You also need to control a
projection screen, some drapes, and lights. Two relay cards, one in slot 4
and one in slot 5, will handle these (the first card handles both the screen
and drapes). A Touch Panel will be used to control all of these devices.
Your DEFINE_DEVICE section should look like this:
Note
: The devices included in this code are used for example purposes
only. It is not a specific recommendation or endorsement.
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 com-
pare devices using the Compare Current Devices... option in the Diag-
nostics 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.