' (C) Graham Waterworth Mach3 support forum.' draft for a lock back to pawl type tool changer' e.g. Boxford 125/160 and many others. Single direction' change with reverse lock back to pawl.  Moves to G53' safe position. This has not been tried on any tool changer.' Use/modify it as you wish, I take no responsibility' for any damage to you or your equipment.If IsLoading() Then  ' do now't, program loadingElse' dim some vars  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  Dim safe_G53X As Double  Dim safe_G53z As Double  Dim safe_path As Integer' set up some vars  zero = 0 ' do not change this value.  axis = "C" ' change to what ever axis you use for tool changer  rotateCW = 0 ' set to 1 for CCW and 0 for CW rotation on tool to tool move.  max_tools = 8 ' number of tools on turret  steps_per_tool= 10 ' set to number of steps to move 1 tool position  steps_after_pawl = 10 ' set to amount to clear pawl  steps_to_lock_back_on_pawl =15 ' number of reverse steps to lock onto pawl  holdingDRO = 1050 ' or what ever you have set screen dro to  next_tool = GetSelectedTool() ' get next tool from Mach3  current_tool = GetCurrentTool()' get current tool from Mach3  fast_feed = 2500 ' set to safe rapid rotation speed  slow_feed = 500 ' set to safe creep speed back onto pawl.  safe_path = 0 ' move to safe position by 0 = X & Z together, 1 = X then Z, 2 = Z then X  ' Note position is from home so usually a minus figure  safe_G53x = -5. ' set to safe position in X axis for tool change.  safe_G53z = -10. ' set to safe position in Z axis for tool change.  ' remove comment to test and set values as required  ' current_tool = 1  ' next_tool = 4	' check tool is in range  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	' are we going to do a change  If next_tool=current_tool Then    ' do nowt, we got it already    Message "Tool already loaded."  Else    ' we need to do a change    ' lets go somewhere safe to do this next bit    Code "G00 G90"    If safe_path = 0 Then      Message "Rapid safe move in X & Z."      Code "G53 X" & safe_G53x & " Z" & safe_G53z      While IsMoving()        Sleep(25)      Wend    End If    If safe_path = 1 Then      Message "Rapid safe move in X then Z."      Code "G53 X" & safe_G53x      Code "G53 Z" & safe_G53z      While IsMoving()        Sleep(25)      Wend    End If    If safe_path = 2 Then      Message "Rapid safe move in Z then X."      Code "G53 Z" & safe_G53z      Code "G53 X" & safe_G53x      While IsMoving()        Sleep(25)      Wend    End If  ' 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    Message "Rapid move to next tool calculated."    If rotateCW = 1 Then      rapid_move = zero - rapid_move      to_pawl =  Abs(to_pawl)    End If    Code "G92 " & axis & "0"    Code "G91 G94"    Message "Moving turret to next tool."    Code "G01 " & axis & rapid_move & "F" & fast_feed    While IsMoving()      Sleep(25)    Wend    Message "Rapid to tool complete."    While IsMoving()      Sleep(25)    Wend    Message "Moving back on to pawl."    Code "G01 " & axis & to_pawl &  "F" & slow_feed    While IsMoving()      Sleep(25)    Wend    Message "Lock back complete."    SetCurrentTool next_tool    SetUserDRO holdingDRO, next_tool    Code "G90" ' back to absolute movement    Code "G95" ' back to feed per rev  End If End If' end of tool change             