
B-63943EN-1/02 13.PROGRAM COMMAND
- 1697 -
13.5 CUSTOM MACRO
13.5.1 Custom Macro
Overview
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 ;
:
:
:
G65P9010 R50.0 L2 ;
:
:
M30 ;
Machinin
ro
ram
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: