Arrays and Strings
FIG. 7 The value in CAM_PRESETS[3] is assigned to the variable CAM_PRESET_1
You can place values into a storage location by setting the particular location equal to the needed
value. For example, CAM_PRESETS was previously defined as having six locations. If you want
the second location to hold a value of 6 you would type the following:
CAM PRESETS[2]=6
The number 6 is placed into the second location, as shown in FIG. 8.
FIG. 8 The storage location CAM_PRESET[2] is assigned a value of 6.
From now on, anytime CAM_PRESETS[2] is referenced, its value is 6. In the example program,
pressing a Preset button either stores or recalls a preset. Examine the section of code that
accomplishes this:
DEFINE_VARIABLE
STORE_VOL_PRESET
VOL_PRESETS[1Ø]
VOL_PSET
DEFINE_PROGRAM
PUSH[TP,32]
STORE_VOL_PRESET = NOT STORE_VOL_PRESET
[TP,32] = (STORE_VOL_PRESET)
PUSH[TP,25]
PUSH[TP,26]
PUSH[TP,27]
PUSH[TP,28]
PUSH[TP,29]
PUSH[TP,3Ø]
PUSH[TP,31]
{
VOL_PSET = PUSH_CHANNEL - 24
IF (STORE_VOL_PRESET)
VOL_PRESETS[VOL_PSET] = VOL_LEVEL
ELSE
SEND_COMMAND VOLUME,"'PØL',ITOA(VOL_PRESETS[VOL_PSET])"
OFF[STORE_VOL_PRESET]
}
The first PUSH [TP,32] is the Store button, which toggles the STORE_VOL_PRESET variable
using the NOT operator. The NOT operator inverts the state of whatever follows it. The PUSH
statement is immediately followed by a feedback statement for the Store button. The next seven
32
(* 1 WHEN WE STORE VOLUME PRESET *)
(* 1Ø VOLUME PRESETS *)
(* INDEX FOR ABOVE ARRAY *)
(* STORE *)
(* PRESET 1 *)
(* PRESET 2 *)
(* PRESET 3 *)
(* PRESET 4 *)
(* PRESET 5 *)
(* PRESET 6 *)
(* PRESET 7 *)
Axcess Programming Language
Need help?
Do you have a question about the AXCESS CONTROL SYSTEM PROGRAM and is the answer not in the manual?