; loadtool: with options for G43 and H o sub (not_a_subfile) # = #1 # = #2 # = #3 # = #4 o if [# EQ 0] ;Uncomment next 4 lines to require a nonzero toolno ;(print, loadtool: EXIT: toolno required not 0) ;(debug, loadtool: EXIT: toolno required not 0) ;(AXIS,notify, loadtool: EXIT: toolno required not 0) ;m2 (quit) (print, loadtool: Warning: toolno is 0) (debug, loadtool: Warning: toolno is 0) o endif o if [# NE 0] o if [# EQ 0] o if [# NE 0] (debug, loadtool:G43 noH) o endif T# M6 G43 o else o if [# NE 0] (debug, loadtool:G43 H#) o endif T# M6 G43 H# o endif o else o if [# NE 0] (debug, loadtool:no G43) o endif T# M6 o endif o endsub ;G43 without an H word uses the currently loaded tool from the last Tn M6. ;G43 Hn uses the offset for tool n. ;Note ; G43 H0 is a little special. Its behavior is different on random tool ; changer machines and nonrandom tool changer machines ; ; On nonrandom tool changer machines, G43 H0 applies the TLO of the ; tool currently in the spindle, or a TLO of 0 if no tool is in the spindle. ; ; On random tool changer machines, G43 H0 applies the TLO of the tool T0 ; defined in the tool table file (or causes an error if T0 is not defined ; in the tool table).