o sub # = #<_ini[TOOLSENSOR]maxprobe> # = #<_ini[TOOLSENSOR]search_vel> # = #<_ini[TOOLSENSOR]probe_vel> # = #<_ini[TOOLSENSOR]height> # = #1 (print, max_probe is #) (print, search vel is #) (print, probe vel is #) (print, sensor height is #) (print, zero height is #) G21 (use metric units) G53 G0 Z0 (raise spindle to Z0) G53 G0 X#<_ini[TOOLSENSOR]x> Y#<_ini[TOOLSENSOR]y> G49 (cancel tool offset) G10 L20 P0 Z0 (clear current offsets) G91 (switch to incremental mode) ; this section commented out for sim ;G38.2 Z[-#] F# (probe down) ;G1 Z4.0 (move up 4 mm) ;G4 P0.5 (pause for 0.5 sec.) ;G38.2 Z-6.0 F# (probe down slower) ; this section used for sim, comment out otherwise G1 Z-10 F# G10 L20 P0 Z[# - #] G90 (absolute distance mode) G53 G0 Z0 (move Z up to 0) o endsub M2