36596-8000
MACROS
June 1999
the variables can be set to the following values:
#7=0;
#11=90;
#1=1.0;
#2=0.0;
and the block replaced by:
N1 G#7 G#11 X#1 Y#2 ;
The values in the variables at runtime are used as the address values.
Local Variables
Local variables range between #1 and #33. A set of local variables is available at all times. When a call to a
subroutine with a G65 command is executed, the local variables are saved and a new set is available for use.
This is called nesting of the local variables. During a G65 call, all of the new local variables are cleared to
undefined values and any local variables that have corresponding address variables in the G65 line are set to
the G65 line values. Below is a table of the local variables along with the address variable arguments that
change them.
:elbairaV
:sserddA
:etanretlA
1
A
2
B
3
C
4
I
5
J
6
K
7
D
I
8
E
J
9
F
K
01
I
11
H
J
:elbairaV
:sserddA
:etanretlA
21
K
31
M
I
41
J
51
K
61
I
71
Q
J
81
R
K
91
S
I
02
T
J
12
U
K
22
V
I
:elbairaV
:sserddA
:etanretlA
32
W
J
42
X
K
52
Y
I
62
Z
J
72
K
82
I
92
J
03
K
13
I
23
J
33
K
Note that variables 10, 12, 14..16 and 27..33 do not have corresponding address arguments. They can be set if
a sufficient number of I, J and K arguments are used as indicated above in the section about arguments.
Once in the macro subroutine, the local variables can be read and modified by referencing the variable numbers
1..33.
When the L argument is used to do multiple repetitions of a macro subroutine, the arguments are set only on
the first repetition. This means that if local variables 1..33 are modified in the first repetition, then the next
repetition will have access only to the modified values. Local values are retained from repetition to repetition
when the L address is greater than 1.
Calling a subroutine via an M97 or M98 does not nest the local variables. Any local variables referenced in a
subroutine called by an M98 are the same variables and values that existed prior to the M97 or M98 call.