Thanks for the reply Jeff. Here is my probing script.
Sub Main()
'probe
HomSigX = IsActive(2)
HomSigY = IsActive(5)
HomSigZ = IsActive(
Xreferd = GetLED(7)
Yreferd = GetLED(
Zreferd = GetLED(9)
If HomSigX Or HomSigY Or HomSigZ = True Then
MsgBox("Home switch active...please deactivate before tool change.")
Exit Sub
End If
If Xreferd Or Yreferd Or Zreferd = True Then
MsgBox("Axis not referenced...please home all first.")
Exit Sub
End If
LastFeed=GetOEMDRO(818)
SetUserLED(1001,False)
SoftState = GetOEMLED(815)
If SoftState = True Then
DoOEMButton (119)
SetUserLED(1001,1)
End If
SetUserLED(1002,0)
WorkUnits = GetOEMLED(801)
If WorkUnits = True Then
code "G21"
SetUserLED(1002,1)
End If
DoOEMButton(104)
While IsMoving()
Sleep 100
Wend
xTSensPos = GetUserDRO(1200)
yTSensPos = GetUserDRO(1201)
code "G00"
code "G53X" & xTSensPos & "Y" & yTSensPos
While IsMoving()
Sleep 100
Wend
SensGapPos = GetUserDRO(1203)
code "G00"
code "G53Z" & SensGapPos
While IsMoving()
Sleep 100
Wend
zTSensPos = GetUserDRO(1202)
SensSpeed = GetUserDRO(1204)
code "G31Z" & zTSensPos & "F" & SensSpeed
While IsMoving()
Sleep 100
Wend
CurrFixture=GetOEMDRO(46)
Select Case CurrFixture
Case 2
ProgXZero = GetUserDRO(1209)
ProgYZero = GetUserDRO(1210)
ZtoProbe = GetUserDRO(1212)
Case 3
ProgXZero = GetUserDRO(1213)
ProgYZero = GetUserDRO(1214)
ZtoProbe = GetUserDRO(1216)
Case Else
ProgXZero = GetUserDRO(1205)
ProgYZero = GetUserDRO(1206)
ZtoProbe = GetUserDRO(1208)
End Select
SetDRO(2,ZtoProbe)
code "G00"
DoOEMButton(104)
While IsMoving()
Sleep 100
Wend
code "G00"
code "G53Y" & ProgYZero & "G53X" & ProgXZero
While IsMoving()
Sleep 100
Wend
If GetUserLED(1001)= 1 Then
DoOEMButton (119)
SetUserLED(1001,0)
End If
If GetUserLED(1002)= 1 Then
code "G20"
SetUserLED(1002,0)
End If
SetOEMDRO(818,LastFeed)
End Sub