
B–63833EN–1/02
11. PROGRAM COMMAND
649
Although subprograms are useful for repeating the same operation, the
custom macro function also allows use of variables, arithmetic and logic
operations, and conditional branches for easy development of general
programs such as pocketing and user–defined canned cycles. A
machining program can call a custom macro with a simple command, just
like a subprogram.
O0001 ;
:
:
:
G65 P9010 R50.0 L2 ;
:
:
M30 ;
Machining program
Custom macro
O9010 ;
#1=#18/2 ;
G01 G42 X#1 Y#1 F300 ;
G02 X#1 Y–#1 R#1 ;
:
:
:
M99 ;
This means that a function of general use can be formed when
programming a certain function as a custom macro. That is, programs can
be written using variables for data that might change or be unknown. This
can be further applied to group technology.
Similar workpieces can be collected as a group and a universal custom
macro body can be programmed using variables applicable to each group.
In this way, programming is not required for the workpieces in the group.
The programmer only need to assign actual values to the variables.
r
β
α
Bolt hole circles as shown in the above figure can be made easily.
Once a custom macro body for the bolt hole circle is programmed and
registered, the CNC can operate as if it has the bolt hole circle cutting
function.
Programmers can use the bolt hole circle function by using the following
command only:
(Example of calling bolt hole circle)
G65 Pp Rr Aα Bβ Kk ;
11.5
CUSTOM MACRO
11.5.1
Custom Macro
General