And here are my macros, which I am beginning to suspect:
(start)........
tool = GetSelectedTool()
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
SafeZ = GetSafeZ()
if SafeZ > z then StraightTraverse x, y, SafeZ
SetCurrentTool( tool )
(end)...........
x = GetToolChangeStart( 0 )
y = GetToolChangeStart( 1 )
z = GetToolChangeStart( 2 )
SafeZ = GetSafeZ()
if SafeZ > z then StraightTraverse x, y, SafeZ
StraightFeed x, y, z |
Ger21,
I meant I dont see it in the Macro, the g-code tells the macro what tool to select, his macro isn't switching the Mach program. Looks like the control thinks the tool number is the same tool (just in a different location on the ATC)
The macro is supposed to be doing all the work, T2 is just the tool to pick out of the macro.
I copied the code from the video, they said it was on the Mach site, (I couldn't find it). Anyway here is the code from the video. The code has 8 tool positions.
'ToolChange Macro For Bed type tool changer 11/05 Brian
Sub Main()
OldTool = GetOEMDRO (1200) 'Tool In spindle DRO You must add this to your settings screen
x = GetToolChangeStart ( 0 )
y = GetToolChangeStart ( 1 )
z = GetToolChangeStart ( 2 )
a = GetToolChangeStart ( 3 )
b = GetToolChangeStart ( 4 )
c = GetToolChangeStart ( 5 )
tool = GetSelectedTool()
NewTool = tool
'Tool Changer Macro (Bed Type)
MaxToolNum = 8 'Max number off tools for the changer
ToolDown = -3.125 'Z Pos to Get or drop a tool
ToolUp = 0.0 'Z Height to Rapid from tool to tool
If NewTool = OldTool Then
Exit Sub
End If
While NewTool > MaxToolNum
NewTool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
Code "G00 G53 Z" & ToolUp
While IsMoving()
Wend
Call MovePos(OldTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
ActivateSignal(Output1) 'Turn on Draw bar to release the tool
Code "G4 P1.0" 'Wait for tool to release
'SystemWaitFor (7) 'Wait for the tool Release Limit switch
Code "G53 Z" & ToolUp
Call MovePos(NewTool)
While IsMoving()
Wend
Code "G53 Z" & ToolDown
Code "G4 P.75"
While IsMoving()
Wend
DeActivateSignal(Output1) 'Turn Off Draw bar to Clamp the tool
Code "G4 P1.0" 'Wait for the tool to Clamp
While IsMoving()
Wend
Code "G53 Z" & ToolUp
Call SetUserDRO (1200 NewTool)
SetCurrentTool( NewTool )
Code "G00 X" & x & " Y" & y 'Move back to where the tool change was prompted
End Sub
Sub MovePos(ByVal ToolNumber As Integer)
Select Case ToolNumber
Case Is = 1
Xpos = 12.00
Ypos = 2.00
Case Is = 2
Xpos = 14.00
Ypos = 2.00
Case Is = 3
Xpos = 16.00
Ypos = 2.00
Case Is = 4
Xpos = 18.00
Ypos = 2.00
Case Is = 5
Xpos = 12.00
Ypos = 4.00
Case Is = 6
Xpos = 14.00
Ypos = 4.00
Case Is = 7
Xpos = 16.00
Ypos = 4.00
Case Is = 8
Xpos = 18.00
Ypos = 4.00
End Select
Code "G53 X" & XPos & " Y" & YPos
End Sub
Main |
.