``` (author: Chris P) (version: 0.3) (date: 04/22/19) (Probe front left top corner for x,y,z 0,0,0 position) (Start probe position is over front left corner of stock) (inside the step off width square and within max z distance) (ensure all settings have been set properly according to help diagrams) o sub (uses NGCGUI style arg spec) (number after "=" in comment is default value) # = #1 (=99) # = #2 (=.5000) # = #3 (=.5000) # = #4 (=.0000) # = #5 (=.1000) # = #6 (=0 what is this?) # = #7 (=0) # = #8 (=5) # = #9 (=20) # = #10 (=.0000) # = #11 (=0) # = #12 (=0) # = #13 (=.7500) # = #14 (=.5) (Cancel G92 offsets) G92.1 # = #[5201 + [20 * #5220]] # = #[5202 + [20 * #5220]] # = #[5203 + [20 * #5220]] (Probe Tool Safety Check) o<110> if [#5400 NE #] (MSG, Specified probe tool # not in spindle, aborting) o return o<110> endif (Probe Diameter) # = #5410 (Probe Radius) # = [# / 2] (Probe Centerline Offset) # = [# - #] (Current Z Position including offsets in current program units) # = #5422 (Current Feed Rate) # = #<_feed> (Probe Top of Workpiece) G91 (Initial Fast Z- Probe) F[#] G38.2 Z-[#] # = #5063 (Probe Error check, #5070 will be 0 if failed) o<120> if [#5070 EQ 0] (back to start point and feed) G90 G0 Z# F# (return from sub) o return o<120> endif (Move to z_clearance height for slow probe) G90 G0 Z[# + #] (Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed) o<130> if [# GT 0] (Initiate Slow Z- Probe) G91 F[#] G38.2 Z-[# * 2] # = #5063 (debug, Probed Pos: #5063 Z Pos: #<_z>) G90 G0 Z[# + #] o<130> endif (Record Z zero in selected WCO) G10 L2 P#5220 Z[#5063 + #] (Probe X Positioning Move, Step Off Width) G91 G0 X-[#] (Probe X Positioning Move, to Probing Depth) F[#] G1 Z-[# + # + #] (Current X Position including offsets in current program units) # = #5420 (Initiate Fast X+ Probe) G38.2 X[#] # = #5061 (Probe Error check, #5070 will be 0 if failed) o<140> if [#5070 EQ 0] (back to start point and feed) G90 G0 X# F# (return from sub) o return o<140> endif (Move to xy_clearance distance for slow probe) G90 G0 X[# - #] (Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed) o<150> if [# GT 0] (Initiate Slow X+ Probe) G91 F[#] G38.2 X[# * 2] # = #5061 (debug, Probed Pos: #5061 X Pos: #<_x>) G90 G0 X[# - #] o<150> endif (Record X Zero in selected WCO) G10 L2 P#5220 X[#5061 + # + #] (Probe Y Positioning Move, up to Z clearance plane) G91 G0 Z[# + # + #] (Probe Y Positioning Move, Traverse Workpiece Top at Z Clearance Height plane) G0 X[#] Y-[#] (Probe Y Positioning Move,to Probing Depth) F[#] G1 Z-[# + # + #] (Current Y Position including offsets in current program units) # = #5421 (Initiate Fast Y+ Probe) G38.2 Y[#] # = #5062 (Probe Error check, #5070 will be 0 if failed) o<160> if [#5070 EQ 0] (back to start point and feed) G90 G0 Y# F# (return from sub) o return o<160> endif (Move to xy_clearance distance for slow probe) G90 G0 Y[# - #] (Slow Probe Rule, if Slow Probe FR is set to 0, Slow Probe is Bypassed) o<170> if [# GT 0] (Initiate Slow Y+ Probe) G91 F[#] G38.2 Y[# * 2] # = #5062 (debug, Probed Pos: #5062 Y Pos: #<_y>) G90 G0 Y[# - #] o<170> endif (Record Y Zero in selected WCO) G10 L2 P#5220 Y[#5062 + # + #] (Probe Completion Move to Z Clearance Plane, and X Zero, Y Zero) G90 G0 Z[#] G0 X0.0000 Y0.0000 o endsub M02 (end program)