Originally Posted by
hemsworthlad
Yes Tex it works but like before if the offset plate is set to zero then it doesn't retract or set the DRO to zero.
I,ve altered the code below so that it does this know, I know most will use a plate of some kind but every now and again some like me wont so now it covers all base's.
I also turned down the slow feed from 100mm to 50mm i feel hundred is a bit fast esp for small tiny cutters.
Other than that it's good. . . Thanks. (Please test without plate on your machine because i've changed the inch's side as well)
Rem Rem VBScript To probe In the z axis 'Written by Big-Tex May 23 2010
If GetOemLED(801) Then 'NOTE: This part of script is for Inches as Native Units
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Else
Code "G4 P1" 'Pause 1 seconds to give time to position probe plate
PlateOffset = GetUserDRO(1151) 'Get plate offset DRO
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F12" 'slow down feedrate to 12 ipm
Rem Probe In the z direction
ZNew = GetDro(2) - 6 'probe move to current z - 6 inches
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew +.1 'move back +.1 to hit point incase there was overshoot +.1
While IsMoving ()
Wend
Rem End add lines
Code "F4" 'slow down feedrate to 4 ipm
ZNew = GetDro(2) - .25 'probe move to current z - .25 inches
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
If PlateOffset <> 0 Then
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
ZNew = PlateOffset + 2.6315 'calc retract
Code "G0 Z" &ZNew 'put the Z retract height you want here
While IsMoving ()
Wend
Else
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
ZNew = + 2.6315 'calc retract
Code "G0 Z" &ZNew 'put the Z retract height you want here
While IsMoving ()
Wend
Code "(Z axis is now zeroed)" 'puts this message in the status bar
End If
Code "F" &CurrentFeed 'Returns to prior feed rate
End If
Else 'NOTE: This portion of script is for Metric as Native Units
If GetOemLed (825) <> 0 Then 'Check to see if the probe is already grounded or faulty
Code "(Z-Plate is grounded, check connection and try again)" 'this goes in the status bar if aplicable
Else
Code "G4 P1" 'Pause 1 seconds to give time to position probe plate
PlateOffset = GetUserDRO(1151) 'Get plate offset DRO
CurrentFeed = GetOemDRO(818) 'Get the current feedrate to return to later
Code "F300" 'slow down feedrate to 300 mmpm
Rem Probe In the z direction
ZNew = GetDro(2) - 150 'probe move to current z - 150 mm
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew + 3 'move back + 3 mm to hit point incase there was overshoot + 3 mm
While IsMoving ()
Wend
Rem End add lines
Code "F50" 'slow down feedrate to 100 mmpm
ZNew = GetDro(2) - 6 'probe move to current z - 6 mm
Code "G31Z" &ZNew
While IsMoving() 'wait for probe move to finish
Wend
ZNew = GetVar(2002) 'read the touch point
Code "G0 Z" &ZNew 'move back to hit point incase there was overshoot
While IsMoving ()
Wend
If PlateOffset <> 0 Then
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
ZNew = PlateOffset + 20 'calc retract
Code "G0 Z" &ZNew 'put the Z retract height you want here
While IsMoving ()
Wend
Else
Call SetDro (2, PlateOffset) 'set the Z axis DRO to plate thickness
Code "G4 P0.25" 'Pause for Dro to update.
ZNew = 20 'calc retract
Code "G0 Z" &ZNew 'put the Z retract height you want here
While IsMoving ()
Wend
Code "(Z axis is now zeroed in metric Units)" 'puts this message in the status bar
End If
Code "F" &CurrentFeed 'Returns to prior feed rate
End If
End If