734
« on: April 27, 2008, 08:27:35 PM »
I have the following macro in the "set tool offset' button on the Offsetts screen
CurrentFeed = GetOemDRO(818) 'Get the current feedrate.
PlateThickness = 0.062 'plate thickness
ProbeFeed = 1.0 'probing feedrate
If GetOemLed (825)=0 Then
'Code "G4 P5" Time to get to the z-plate
Code "G31Z-1 F" &ProbeFeed
While IsMoving()
Wend
Code "G4 P0.25"
ZProbePos = GetVar(2002)
Code "G0 Z" &ZProbePos
While IsMoving ()
Wend
Call SetDro (2, PlateThickness)
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z 0.1" 'Change the Z retract height here
Code "(Z axis is now zeroed)"
Code "F" &CurrentFeed
Else
Code "(Plate is grounded, check connection and try again)"
Exit Sub
End If
Note it has the plate thickness coded into it, and a move of .1 after the touch. You could edit those values to anything you want.
To use this select the offsets screen, then select from the Operator menu the item Edit button script. All the VB buttons will blink, select the 'Set tool offset' button. When the VB window opens delete all the code there and replace it with this code.
Note that this one is going to try to move Z to -1. If you were already below -1 it wouldnt move for a probe cycle. I ought to be more clever and do a relative mode of -1. Maybe someday Ill fix that.