
PROGRAMMING
B–64144EN/01
15. CUSTOM MACRO
317
N1 G01 G41 X100.0 G100 Dd ;
>
> : Block being executed
j : Blocks read into the buffer
N1
N2
N3
N2 #1=100 ;
N3 Y100.0 ;
N4 #2=200 ;
N5 M08 ;
N6 #3=300 ;
N7 X200.0 ;
:
N4
N3
N5
N6
N7
NC statement
execution
Macro statement
execution
Buffer
When the N1 is being executed, the NC statements in the next two blocks
(up to N5) are read into the buffer. Since N5 is a block that involves no
movement, an intersection cannot be calculated. In this case, the NC
statements in the next three blocks (up to N7) are read. The macro
statements (N2, N4, and N6) between N1 and N7 are processed during
execution of N1.
In case of using the following system variables (Table 15.7.2) in macro
program and you need to execute the macro program after completing the
block execution just before the macro program, M code which can prevent
buffering (parameter No.3411–3432) or G53 command block is necessary
just before the macro program.
Table 15.7.2
Meaning Read
Write
Number of
Variable
Note
(In case not to
command M code
preventing buffering or
G53 block.)
nals
Read #1000 – #1015 ,
#1032
The data is read at
buffering a macro
program.
Write #1100 – #1115 ,
#1132
The data is written at
buffering a macro
program.
Tool com-
pensation val-
ues
Write #10001 – The data is written at
buffering a macro
program.
Macro alarms Write #3000 Macro alarm is
generated at maximum
2 blocks before a macro
program.
D When the next block
involves no movement in
cutter compensation C
(G41, G42) mode
15.7.2
Caution for using
system variables