PROGRAMMING
13. CUSTOM MACRO
B–63664EN/02
266
For smooth machining, the CNC prereads the NC statement to be
performed next. This operation is referred to as buffering. During AI
contour control mode, the CNC prereads not only the next block but also
the multiple blocks. And in the cutter compensation mode (G41, G42),
the CNC prereads the NC statements two or three blocks ahead to find
intersections even if the CNC is not in AI contour control mode. Macro
statements for arithmetic expressions and conditional branches are
processed as soon as they are read into the buffer. Therefore, the timing
of the macro statement execution is not always the specified order.
At the blocks containing M00, M01, M02 or M30, blocks containing
M–codes for which buffering is suppressed by setting parameter
(No.3411–3432), and blocks containing prevention buffering G codes
such as G53, the CNC stops to preread the NC statement after that. Then,
the stop of the macro statement execution is guaranteed until such M
codes or G codes complete its execution.
N1 G31 X100.0 ;
N2 #100=1
:
>
> :Block being executed
NC statement
execution
Macro statement execution
Buffer
N1
N2
NOTE
In case that you need to execute the macro statement after
completing the block just before the macro statement,
specify M code or G code that are not buffered just before
the macro statement. Specially, in case of reading / writing
the system variables to control signals, coordinates, offset
value, etc., it may different system variable data by the
timing of the NC statement execution. To avoid this
phenomenon, specify such M codes or G codes before the
macro statement, if necessary.
13.7
PROCESSING
MACRO
STATEMENTS
13.7.1
Details of NC
Statements and Macro
Statements Execution
D When the next block is
not buffered
(M codes that are not
buffered, G31, etc.)