Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: blauderb on September 19, 2020, 10:20:58 PM

Title: Mach4 build 4517, M6 Not working
Post by: blauderb on September 19, 2020, 10:20:58 PM
After switching computers and installing the latest mach4  build 4517 using a ESSv260 I can no longer get my m6 command to work.  I wrote the script just like Daz instructed in his videos but my machine still skips over the manual tool change.  M01 is turned on.  anyone have a suggestion?
Title: Re: Mach4 build 4517, M6 Not working
Post by: reuelt on September 20, 2020, 01:45:28 AM
After switching computers and installing the latest mach4  build 4517 using a ESSv260 I can no longer get my m6 command to work.  I wrote the script just like Daz instructed in his videos but my machine still skips over the manual tool change.  M01 is turned on.  anyone have a suggestion?
Is your "tool change type" setting set correctly?
Title: Re: Mach4 build 4517, M6 Not working
Post by: blauderb on September 20, 2020, 08:06:49 PM
Yes, I've actually try both setting both nothing changes.

Here's the tool change macro
function m6()

   local inst = mc.mcGetInstance()
   local selectedTool = mc.mcToolGetSelected(inst)
   local currentTool = mc.mcToolGetCurrent(inst)
   
   if selectedTool == currentTool then
   return   
   mc.mcCntlSetLastError(inst, "Current tool == Selected tool so there is nothing to do")
   else
   mc.mcCntlGcodeExecute(inst, "G90 G53 G0 Z0.0");--Move the Z axis all the way up
   local changetoo = mc.mcToolGetDesc (inst,selectedTool)
   wx.wxMessageBox ("Change to tool number "..selectedTool.." "..changetoo.." and press ok to continue")
   
   wx.wxMessageBox ('Toolchange finished')
   end
end
if (mc.mcInEditor() == 1) then
   m6()
Title: Re: Mach4 build 4517, M6 Not working
Post by: reuelt on September 20, 2020, 08:53:02 PM
The should be another  "end" after the last if statement.
Title: Re: Mach4 build 4517, M6 Not working
Post by: blauderb on September 21, 2020, 12:18:12 AM
Okay figured it out, my LUA plugin was not enabled.