11
Mach4 General Discussion / Re: Homing Speed v3481
« on: January 22, 2018, 11:51:28 AM »
Thank you for your information. I have the cslab IP-M controller. I will contact them.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
--[[function m6()
local inst = mc.mcGetInstance()
local selectedtool = mc.mcToolGetSelected(inst)
local currenttool = mc.mcToolGetCurrent(inst)
mc.mcCntlSetLastError(inst, "M06 Lua makro")
if selectedtool == currenttool then
mc.mcCntlSetLastError(inst, "Current tool == Selected tool so there is nothing to do")
else
--Remove this line if you would not like the Z axis to move
--mc.mcCntlGcodeExecute(inst, "G90 G53 G0 Z0.0");--Move the Z axis all the way up
--mc.mcCntlGcodeExecute(inst, "G59\nG00 Z0\nG00 X0 Y48");--Move the Z axis all the way up
--mc.mcCntlFeedHold(inst);
mc.mcCntlToolChangeManual(inst, true);
mc.mcCntlSetLastError(inst, "Current tool == " .. tostring(selectedtool) .. " Previous Tool == " .. tostring(currenttool))
mc.mcToolSetCurrent(inst, selectedtool)
end
end
if (mc.mcInEditor() == 1) then
m6()
end]]
function m6()
local inst = mc.mcGetInstance()
local selectedtool = mc.mcToolGetSelected(inst)
local currenttool = mc.mcToolGetCurrent(inst)
--if selectedtool == currenttool then
--mc.mcCntlSetLastError(inst, "Current tool == Selected tool so there is nothing to do")
--else
--Remove this line if you would not like the Z axis to move
--mc.mcCntlGcodeExecute(inst, "G90 G53 G0 Z0.0");--Move the Z axis all the way up
--mc.mcCntlSetLastError(inst, "m6()");
local signal = mc.OSIG_OUTPUT1;
--local signalToolchange = mc.OSIG_TOOL_CHANGE;
local hSig = mc.mcSignalGetHandle(inst, signal);
local state = mc.mcSignalGetState(hSig);
local stateToolchange = mc.mcSignalGetState(mc.mcSignalGetHandle(inst, mc.OSIG_TOOL_CHANGE));
mc.mcCntlSetLastError(inst, "m6(): mc.OSIG_OUTPUT1 state"..tostring(state));
mc.mcCntlSetLastError(inst, "m6(): mc.OSIG_TOOL_CHANGE state"..tostring(stateToolchange));
if state == 0 then
mc.mcCntlSetLastError(inst, "m6(): Tool change active");
mc.mcCntlGcodeExecute(inst, "M00");
mc.mcSignalSetState(hSig, true);
mc.mcCntlSetLastError(inst, "Current tool == " .. tostring(selectedtool) .. " Previous Tool == " .. tostring(currenttool))
mc.mcToolSetCurrent(inst, selectedtool)
else
mc.mcSignalSetState(hSig, false);
mc.mcCntlSetLastError(inst, "m6(): Tool change inactive");
--mc.mcCntlSetLastError(inst, "m6(): mcCntlToolChangeManual");
--mc.mcCntlToolChangeManual(inst, true);
end;
--end
end
if (mc.mcInEditor() == 1) then
m6()
end