I looked at the macro documentation. I can do very, very basic C++ but it appears to be pretty difficult for me to convert my homing macro. My macro is a slight modification of someone elses work. With limited skill in gcode and C, I'd likely screw it up.
If you get bored and can do it
Code:
'VB Code Start
'-------------------
CurrentFeed = GetOemDRO(818)
DoSpinStop()
ZMove = 5.00 'Total lenght of Probe to move before Stop or no Contact Made.
ZOffset = 0.059 ' Plate Hight
ZSal = ZOffset + 2.00 '+ Free Hight, Will possition the Proble 2 MM over the Material.
StopZmove = 0
If GetOemLed (825)=0 Then
' DoOEMButton (1010)
Code "G4 P1" 'wait 1 sec
Code "G31 Z-"& ZMove & "F25"
While IsMoving()
Sleep(200)
Wend
Probepos = GetVar(2002)
If Probepos = - ZMove Then
responce = MsgBox ("**ERROR** " , 4 , "Probe **ERROR**" )
Code "G0 Z10"
StopZmove = 1
Code "F" &CurrentFeed
End If
code "G0 z" & probepos +.1
Code "G31 Z-"& ZMove & "F5"
While IsMoving()
Sleep(200)
Wend
Probepos = GetVar(2002)
If StopZmove = 0 Then
Code "G0 Z" & Probepos
While IsMoving ()
Sleep (200)
Wend
' Call SetDro (2, ZOffset)
Code "G4 P1"
'Code "G0 Z" & ZSal
' code "G53 z-.1"
' Code "(Z zeroed)"
Code "F" &CurrentFeed
End If
Else
Code "(Check Ground Probe)"
End If
Exit Sub
'-------------------
'VB Code Stop
'code "g31 z-10 f10" '
'While IsMoving()
'Wend
'code "G92 Z0"
'code "G0Z3"
'While IsMoving()
'Wend
'code "g92z0"