'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 = 13      'Max number off tools for the changerToolDown   = -3.125 'Z Pos to Get or drop a toolToolIn	   = -0.50ToolOut    = -2ToolUp     = -0.75    '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-0.25"While IsMoving()WendCall MovePosNotHome(OldTool)While IsMoving()WendCode "G53 Z" & ToolDownCode "F50"Code "G53 Y" & ToolInCode "G4 P1.25"While IsMoving()WendActivateSignal(Output2) 'Turn On Draw bar to release the toolCode "G4 P1.25"    'Wait for the tool to release'SystemWaitFor (7) 'Wait for the tool Release Limit switchCode "G00 G53 Z" & ToolUpCall MovePosHome(NewTool)While IsMoving()WendCode "F50"Code "G53 Z" & ToolDownCode "G4 P1"While IsMoving()WendDeActivateSignal(Output2) 'Turn Off Draw bar to Clamp the toolCode "G4 P1.5"    'Wait for the tool to ClampCode "G53 Y" & ToolOutWhile IsMoving()WendCode "G00 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 MovePosNotHome(ByVal ToolNumber As Integer)Select Case ToolNumber       Case Is = 1         Xpos =  2.00         YPos = -2.00       Case Is = 2         Xpos =  3.717         YPos = -2.00       Case Is = 3         Xpos =  5.434         YPos = -2.00       Case Is = 4         Xpos =  7.151         YPos = -2.00       Case Is = 5         Xpos =  8.868         YPos = -2.00       Case Is = 6         Xpos = 10.585         YPos = -2.00       Case Is = 7         Xpos = 12.302         YPos = -2.00       Case Is = 8         Xpos = 14.019         YPos = -2.00       Case Is = 9         Xpos =  15.736         YPos = -2.00       Case Is = 10         Xpos =  17.453         YPos = -2.00       Case Is = 11         Xpos =  19.17         YPos = -2.00       Case Is = 12         Xpos =  20.887         YPos = -2.00       Case Is = 13         Xpos =  22.604         YPos = -2.00End SelectCode "G53 X" & XPos & " Y" & YPosEnd SubSub MovePosHome(ByVal ToolNumber As Integer)Select Case ToolNumber       Case Is = 1         Xpos =  2.00         YPos = -.5       Case Is = 2         Xpos =  3.717         YPos = -.5       Case Is = 3         Xpos =  5.434         YPos = -.5       Case Is = 4         Xpos =  7.151         YPos = -.5       Case Is = 5         Xpos =  8.868         YPos = -.5       Case Is = 6         Xpos = 10.585         YPos = -.5       Case Is = 7         Xpos = 12.302         YPos = -.5       Case Is = 8         Xpos = 14.019         YPos = -.5       Case Is = 9         Xpos =  15.736         YPos = -.5       Case Is = 10         Xpos =  17.453         YPos = -.5       Case Is = 11         Xpos =  19.17         YPos = -.5       Case Is = 12         Xpos =  20.887         YPos = -.5       Case Is = 13         Xpos =  22.604         YPos = -.5End SelectCode "G53 X" & XPos & " Y" & YPosEnd SubMain     