User Guide
Channel Characteristics
27
Axcess Programming Language
The Variable Assignment Method
Another method of programming select groups is to use one variable, assigning different values to
it depending on what is selected. This method is more powerful than the previous method,
providing more flexibility while using less code.
You will add just one variable, CUR_CAMERA. This will be the select variable. Then assign the
device number of the currently selected camera to this variable. Here is your Select buttons' code:
DEFINE_DEVICE
CAMERA_1 = 97 (* AXB-CAM: PAN/TILT *)
CAMERA_2 = 98 (* AXB-CAM: PAN/TILT *)
CAMERA_3 = 99 (* AXB-CAM: PAN/TILT *)
DEFINE_CONSTANT
PAN_RIGHT = 31
TILT_DN = 32
PAN_LEFT = 35
TILT_UP = 36
DEFINE_VARIABLE
CUR_CAMERA (* CURRENT CAMERA *)
DEFINE_PROGRAM
PUSH[TP,57] (* CAMERA 1 *)
CUR_CAMERA = CAMERA_1
PUSH[TP,58] (* CAMERA 2 *)
CUR_CAMERA = CAMERA_2
PUSH[TP,59] (* CAMERA 3 *)
CUR_CAMERA = CAMERA_3
Use variables to simplify your program. The following example shows how to reduce the number of
control sections from three to just one by using the variable CUR_CAMERA as the device number
in the TO statements, instead of using CAMERA 1, CAMERA 2, and CAMERA 3. Here's the
section of code:
PUSH[TP,6Ø] (* TILT UP *)
TO[CUR_CAMERA,TILT_UP]
PUSH[TP,61] (* TILT DOWN *)
TO[CUR_CAMERA,TILT_DN]
PUSH[TP,62] (* PAN RIGHT *)
TO[CUR_CAMERA,PAN_RIGHT]
PUSH[TP,63] (* PAN LEFT *)
TO[CUR_CAMERA,PAN_LEFT]
In the example above, no IF statement is required, and this is the only camera control section of
programming needed in the program. Using this method, to adjust CAMERA 2, first press the
Camera 2 Select button. This assigns the value 98 (the constant value of CAMERA 2) to the
variable CUR_CAMERA. Now the device-channel references of the TO control statements will
reference device number 98 (the CAMERA 2 device). Pressing button number 6Ø on the Touch
Panel will activate [CUR_CAMERA, TILT_UP], which Axcess will interpret as [98,36].
The feedback statements for the selection buttons are shown below:
[TP,57] = (CUR_CAMERA = CAMERA_1)
[TP,58] = (CUR_CAMERA = CAMERA_2)
[TP,59] = (CUR_CAMERA = CAMERA_3)
These statements, like all feedback statements, are direct assignment output changes. However, the
source of the assignment is a Boolean expression. In interpreting this kind of feedback statement,