Hi Steve,
Thanks for spending the time on this I have been going round in circle for days on this one, even thought about going back to an old PC on windows 7 and Mach3.
I am new to Mach 4 but have been running mach 3 for ten years making model parts on my Boxford Mill and Boxford Lathe with tool turret. The plan was to update them to Mach 4 and windows 10 on new pcs with windows 10 and ESS.
I have tried G43 on next line but it makes no difference.
I am using an ER16 collet chuck on my router spindle.
I was leaving the same tool in the chuck as a test to try and Identify the problem. This tool was initially measured manually in the offset window giving an offset of -14.995 which is correct. (my tool plate is 8mm)
I did not change the tool as I was trying to identify the problem using the entries in the tool table.
By only changing the tool number and the offset number in the MDI line "Txx M6 G43 Hxx" the tool table should show every entry as being the same length for each tool but as shown it does not.
That's why I am confused when using "T on M6 line is tool to use" The offset keeps changing each time and it is always wrong.
I have managed to attach the M6 macro I am using.
Best regards
Arthur
function m6()
local inst = mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "G53 G0 Z0\nG53 G0 X700 Y65")--Move the Z to Home.Then to the X, Y Coords for our touch pad.
mc.mcCntlSetLastError(inst, 'Now in Tool Change Position. Hit Cycle Start!')
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
local posmode = mc.mcCntlGetPoundVar(inst, mc.SV_MOD_GROUP_3) --get the current mode so we can return to it when macro ends
local selectedtool = mc.mcToolGetSelected(inst)
local currenttool = 1--mc.mcToolGetCurrent(inst)
if selectedtool == currenttool then
mc.mcCntlSetLastError(inst, "Current tool == Selected tool so there is nothing to do")
else
mc.mcCntlToolChangeManual(inst, true);
mc.mcCntlSetLastError(inst, "Current tool == " .. tostring(selectedtool) .. " Previous Tool == " .. tostring(currenttool))
mc.mcToolSetCurrent(inst, selectedtool)
local MyChoice = wx.wxMessageBox("Click Ok to Begin Probing the New Tool connect probe","Click OK to continue" , 16)
mc.mcCntlSetLastError(inst, "Probing in Progress!")
mc.mcCntlGcodeExecuteWait(inst, " G91 G31 Z-150. F125.")--probe the new tool
local probedz = mc.mcCntlGetPoundVar(inst, mc.SV_PROBE_POS_Z) -- Z Probe position in Machine coords
mc.mcCntlGcodeExecute(inst, string.format('G ' .. posmode))--return to pre macro mode G90, or G91
mc.mcCntlGcodeExecuteWait(inst, "G00 G53 Z0 ")--Retract
local NewOffset = probedz
mc.mcToolSetData(inst, mc.MTOOL_MILL_HEIGHT, selectedtool, NewOffset)
mc.mcCntlSetLastError(inst, string.format("Auto tool setting complete, Offset = %.4f", NewOffset))
wx.wxMessageBox("Toolchange Complete.\nTLO Set")
end
end
if (mc.mcInEditor() == 1) then
m6()
end