
B–63682EN/01
18. CUSTOM MACRO
NC FUNCTION
123
- WHILE (<conditional expression>) DO m (m = 1, 2, 3)
:
END m
While <conditional expression> is satisfied, blocks from DO m to
END m is repeated.
When <conditional expression> is no more satisfied, it is executed
from the block next to
END m block.
Example
#120 = 1 ;
WHILE [#120 LE 10] DO 1 ;
#120=#120+1 ;
END
Repeated 10 times.
The format is the same as the sub program.
0 Macro number ;
Custom macro body
M99 ;
- Simple call
G65 P (macro number) L (times to repeat)
<argument assignment> ;
A value is set to a variable by <argument assignment>.
Write the actual value after the address.
Example A5.0E3.2M13.4
There is a regulation on which address (A – Z) corresponds to which
variable number.
- Modal call
G66 P (macro number) L (times to repeat)
<argument assignment> ;
Each time a move command is executed, the specified custom macro
body is called. This can be canceled by G67.
This function is useful when drilling cycles are programmed as custom
macro bodies.
D Format of custom macro
body
D Custom macro
instruction