' BOXFORD 125TCL' 8 position tool changer' rough draft For a lock back To pawl Type tool changer' use/modify it as you wish, I take no responsability' for any damage to you or your equipment.If IsLoading() Then  ' do now't, program loadingElse  Dim next_tool As Integer  Dim current_tool As Integer  Dim steps_per_tool As Integer  Dim steps_after_pawl As Integer  Dim max_tools As Integer  Dim holdingDRO As Integer  Dim rotateCW As Integer  Dim moves As Integer  Dim fast_feed As Integer  Dim slow_feed As Integer  Dim axis As String  Dim zero As Integer  Dim to_pawl As Integer  zero = 0  axis = "A" ' change to what ever axis you use for tool changer  max_tools = 8 ' number of tools on turret  steps_per_tool= 80 ' set to what ever it needs to be  steps_after_pawl = 0 ' set to amount to clear pawl  steps_to_lock_back_on_pawl = 10 ' number of steps to lock onto pawl  holdingDRO = 1050 ' or what ever you have set screen dro to  next_tool = GetSelectedTool()  current_tool = GetUserDRO(holdingDRO)  fast_feed = 4000 ' set to safe rapid rotation speed  slow_feed = 2000 ' set to safe creep speed back onto pawl.' do some tool changing  If next_tool > max_tools Then    Message "Tool number too high, program stopped."    Code "M30"    End  End If     If next_tool < 1 Then    Message "Tool number too low, program stopped."    Code "M30"    End  End If    Code "G90"  If next_tool = current_tool Then  ' do nowt, we got it already  Else  ' lets do some changing    If next_tool>current_tool Then moves=next_tool-current_tool          If next_tool<current_tool Then moves=max_tools-current_tool+next_tool        rapid_move = (moves * steps_per_tool) + steps_after_pawl    to_pawl = zero - steps_to_lock_back_on_pawl - (moves * 5)    Message "Moving turret to safe position"   ' Code "G90 G53"          If current_tool = 1 Or current_tool = 3 Or current_tool = 5 Or current_tool = 7 Then    	Code "G0 G53 X-3"    	While IsMoving()    	Wend    	Code "G0 G53 Z-3"    	While IsMoving()    	Wend    	End If        If current_tool = 2 Or current_tool = 4 Or current_tool = 6 Or current_tool = 8 Then    	Code "G0 G53 Z-3"    	While IsMoving()    	Wend    	Code "G0 G53 X-3"    	While IsMoving()    	Wend    	End If        Code "G92 " & axis & "0" 'make 0 the current point of axie A    Code "G91 G94 G61"     Message "Changing tool for no: " & next_tool    Code "G01 " & axis & rapid_move & "F" & fast_feed    While IsMoving()    Wend    Code "G01 " & axis & to_pawl &  "F" & slow_feed    While IsMoving()    Wend    SetCurrentTool next_tool    SetUserDRO holdingDRO, next_tool    Code "G90" ' back to absolute movement'    Code "G0 X-5 Z-5"    Message "Active tool No: " & next_tool   End If End If' end of tool change               