I found this online and got it to work a little bit but it isn't exactly what I'm after. Maybe one of you sharp VB folks can help me adjust it a touch?
Basically it doesn't seem to create an error when it goes down and tries to find the plate and can't and hits the Zmove distance.
I would like it to move (not jog/rapid) the Z axis down the ZMove distance. If it doesn't touch the plate then it will immediately go back up to where it started from and send a message "Touch Plate Not Found". If it does contact the touch plate then it will go back up to Zsal and the DRO will read correctly.
+++++++++++++++
'VB Code Start
'-------------------
CurrentFeed = GetOemDRO(818)
DoSpinStop()
ZMove = 0.5 'Total length of Probe to move before Stop or no Contact Made.
ZOffset = .125 'Plate Hight
ZSal = ZOffset + 0.5 '+ Free Height, Will position the probe 0.5 over the material.
StopZmove = 0
If GetOemLed (825)=0 Then
DoOEMButton (1010)
Code "G4 P2.5"
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
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 "(Z zeroed)"
Code "F" &CurrentFeed
End If
Else
Code "(Check Ground Probe)"
End If
Exit Sub
'-------------------
'VB Code Stop