Well folks. My VB writing skills are horrid, I am wondering if you might point me in the right direction to modify the following macro to do the following-
Rotate my 8 position (stepper driven) toolchanger in only one direction.
When I run the macro below (created by hood I believe) I get the tool turret (my rotary axis A) moving in the direction that will bring it to the requested tool in the shortest number of steps. While normally, this would be good, my gear train has sufficient backlash to make it better, if the turret only rotates in one direction regardless of how close the next called tool is to the current loaded tool.
I have a theory of how to do this-
Say for example- current tool is 1, called tool is 7, (normally this would rotate through position 8 and then stop at seven) I want it to rotate to position 2, 3, 4, 5, 6, and stop at seven. I know this is inefficient, but it will fix the backlash issue created by "ang short rotation"
I have tried to run hoods macro with both ang short rot both on and off, it only makes a difference when running code. when calling tool positions inside the macro, mach appears to ignore the ang short rot setting and revert to moving the fastest way possible.
Any thoughts on how to make the macro always move in + degrees from its current tool location through each intermediary position until reaching the called tool?
I tried some things in the VB editor, but keep getting syntax errors.
"""""""""""""""""""""""""""
If GetSelectedTool() = GetCurrentTool() Then
End
End If
If GetSelectedTool = 1 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A0"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
If GetSelectedTool = 2 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A45"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
If GetSelectedTool = 3 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A90"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
If GetSelectedTool = 4 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A135"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
If GetSelectedTool = 5 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A180"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
If GetSelectedTool = 6 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A225"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
If GetSelectedTool = 7 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A270"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
If GetSelectedTool = 8 Then
ActivateSignal(OutPut2)
Sleep 500
Code "G53 G0 A315"
While IsMoving()
Wend
DeActivateSignal(OutPut2)
End If
"""""""""""""""""""""""""""