FANUC Series 16/18/160/180-Model C for Lathe Operator Manual

PROGRAMMING
16. CUSTOM MACRO
B–62754EN/01
298
D When M99 is executed in a macro program, control returns to the
calling program. At that time, the local variable level is decremented
by one; the values of the local variables saved when the macro was
called are restored.
O0001 ;
:
#1=1 ;
G65 P2 A2 ;
:
:
M30 ;
O0002 ;
:
:
G65 P3 A3 ;
:
:
M99 ;
O0003 ;
:
:
G65 P4 A4 ;
:
:
M99 ;
O0004 ;
:
:
G65 P5 A5 ;
:
:
M99 ;
O0005 ;
:
:
:
:
:
M99 ;
#1 1
::
#33
#1 2
::
#33
#1 3
::
#33
#1 4
::
#33
#1 5
::
#33
#100–, #500–
Main program
(level 0)
Macro (level 1) Macro (level 2) Macro (level 3)
Macro
(level 4)
Local variables
(level 0)
(Level 1) (Level 2) (Level 3) (Level 4)
Common variables
Variables that can be read from and written to by
macros at different levels
Move the tool beforehand along the X– and Z–axes to the position where
a drilling cycle starts. Specify Z or W for the depth of a hole, K for the
depth of a cut, and F for the cutting feedrate to drill the hole.
Z
W
K
Cutting
Rapid traverse
G65 P9100 Kk Ff ;
Zz
Ww
Z : Hole depth (absolute specification)
U: Hole depth (incremental specification)
K: Cutting amount per cycle
F : Cutting feedrate
Sample program
(Drill cycle)
D Calling format

Leave a Reply

Your email address will not be published. Required fields are marked *