85
96-8000 rev R June 2007
Macros
Entering the macro variable number and pressing the up/down arrow will search for that variable.
The variables displayed represent the values of the variables during the running of the program. At times, this may be
up to 15 blocks ahead of the actual machine actions. Debugging the programs are easier when inserting a G103 at
the beginning of a program to limit block buffering and then removing the G103 after debugging is completed.
Macro Arguments
The arguments in a G65 statement are a means of sending values to and setting the local variables of a macro
subroutine.
In the previous example 2 , the arguments (values of) X and Y are passed to the macro subroutine local variables.
Local variable #24 is associated with X and is set to 0.5. Similarly, Local variable #25 is associated with Y and is set
to 0.25.
The following two tables indicate the mapping of the alphabetic address variables to the numeric variables used in a
macro subroutine.
Alphabetic Addressing
:sserddA
:elbairaV
A
1
B
2
C
3
D
7
E
8
F
9
G
-
H
11
I
4
J
5
K
6
L
-
M
31
:sserddA
:elbairaV
N
-
O
-
P
-
Q
71
R
81
S
91
T
02
U
12
V
22
W
32
X
42
Y
52
Z
62
Alternate Alphabetic Addressing
:sserddA
:elbairaV
A
1
B
2
C
3
I
4
J
5
K
6
I
7
J
8
K
9
I
01
J
11
:sserddA
:elbairaV
K
21
I
31
J
41
K
51
I
61
J
71
K
81
I
91
J
02
K
12
I
22
:sserddA
:e
lbairaV
J
32
K
42
I
52
J
62
K
72
I
82
J
92
K
03
I
13
J
23
K
33
Arguments accept any floating-point value to four decimal places. If the control is in metric, it will assume thou-
sandths (.000). In Example 3, local variable #7 will receive .0004.
If a decimal is not included in an argument value, such as:
G65 P9910 A1 B2 C3
The values are passed to macro subroutines according to the following table:
Integer Argument Passing (no decimal point)
:sserddA
:elbairaV
A
100.
B
100.
C
100.
D
.1
E
.1
F
.1
G
-
H
.1
I
1000.
J
1000.
K
1000.
L
.1
M
.1
:sserddA
:elbairaV
N
-
O
-
P
-
Q
1000.
R
1000.
S
.1
T
.1
U
1000.
V
1000.
W
1000.
X
1000.
Y
1000.
Z
000.
All 33 local macro variables can be assigned values with arguments by using the alternate addressing method. The
following example shows how one could send two sets of coordinate locations to a macro subroutine. Local variables
#4 through #9 would be set to .0001 through .0006 respectively.