324
« on: December 18, 2009, 01:50:33 AM »
I recognise the comment wording as an old example of mine. (Which was based on someone else's)
Try a couple of mods, slowing it down for one,
PlateThickness = GetUserDRO(1151) 'Z-plate thickness DRO
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place, 2 seconds
Code "G90 G31 Z-30 F50" 'probing move, can set the feed rate here as well as how far to move
While IsMoving() 'wait while it happens
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, PlateThickness) 'set the Z axis DRO to whatever is set as plate thickness
Sleep 150 'Pause for Dro to update.
Code "G1 Z30 F200" 'put the Z height to retract to here
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
End If
Exit Sub