What would this code do if place into the M3 command in mach...

DoOEMButton (1010) 'reset z DRO
Code "G4 P1" 'wait
Code "G31 Z-100 F250" 'probe surface
While isMoving()
Wend
ZprobePos = GetVar(2002) 'get contact point
Code "G0 Z" &ZprobePos 'return to point to remove overshoot
While IsMoving()
Wend
DoOEMButton (1010) 'reset z DRO
Code "G4 P1" 'wait
Code "G0 Z20" 'remove floating head travel
DoOEMButton (1010) 'reset the z DRO
Code "G4 P1" 'wait
.....continue on with normal M3 stuff


Would that not probe the surface and leave my Z DRO at zero ready for the M3 command to complete?


This is all theory but I do write VB programs in my day job and it seems very similar