Hey All,
Need some help from the code junkies please.. I have an existing macro that does my homing and a tool pro be for me. it runs like so:
Z, Y, X then Probe. https://www.youtube.com/watch?v=gQVm4YjLM3E
I have since upgrade to a 5th axis, and I need to home A and B as well..
BUT
B = no issue as it cannot crash anything//
A = Issues..
then script will need to run as follows now:
action sequence:
1. Home Z: then Move Z to a safe distance. (say 10mm down from home switch)
2. Home X: then Move it to Fixture 1(g54) X0 (XYZ share one input signal, I have to move off the switch for next axis homing run)
3. Home Z: then move it to Fixture 1(g54) Y0 (XYZ share one input signal, I have to move off the switch for next axis homing run)
4: Home B:
5: Home A: then move A to -A45
6: Probe Tool: (note Z MUST stay at same height until its directly over tool probe before going Down Z.
7: Return to the safe Z (10mm below Z probe) over X0andY0
So! Most of the code already exists, and the tool probe position is programmed via my interface so all I need added are the A and B bits..
Any help appreciated folks!
(here is the current standing of my build, jsut about ready to start making noise!!
https://www.youtube.com/watch?v=gQVm4YjLM3E)
and attached is the current Macro. (adding it as file because code is being converted into smiley characters by forum)
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