# macro tool_change: calls tool_change1 for constant surface speed (G96)
#                    and   tool_change2 for G97
#
# must return home before returning to lathe mode.
SELECT: Power_toolr
CASE: 1
RAPID:  X= Diahome/2;
ASSIGN: Plot_on= (Power_tool<1);
MACRO: lathesetup
CASE: 2
RAPID:  Z= Zhome;
ASSIGN: Plot_on= (Power_tool<1);
MACRO: lathesetup
CASE: 3
RAPID:  Z= Zhome;
ASSIGN: Plot_on= (Power_tool<1);
MACRO: lathesetup
CASE ELSE:
MACRO: lathesetup
MACRO: ret_home
END SELECT:
MACRO: calc_cyc_time
MACRO: cycle_time_out
MACRO: cyc_tool_data
MACRO: get_tool_info
#
OUTPUT: **M98P1
OUTPUT: ** {Opt_stop}
MACRO: engage_caxis     Repeats= ((Power_tool> 0)*(Caxis_engaged<1));
MACRO: disengage_c      Repeats= ((Power_tool< 1)*(Caxis_engaged>0));
# make turbopost think tool is home
ASSIGN: Plot_on=0;
ASSIGN: Tape_on=0
RAPID:  X=Diahome/2; Z=Zhome;
ASSIGN: Tape_on=1
#
SELECT: Power_tool
CASE: 1
MACRO: caxis_od_setup
CASE: 2
MACRO: cfacesetup
CASE: 3
MACRO: caxis_id_setup
END SELECT:
#
# delay plot on so we dont get funny power tool motion
ASSIGN: Plot_on= (Power_tool<1);
TOOLSYMBOL:
ASSIGN: Plot_on= (Power_tool<1);
MACRO: speeds                   Repeats= (Thr_cycle<>1);
#
ASSIGN: Plot_on= 1;
ASSIGN: Tool_descr= Tool_desc;
ASSIGN: Tool_filer= Tool_file;
ASSIGN: Tool_numr= Tool_num;
ASSIGN: Tcoder= Tcode;
ASSIGN: Power_toolr= Power_tool;
ASSIGN: Prev_odid= Odid_cycle;
ASSIGN: Dia_comp= Tcode;
ASSIGN: Canned_cyc= 0;
ASSIGN: Tool_ch= 1;
