This is a drawing of a simple touch plate with instructions on how to set up Mach. I have posted the macro I use to take advantage of it as well as a couple of screen shots to help I hope. The script could be enhanced a little with a sleep command and also to check to see if the z is less than 0 but it works pretty well as is. The Auto Tool Zero button is one I added in screen 4. (This is a much nicer screen editor than screen 4 that Klauss has done an amazing job with. Go here to watch the videos and download MachScreen). http://www.kd-dietz.com/klausphp/pages/eng/machscreen/description/ms_description.html#
It is a VB button and you can just paste the code into it with Mach up, go to the operator tab, edit button script. The button will begin to blink. Now click on the button, paste the code in, save and then close the editor. If everything else is right your auto touch off routine should work now.
The blue LED beside the button is one I added to make sure if I touch my plate to my tool that Mach will see it. This is not necessary but I think this is important because a broken wire or bad connection has the potential to crash your z axis, break your tool, etc. Please note, there are a lot of better macros floating around for this. 2/4/13
'Auto touch off macro
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
ProbeFeed = 5
Code "G90 F" &ProbeFeed
If GetOemLed (825)=0 Then
Code "G4 P2" 'Time to get to the z-plate
Code "G31Z-5 F" &ProbeFeed
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z0.25" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Code "(Z-Plate is grounded, check connection and try again)"