Hello,
i think the Problem is in this Sub:
'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
NTool = 16 ' Number of tools changer holds
CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
CWPos = CWPos + NTools
End If
CCWPos = NTools - CWPos
If CWPos < CCWPos Then
call CW()
Else
call CCW()
End If
End Sub
should be IMHO
'Sequence to determine the least travel to move for TC, CW or CCW
'atp = Actual tool position, rtp = Requested tool positon
Sub LeastTravel()
NTools = 16 ' Number of tools changer holds
CWPos = GetSelectedTool() - GetCurrentTool() ' Assume a CW move
If CWPos < 0 Then ' CWPos < 0 ==> rtp < atp
CWPos = CWPos + NTools
End If
CCWPos = NTools - CWPos
If CWPos < CCWPos Then
call CW()
Else
call CCW()
End If
End Sub