CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
CurrentAbsInc = GetOemLED(48) 'Get the current G90/G91 state
CurrentGmode = GetOemDRO(819) 'Get the current G0/G1 state
Code "G91 G28 Z0."
While IsMoving() 'wait while it happens
Wend
Code " G91 G28 A0 C0"
While IsMoving() 'wait while it happens
Wend
Code "G54 G90 G0 X80.347 Y-29.898"
While IsMoving() 'wait while it happens
Wend
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
While IsMoving() 'wait while it happens
Wend
Code "G4 P1" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-200. F2500" '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 exact point the probe was hit
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving() 'wait while it happens
Wend
Call SetDro (2, 60.35) ' PROBE THICKNESS
Code "G91 G1 Z5.F2500"
While IsMoving() 'wait while it happens
Wend
DoOEMButton (1010) 'zero the Z axis so the probe move will start from here
While IsMoving() 'wait while it happens
Wend
Code "G4 P1" ' this delay gives me time to get from computer to hold probe in place
Code "G90 G31Z-10. F100" '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 exact point the probe was hit
Code "G4 P0.5" 'Pause for Dro to update.
Code "G0 Z" &ZProbePos 'go back to that point, always a very small amount of overrun
While IsMoving ()
Wend
Call SetDro (2, 60.473) ' PROBE THICKNESS
Code "G91 G1 Z" & 99.527 & "F2500"
While IsMoving ()
Wend
Code "G90 G94 G54 "
While IsMoving ()
Wend
Else
End If