(author: Chris P) (version: 0.2) (date: 06/27/24) (Probe Z Minus direction and set Z 0 in current WCO) (Start probe position is over stock 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) # = #3014 (=99) # = #3015 (=0) # = #3016 (=10.0) # = #3017 (=50) # = #3020 (=0.5000) # = #3021 (=0.1000) # = #3030 (=0) (Cancel G92 offsets) G92.1 (Cancel Feedrate Override) M50 P0 # = #[5203 + [20 * #5220]] (Probe Tool Safety Check) o100 if [#5400 NE #] (DEBUG, Specified probe tool %d# not in spindle, aborting) M50 P1 o return o100 endif (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 (defines the edge as z_probed_position for DRO reporting) # = # (output to gui DRO "Z PROBED POSITION") #1009 = # (DEBUG, EVAL[vcp.getWidget{"z_minus_probed_position"}.setValue{#1009}]) # = [# + #] (probe mode rule for WCO or probe position measuring only) o130 if [# EQ 0] (Record Z zero in selected WCO) G10 L2 P#5220 Z[# + #] o130 endif (Reinstate Feedrate Override) M50 P1 o endsub M2 (end program)