M6Start.mis
 
Note that I move the A axis 72 degrees, then back up 12. This should cause the ratchet to lock up. Also note all A axis moves are made in relative mode (G91).

*******************************

Sub main

tool=getcurrenttool()
'MsgBox ("current tool " & tool)
NewTool= getselectedtool()
'msgbox ("new tool " & NewTool)

if NewTool=tool then
  exit sub
end if

if NewTool>tool then
   steps=Newtool-tool
else
   steps=6 - (tool-NewTool)
End If

If tool Mod 2 Then 'even number
   code "G00 Z 2"
Else
   code "G53 G00 X 0"   'move X to machine home 0
   code "G00 z -2"
End If


'msgbox(" move steps " & steps)

for I=1 to steps
   code "G91 G00 A72"
code "g00 A-12"
code "G90"
While IsMoving()
Wend

next I




end sub

main

