16.CUSTOM MACRO
PROGRAMMING
B-63944EN/03
- 540 -
16.7.4
Macro Call Using a G Code
By setting a G code number used to call a macro program in a
parameter, the macro program can be called in the same way as for a
simple call (G65).
O0001 ;
:
G81 X10.0 Y20.0 Z-10.0 ;
:
M30 ;
O9010 ;
:
:
:
N9 M99 ;
Parameter No.6050=81
Explanation
By setting a G code number from -9999 to 9999 used to call a custom
macro program (O9010 to O9019) in the corresponding parameter
(No.6050 to No.6059), the macro program can be called in the same
way as with G65. To call custom macro program O9040 to O9049
using a G code with a decimal point, set bit 0 (DPG) of parameter No.
6007 to 1 and set the G code number in the corresponding parameter
(Nos. 6060 to 6069).
The number of decimal places of a G code is 1. Set the value
obtained by multiplying a desired G code number by 10 in the
corresponding parameter.
[Example] When parameter No. 6060 is set to 234, custom macro program
O9040 is called using G23.4.
When a negative G code is set, a modal call is performed. In this
case, bit 3 (MGE) of parameter No. 6007 can be set to select the G66
or G66.1 mode.
For example, when a parameter is set so that macro program O9010
can be called with G81, a user-specific cycle created using a custom
macro can be called without modifying the machining program.
- Correspondence between parameter numbers and program numbers
G code with no decimal point
G code with a decimal point
Parameter number
Program number
Parameter number
Program number
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
O9010
O9011
O9012
O9013
O9014
O9015
O9016
O9017
O9018
O9019
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
O9040
O9041
O9042
O9043
O9044
O9045
O9046
O9047
O9048
O9049