(author: Chris P) (version: 0.2) (date: 06/27/24) (Measure tool and set Z 0.000 in current WCO for new tool) o sub (uses NGCGUI style arg spec) (number after "=" in comment is default value) # = #3004 (set from probe screen fast probe feed rate) # = #3005 (set from probe screen slow probe feedrate) # = #3006 (set from probe screen traverse probe feedrate) # = #3007 (max z distance the tool travels before erroring out if not contact is made) # = #3008 (max xy distance the tool travels before erroring out if not contact is made) # = #3009 (distance the tool retracts after making contact during fast feed mode) # = #3010 (G53 distance from home to spindle nose triggering point on touch plate) # = #3011 (activates the tool diameter probe subroutine section) # = #3012 (activates the tool diameter offset position for probe subroutine section) # = #5410 (current tool's diameter used for offseting probe position in x axis) (start with an m6, do all the standard m6 stuff and then touch off -TMC) M6 (Cancel G92 offsets) G92.1 (Cancel Feedrate Override) M50 P0 o100 if [2 EQ 2] G49 o100 endif G90 (set absolute coordinates) G53 G1 F[#] Z0 (move to z0 home position) G53 G1 F[#] X# Y# # = #[5203 + [20 * #5220]] (Current Z Position including offsets in current program units) # = #5422 (Initial Fast Z- Probe) G91 F[#] G38.2 Z-[#] # = #5063 (Probe Error check, #5070 will be 0 if failed) o110 if [#5070 EQ 0] (back to start point and feed) G90 G1 F[#] Z# F[#] (return from sub) M50 P1 o return o110 endif (Move to z_clearance height for slow probe) G90 G1 F[#] Z[# + #] (Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed) o120 if [# GT 0] (Initiate Slow Z- Probe) G91 F[#] G38.2 Z-[# * 2] # = #5063 G90 G1 F[#] Z[# + #] o120 endif # = [# + #] # = [# - #] (Record Z zero in selected WCO) G10 L2 P#5220 Z[# + #] (Move to Toolset location) G53 G1 F[#] X# Y# (pause for dust boot) M0 (replace the dust boot) (Reinstate Feedrate Override) M50 P1 o endsub M2 (end program)