Stumbled upon a situation today brought on by the massive flexibility of my Bridgeport CNC conversion, the tool-change was set to go to a programmed position - this could cause the tool to be dragged over clamps etc or with a large lump on the bed which overhangs could cause it to be mashed into the rear body of the machine.
The safest option seems to be to do nothing but lift the Z up to machine zero then wait.
This is my current M6Start macro, M6End is empty.
My question - if i comment out the block marked ************************************X, i think that will do it, BUT is there anything in the rest of the macro that does anything useful, apart from the block that parks the Z axis??
Sub Main()
Dim XScale, YScale, ZScale
Dim ZClear, Zoffset, ZClearMach
Dim ClearAllow
Dim Response
If GetOEMLED(1866) Then Exit Sub
If GetOEMLED(801) Then ' On = English Measure INCH
ClearAllow = 0.125 ' Max Z Travel = .125in below Machine Z zero
Else ' Off = Metric Measure MM
ClearAllow = 2.0 ' Max Z Travel = 2mm below Machine Z zero
End If
Zclear = GetOEMDRO(1814) ' Get Z Clearance Plane from DRO
Zoffset = GetOEMDRO(49)
ZClearMach = Zoffset + Zclear
CurrentAbsInc = GetOemLED(48) ' Get the current G90/G91 state
'Get Axis Scale factors
XScale = GetOEMDRO(59)
YScale = GetOEMDRO(60)
ZScale = GetOEMDRO(61)
'Set All Axis' Scale to 1
Call SetOEMDRO(59,1)
Call SetOEMDRO(60,1)
Call SetOEMDRO(61,1)
Sleep(250)
tool = GetSelectedTool()
SetCurrentTool( tool )
SetVar(1, GetOEMDRO(800))
SetVar(2, GetOEMDRO(801))
SetVar(3, GetOEMDRO(802))
TCX=GetOEMDRO(1200)
TCY=GetOEMDRO(1201)
TCZ=GetOEMDRO(1202)
Code "G90"
Code "G53 G0 Z" & ZClear
While IsMoving()
Wend
Code "G53 G0 X" & TCX & " Y" & TCY ***************************************************************X
While IsMoving() ***************************************************************X
Wend ***************************************************************X
If CurrentAbsInc = 0 Then 'if G91 was in effect before then return to it
Code "G91"
End If
Call SetOEMDRO(59,XScale)
Call SetOEMDRO(60,YScale)
Call SetOEMDRO(61,ZScale)
Sleep(250)
End Sub