
8 GCS Commands
C-863.12 Mercury Controller
MS249E
Version: 1.2.1
119
▪
Names of global variables can consist of characters A to Z and 0 to 9. They must start
with an alphabetic character.
▪
Names of local variables may not contain alphabetic characters. Possible characters are
0 to 9.
▪
The variable name can also be specified via the value of another variable.
If the value of a variable is to be used, the notation must be as follows:
▪
The variable name must be preceded by the dollar sign ($).
▪
Variable names consisting of multiple characters must be put in braces.
If the variable name consists of a single character, the braces can be left out.
Note that if the braces are left out of variable names consisting of multiple characters, the first
character after the “$” is interprete
d as the variable name.
Local variables:
▪
Local variables can only be used in macros.
▪
At present, the controller firmware supports three local variables: 0, 1 and 2.
▪
The values of the local variables 1 and 2 are specified as arguments of the
MAC START
or
MAC NSTART
command when starting the macro.
The command formats are:
MAC START <macroname> [<String1> [<String2>]]
MAC NSTART <macroname> <uint> [<String1> [<String2>]]
<STRING1> and <STRING2> indicate the values for the local variables 1 and 2 used in the
macro. <STRING1> and <STRING2> can be specified directly or via the values of
variables. <uint> defines the number of times the macro is to be run. See the
MAC
command (p. 171) description for more information.
▪
The local variable 0 is read-only. Its value gives the number of arguments (i.e., values of
local variables) set when starting the macro.
▪
Inside a macro, the values of local variables can be modified using
ADD
(p. 130),
CPY
(p. 134) or
VAR
(p. 202), and can be deleted with
VAR
(except for the local variable 0).
▪
As long as the macro is running, the values of the local variables can be queried with
VAR? 0
VAR? 1
VAR? 2
The queries can be sent inside or outside of the macro.
Global variables:
▪
Global variables can be used inside and outside of macros.
▪
The maximum number of global variables is 10.