28.23 MACRO PROGRAMS (G65 AND G67)
Special programs written by the machine builder
or user by the use of a group of instructions are
registered in the part
program memory. These
programs can be called by the use of
G65 or G66
command to execute them .
These special programs are referred to as the
macro program body, which can be written and
stored in the same format as a subprogram.
Main Program
#
G65 P9001
(Argument
Designation)
Main
Program
User
Macro Body
/+09001 ;
/
)
r
~ Variable
L
1
Operation Command
Control Command
\
1
Y
M99 ;
I
Subprogram
However. unlike a subprogram, a macro pro-
gram allows:
( 1)
Use of variables.
(2) Computation between variables or between
constants.
(3) Use of control commands such as a condition-
al branch.
These features enable the user macro body
to provide a generalized program that requires
complicated computations and decisions .
The “argument designation: in calling a macro
program body from the main program makes it
possible to assign the real numbers to the vari-
ables in the body. This enables this macro
program to run as a series of specific programs
that provide tool movements,
In this manual, the macro program body is some–
times referred to as simply, “macro. II
2. 8.23.1 Macro Program Call Commands
A macro program
body ma~ be called in the
following “fiv; manners:
No.
1
2
3
4
5
Type of Call
Simple call
Modal call
Call by arbitrary G cede
Call by M code
Call by T code
Code
-.
tiemams
G 65
G 66
Gxx
Mxx
Txxxx
G 67: For cancel
4digits max.
( 1) Simple Call (G65)
G65
P.. . L.. .
(argument designation) ;
The macro program, whose program number was
specified by p) is called and is executed L times.
The default value of L is 1. When the designa-
tion of an argument to the macro program is
desired, specify it in (argument designation) .
I!Argument designation”
is the assignment of real
numbers to the ‘Ilocal variables”
used in the
macro program.
For details, see 2.8.23.2,
“ ARGUMENT DESIGNATION. ”
(2) Modal Call (G66 and G67)
G66 P.. . L.. .
(argument designation) ;
This command calls the macro subroutine specified
by program number P. Each time a move com-
mand is executed, the specified macro is run L
times.
G67 ;
This command cancels the modal callmode.