At the moment i've written a module with separate functions inside to swap between router and spindel.
If i implement them in a macro and test the macro all is working (finally) as it should!
Now i'm trying a very basic m6 for testing purposes that should initiate a tool swap based on toolnumber.
The problem is there is nothing happening when running a test gcode file, it just runs as it only has one tool and doesn't act on the different statements or toolnumbers. It's like it's completely ignoring the tool input.
Is there a way of figuring this out?
In the control panel the tool is already set on use tool on M6 line.
function m6()
local inst = mc.mcGetInstance()
local SelectedTool = mc.mcToolGetSelected(inst)
local CurrentTool = mc.mcToolGetCurrent(inst)
package.path = wx.wxGetCwd() .. "\\Modules\\AvidCNC\\?.lua"
zc = require "MyzControl"
if (SelectedTool <=100) then
zc.SpindleM6()
mc.mcToolSetCurrent (inst, SelectedTool)
else
zc.RouterM6()
mc.mcToolSetCurrent (inst, SelectedTool)
end
end
if (mc.mcInEditor() == 1) then
m6()
end