Professional Documents
Culture Documents
FixedTouchOffsetDRO = 2015
WorkZeroDRO = 2016
Wh =2017
Code "G49" 'Tool Ofsetts Off
LineNo = GetOEMDRO(816)
If (Tool_Num = 0) Then
DiameterParam = 1
ZoffsetParam = 2
XwearParam = 3
ZwearParam = 4
Next
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-25 F200" 'probing move, can set the feed rate here as well as how
far to move
While IsMoving() 'wait while it happens
sleep 50
Wend
ZProbePos = GetVar(2002) 'get the axact point the probe was hit
sleep 100
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of
overrun
While IsMoving ()
sleep 50
Wend
Axis_Pos = GetOEMDRO(85)
SetUserDRO(WorkZeroDRO, Axis_Pos)
End If
If GetOemLed (825)=0 Then 'Check to see if the probe is already grounded or faulty
'DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
Code "G4 P2" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-100 F200" 'probing move, can set the feed rate here as well as how
far to move g90 removed
While IsMoving() 'wait while it happens
sleep 50
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 ()
sleep 50
Wend
Code "G4 P1"
If Tool_Num =0 Then
ZprobeOffset = GetOEMDRO(85)
SetUserDRO(FixedTouchOffsetDRO, ZprobeOffset)
End If
Axis_Pos = GetOEMDRO(85)
WrkZero = GetUserDRO(WorkZeroDRO)
FtoDRO = GetUserDRO(FixedTouchOffsetDRO)
WrkHeight = WrkZero + FtoDRO
NewToolZero =Axis_Pos - FtoDRO
Z_Offset = NewToolZero
SetUserDRO(2017, WrkHeight)
Code "(Z axis is now zeroed)" 'puts this message in the status bar
Code "F" &CurrentFeed 'Returns to prior feed rate
Else
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the
status bar if aplicable
Msg = "ERROR Z-Plate is grounded - Check and retry"
MsgBox Msg
Exit Sub
End If
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
If CurrentGMode = 0 Then 'if G0 was in effect before then return to it
Code "G0"
End If
SetFeedRate (800/60)
Exit Sub