I have been working on an issue with my tool touch off routine and just got it straight. This was a macro I had been using for a couple of years already. I have been doing some testing and some where along the line it got broke. The problem was simple. The VB in Mach is running faster now so the sleep command is a necessity in many cases now. I have been aware of this for a good while now but the tunnel vision got me good this time.
![Roll Eyes ::)](https://www.machsupport.com/forum/Smileys/default/rolleyes.gif)
Can you paste this code in your button for a test for me? Let me know if this works for you.
Brett
'Auto tool touch off button script
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"
While IsMoving()
Sleep(100)
Wend
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Sleep(100)
Wend
Call SetDro (2, PlateThickness)
Sleep(100)
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
Else
Code "(Z-Plate is grounded, check connection and try again)"
Exit Sub
End If