
12. USER PROGRAMS FOR TOOL CHANGE
USER PROGRAM B-63423EN/02
-74-
l Tool Change Sequence of FANUC standard macro program (O9301)
O9301 call_cutter_compensation_cancel
call_canned_cycle_cancel
G91
G28 Z0
G28 X0 Y0
G90
if[tool_no lt 0]goto err
if[p_cutter_offset_no ne p_cutter_offset_no_off]then
if[cutter_offset_no lt 0]goto err
if[length_offset_no lt 0]goto err
endif
if[p_animation_t_radius eq p_animation_t_radius_on]then
if[animate_tool_radius lt 0]goto err
endif
if[next_tool_no lt 0]goto err
if[call_tool_macro eq 0]then
if[tool_no ne #0]then
T[tool_no] M6
endif
else
if[tool_no ne #0]then
T[tool_no]
call_tool_change [call_tool_macro]
endif
endif
if[p_cutter_offset_no ne p_cutter_offset_no_off]then
D[cutter_offset_no]
H[length_offset_no]
endif
T[next_tool_no]
if[p_cutter_offset_no eq p_cutter_offset_no_off && p_animation_t_radius
ne p_animation_t_radius_on]goto ret
if[p_animation_t_radius ne p_animation_t_radius_on]then
if[cutter_offset_no ne #0]then
call_get_tool_offset D[cutter_offset_no]
G10 L91 R[tool_radius]
endif
else
if[animate_tool_radius ne #0]then
G10 L91 R[animate_tool_radius]
endif
endif
goto ret
n98 error_message = input_value_is_erroneous
call_error_display
n99 return
Output G40 for cutter compensation.
Output G80 for a canned cycle.
Return to the reference position.
Check input data.
Change tools when a T code is set.
Change tools set in memory.
Output D and H codes.
Output the next tool T code.
Output the
radius o
the tool for
animated
simulation.
Display an error message.