'
'Touch Plate M801 Macro
'
' Z Zero Touch Plate Shuttle Pro
' 
'
Code "(Touch Plate Macro Runing)"
' CurrentFeed = GetOemDRO(818)  'Get the current feedrate
PlateThickness = 0.244  ' Set the thickness of the touch plate

' Check to see if Cycle Start or Spindle is active
' If active then exit macro.
If GetOEMLED(11) Or GetOEMLED(804) Then

   If GetOEMLED(11) Then
       Code "(Spindle Active - Zero Touch Plate Macro Aborted)"
   End If
   
   If GetOEMLED(804) Then
       Code "(Cycle Start Active - Zero Touch Plate Macro Aborted)"
   End If
   
Else

    'Code "G4 P5"  		'Time to get to the zero plate
    Code "G31Z-3 F10"	'

    While IsMoving()
    Wend

    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.8"		"Change the Z retract height here
    Code "(Z Axis is now Zeroed)"
    Code "F" &CurrentFeed	

End If
Exit Sub
         
