M6 Start Code Below
toolpos1 = GetOemdro(1001)
toolpos2 = GetOemdro(1002)
toolpos3 = GetOemdro(1003)
toolpos4 = GetOemdro(1004)
toolpos5 = GetOemdro(1005)
toolpos6 = GetOemdro(1006)
toolnew = GetSelectedTool()
toolold = GetOemdro(824)
If (toolnew = 0)Or(toolnew = 0 ) Then
MsgBox (" invalid tool number !!!")
message(" invalid tool number !!!")
Call Code("M30")
end
End If
If (toolnew = toolold) Then
message("tool in use!")
end
end If
If (toolnew < 1)Or(toolnew >6 ) Then
SetCurrentTool(toolold)
MsgBox (" invalid tool number !!!")
message(" invalid tool number !!!")
Call Code("M30")
end
End If
message(" toolchange running !!")
If (toolnew = 1)then
Call Code("G0 G53 X105 Y4.5"&(toolpos1))
While ismoving()
Sleep 100
Wend
End If
If (toolnew = 2)then
Call Code("G0 G53 X105 Y34.5"&(toolpos2))
While ismoving()
Sleep 100
Wend
End If
If (toolnew = 3)then
Call Code("G0 G53 X105 Y64.5"&(toolpos3))
While ismoving()
Sleep 100
Wend
End If
If (toolnew = 4)then
Call Code("G0 G53 X15 Y64.5"&(toolpos4))
While ismoving()
Sleep 100
Wend
End If
If (toolnew = 5)then
Call Code("G0 G53 X15 Y34.5"&(toolpos5))
While ismoving()
Sleep 100
Wend
End If
If (toolnew = 6)then
Call Code("G0 G53 X15 Y4.5"&(toolpos6))
While ismoving()
Sleep 100
Wend
End If
SetCurrentTool( toolnew )
message("toolchange finished !")
end
M6 End Code Below
REM The default script here moves the tool back to m6start if any movement has occurred during the tool change..
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
a = GetToolChangeStart( 3 )
b = GetToolChangeStart( 4 )
c = GetToolChangeStart( 5 )
if(IsSafeZ() = 1) Then
SafeZ = GetSafeZ()
if SafeZ > z then StraightTraverse x, y,SafeZ, a, b, c
StraightFeed x, y, z , a, b, c
else
Code"G00 X" & x & "Y" & y
end if
Here's the code I modified to run a Boxford Duet....It requires homing switches and I added a homing button on the lathe screenset for the Y axis.
It's an old topic but the code will no doubt help someone who google's for a Boxford Duet toolchange macro as it hurt my head a little fudging bit's of code from all over to get this working.