( Rectangular area probe ) ( adapted for ngcgui-compatibility from smartprobe.ngc written by Chris Radek ) ( This program repeatedly probes a regular XY grid and writes the ) ( probed locations to the file 'rectangle_probe_result.txt' in the same directory ) ( as the .ini file ) ( Requires a probe connected to motion.probe-input ) ( or use scripts/simulate_probe ) (info: Probe a rectangular area) o sub # = #1 (= -1.0) # = #2 (= 1.0) # = #3 (= 0.1) # = #4 (= -1.0) # = #5 (= 1.0) # = #6 (= 0.1) # = #7 (= 1.1) # = #8 (= -0.1) # = #9 (= 20) # = #10 (= 20 in|mm 20|21) # = #11 (= 1 Wait for Start) O1 if [ [# ne 20] and [# ne 21]] (debug, in_or_mm invalid: # - EXITING) (print, in_or_mm invalid: # - EXITING) (AXIS,notify, rectangle_probe: in_or_mm invalid - EXITING) m2 O1 endif # = [fix [abs[# - #]/# + 1]] # = [fix [abs[# - #]/# + 1]] G# # = [# * #] (debug, Probing # * # = # points) (LOGOPEN,rectangle_probe_result.txt) (LOG,# xmin = # xmax = # xinterval = # xsteps = #) (LOG,# ymin = # ymax = # yinterval = # ysteps = #) # = 0 # = 0 G0Z# F# O2 while [# lt #] # = 0 G0 Y[#+#*#] O3 while [# lt #] # = 0 O4 if [[#/2] - fix[#/2] eq 0] # = [# + # * #] O4 else # = [# + # * [# - # - 1]] O4 endif # = 1 O5 while [# NE 0] G38.5 z# (probe until no contact away from work, no error) # = #5070 G38.3 x# (probe until contact, toward work, no error) # = #5070 O5 endwhile O6 if [[# eq 1] and [[# eq 0] and [# eq 0]]] (debug, S to Begin Rectangle Probe) m0 (mandatory stop) M110 (axisui.notifications-clear) O6 endif G38.2Z# (probe until contact, toward work, with error) G0z# # = #5061 # = #5062 # = #5063 (LOG,X# Y# Z#) # = [# + 1] O3 endwhile G0Z# # = [# + 1] O2 endwhile (LOG,# Finished: total points = #) (LOGCLOSE) (debug, Finished: see rectangle_probe_result.txt) G0Z# G0X#Y# o endsub