#
# MACRO tool_change1 *** constant surface footage
#
MACRO: establish_home
MACRO: tool_call
SELECT: Power_tool
CASE: 0
#   ASSIGN: Codes= StringChoice("B90.","B0.",Odid_cycle);
ASSIGN: Speed= SfpmToRpm(Speedcode,3.0,1.0);
ASSIGN: Speed= ValueChoice(Speed,Max_rpm,(Speed<Max_rpm));
OUTPUT: G50S{Speedmax}
OUTPUT: G54
ASSIGN: Spindle=StringChoice(Main_spindle_cw,Main_spindle_ccw,(Spindle_dir<0));
OUTPUT:  {Const_surf_speed}S{Speedcode} {Spindle}
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: G54
#   ASSIGN: Codes= StringChoice("B0.","B90.",(Power_tool>1));
ASSIGN: Spindle=StringChoice(Tool_spindle_cw,Tool_spindle_ccw,(Spindle_dir<0));
OUTPUT:  {Direct_rpm}S{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}
END SELECT:
