I have a macro working a 8 position ATC on a Boxford 160 lathe. The problem is that sometimes maybe every 8th change or even every 2 changes the X and Y fail to move to the safe position prior to the change but the change still takes place
In the message screen it shows " cannot use G53 incremental Block = G0G53Z0.0000
I can't see this G53 code anywhere in the macro (below) Can someone offer up any suggestions to why this is happening?
thanks
Jason
'This macro drives an 8 position stepper driven ATC.
'It drives forward past a ratchet, then backwards a little to stall the motor
'The Y axis is setup for 20 steps per mm, my ATC requires 900 steps per index
'of 45 degrees.
'Because of the stall, steps are lost. So, we switch to INC mode for the ATC,
'then back to ABS mode before we exit.
'OEMDRO(1200) is utilized to store the last used tool (OldTool) and is updated
'upon final execution of the macro. This is resorted to as the Txxyy will overwrite
'the "CurrentTool" DRO.
'The Y axis is zeroed if tool is Number1, to prevent an overflow of the DRO after
'multiple changes.
'M6Start.m1s
Message ("macro running")
OldTool = GetOEMDRO (1200)
Tool = GetSelectedTool()
MaxToolNum = 8 'Max number of tools for the changer
If OldTool = Tool Then
Message ("Selected Tool already loaded")
Exit Sub
End If
While Tool > MaxToolNum
Tool = Question ("Enter New Tool Number up to " & MaxToolNum)
Wend
xval= getoemdro(800) 'get x
zval= getoemdro(802) 'get z
Call Dooembutton(138)
While IsMoving()
Wend
moveto = Tool- OldTool
If moveto<1 Then moveto=8+moveto
code "G91" 'inc mode
code "G00 Y"+Str((moveto*45)+5)
While IsMoving()
Wend
code "G00 Y-5"
While IsMoving()
Wend
code "G01 Y-2 F100"
While IsMoving()
Wend
code "G90" 'abs mode
NewTool=Tool
If NewTool=1 Then
Call DoOemButton (1009) 'zero Y
End If
Call SetUserDRO (1200, NewTool)
SetCurrentTool(NewTool)
code "G0 Z"+Str(zval) 'return to initial position
code "G0 X"+Str(xval) 'before tool change
While IsMoving()
Wend