#
# MACRO tool_change1 *** constant surface footage
#
MACRO: establish_home
MACRO: tool_call
OUTPUT: G91G30P3X0
OUTPUT: G91G30P3Z0
SELECT: Power_tool
CASE: 0
OUTPUT: M202
OUTPUT: M108
ASSIGN: Codes= StringChoice("B90.","B0.",Odid_cycle);
OUTPUT: G90G00
OUTPUT: M107
OUTPUT: G10.9X1
ASSIGN: Speed= SfpmToRpm(Speedcode,3.0,1.0);
ASSIGN: Speed= ValueChoice(Speed,Max_rpm,(Speed<Max_rpm));
OUTPUT: G92S{Speedmax}M238
ASSIGN: Spindle=StringChoice(Main_spindle_cw,Main_spindle_ccw,(Spindle_dir<0));
OUTPUT:  {Const_surf_speed}S{Speedcode} {Spindle}
OUTPUT: G18G54G90G95G00G43P1x{Tool_dia_off/2}y{Tool_y_off}z{Tool_len_off}
ASSIGN: Ipr_feed_on=1; Ccs=1;
ASSIGN: Feed_code= StringChoice(Ipr_feed_code,Ipm_feed_code,Ipr_feed_on);
OUTPUT:  {Feed_code}
CASE ELSE:
OUTPUT: M200
OUTPUT: M108
ASSIGN: Codes= StringChoice("B0.","B90.",(Power_tool>1));
OUTPUT: G90G00
OUTPUT: M107
OUTPUT: G10.9X0
OUTPUT: G90G54
ASSIGN: Spindle=StringChoice(Tool_spindle_cw,Tool_spindle_ccw,(Spindle_dir<0));
OUTPUT: G97S{Speedcode} {Spindle}
ASSIGN: Feed_code= StringChoice(Ipr_feed_code,Ipm_feed_code,Ipr_feed_on);
ASSIGN: Ipr_feed_on=Tap_cycle; Ccs=0; Speed= Speedcode;
OUTPUT:  {Feed_code}
OUTPUT: M212
END SELECT:
