464
« on: March 10, 2017, 05:34:17 PM »
Hi George, got any hair left?
First, in config ->homing/limits, check to see what 'Speed %' you have for the A axis.
Second, the screen set you are using is custom. In your code you keep setting DRO 803 to the new tool number. that is the A axis dro not the current tool number.
I have taken your code and modified it a bit and it works for me when I step through it. See if it works for you. I have commented out the second line which I used to test it in the script editor. If you want to step through with the editor debugger just take the REM out , step through it(don't try to step while it is moving the dro wait until it stops) when done you should see the dro at the right angle and the tool numer changed in the box right and below. Change the NEWTOOL number and test again.
NEWTOOL = GetSelectedTool()
REM NEWtool = 4
If NEWTOOL = GetCurrentTool() Then ' If the tool called for is the same as already in then toolchange ignored
NEWTOOL = NEWTOOL
ElseIf NEWTOOL > 8 Then 'If tool called is greater than 8 then code is stopped and message telling you why is displayed
DoOemButton(1003)
MsgBox("Tool number too high, file will rewind")
DoOemButton(1002)
ElseIf NEWTOOL < 1 Then ' If tool called is less than 1 then code is stopped and message telling you why is displayed
DoOemButton(1003)
MsgBox("Tool number too low, file will rewind") 'Tool number called is too high so code will stop and rewind so editing can take place
DoOemButton(1002)
Else
code("G90")
If NEWTOOL = 1 Then
Code("G0A0")
While IsMoving()
Wend
Code("G0A-358")
While IsMoving()
Wend
REM SetOemDRO(803,1)
ElseIf NEWTOOL = 2 Then
Code("G0A45")
While IsMoving()
Wend
Code("G0A-43")
While IsMoving()
Wend
REM SetOemDRO(802,2)
ElseIf NEWTOOL = 3 Then
Code("G0A90")
While IsMoving()
Wend
Code("G0A-88")
While IsMoving()
Wend
REM SetOemDRO(803,3)
ElseIf NEWTOOL = 4 Then
Code("G0A135")
While IsMoving()
Wend
Code("G0A-133")
While IsMoving()
Wend
REM SetOemDRO(803,4)
ElseIf NEWTOOL = 5 Then
Code("G0A180")
While IsMoving()
Wend
Code("G0A-178")
While IsMoving()
Wend
REM SetOemDRO(803,5)
ElseIf NEWTOOL = 6 Then
Code("G0A225")
While IsMoving()
Wend
Code("G0A-223")
While IsMoving()
Wend
REM SetOemDRO(806,6)
ElseIf NEWTOOL = 7 Then
Code("G0A270")
While IsMoving()
Wend
Code("G0A-268")
While IsMoving()
Wend
REM SetOemDRO(803,7)
ElseIf NEWTOOL = 8 Then
Code("G0A315")
While IsMoving()
Wend
Code("G0A-313")
While IsMoving()
Wend
REM SetOemDRO(803,8)
End If
SetCurrentTool(NEWTOOL) ' Set Tool number DRO to new tool
End If
In config->general Config make sure that 'Rot 360 Rollover' is ticked and that 'Ang Short Rot on G0' is not ticked.
If this doesn't do it I am at a loss.
HTH
RT