Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: Davek0974 on February 03, 2014, 03:35:42 PM

Title: Auto Z setting, macro help....
Post by: Davek0974 on February 03, 2014, 03:35:42 PM
Can someone tell me what this code would do if placed at the start of the M3 command....

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

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's very similar, what I want is for mach to reference the material surface at the start of EVERY plasma pierce/cut.

Any ideas