![background image](http://html1.mh-extra.com/html/amx/softkey-tx-sk/softkey-tx-sk_instruction-manual_2939359016.webp)
Programming
12
TX-SK+ SoftKey Transmitter
AXCESS Keywords (Cont.)
DEFINE_CALL
(without parameters)
In Axcess, subroutines are created using the DEFINE_CALL statement.
The subroutine name follows the DEFINE_CALL keyword, enclosed in
single quotes. There are certain restrictions for these subroutine names:
• They cannot be previously defined constants or variables.
• They cannot be names that have already been assigned to BUFFERS
or WAITs.
• They are case-sensitive. For example, Test and TEST are not the
same.
Subroutines must be defined before they can be used. For this reason,
DEFINE_CALLS are typically placed right before the DEFINE_START
section of the program. Here is the format:
DEFINE_CALL 'subroutine name'
{
(* The subroutine goes here *)
}
Spaces in the subroutine name are allowed because it is a string literal.
Notice that the subroutine's code is enclosed in braces. No matter how
long the subroutine is, it must be in this format.
DEFINE_CONSTANT
Constants are identifiers whose values remain unchanged throughout
the entire program. The process of defining them is very similar to defin-
ing 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
LIGHT_FULL = 1 (* LOW VOLTAGE LIGHTING PRESETS
*)
LIGHT_MED = 2
LIGHT_LOW = 3
LIGHT_OFF = 4
VPROJ_IN_1 = 11
VPROJ_IN_2 = 12
VPROJ_IN_3 = 13
VPROJ_IN_4 = 14
The value of the constant PLAY is now set to 1. Also, STOP has a value
of 2. Both of these values cannot be changed anywhere in the program.
With these constants set, if you need to activate the play function of the
VCR later in your program, use the constant PLAY, and Axcess knows to
use channel 1.