; Subroutine O sub #5 = #1 ; O while [#5070 NE 1] ; close contact control G38.3 Z#5 ; go down along Z axis until the surface is touched #5 = [#1 + #2] ; increment O endwhile (LOG, X#5061 Y#5062 Z#5063 A#5064 #B5065) ; write coordinates on logfile O endsub ; main code #1 = Z safe ; Z start #2 = Z inc ; Z increment F ; set feed rate (LOGOPEN, probe-output.txt) G1 X Y Z A B O call [#1] [#2] ..... ; repeat ..... (LOGCLOSE) M2