1981
Mach4 General Discussion / Re: MACH4 Mcode testing
« on: May 26, 2014, 05:08:55 PM »
Steve here is another example of a SIMPLE Mcode to do a simple tap operation. It will not run from the MDI or a Gcode program call.
It will TRY to cycle the first line of code as you can SEE the TOOL CHANGE LED blink but will run the Tap cycle IF you run it from the editor. BUT same as the other example ONLY the first time you run it. After that it is a nogo until you restart Mach4.
function m111()
inst=mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "T111 \n M6 ");
mc.mcCntlGcodeExecuteWait(inst, " M3 S500 M8 \n G4P3 \n G84 Z-0.5000 R.1 G98 F10 \n M5 M9");
end
if (mc.mcInEditor() == 1) then
m111()
end
(;-) TP
It will TRY to cycle the first line of code as you can SEE the TOOL CHANGE LED blink but will run the Tap cycle IF you run it from the editor. BUT same as the other example ONLY the first time you run it. After that it is a nogo until you restart Mach4.
function m111()
inst=mc.mcGetInstance()
mc.mcCntlGcodeExecuteWait(inst, "T111 \n M6 ");
mc.mcCntlGcodeExecuteWait(inst, " M3 S500 M8 \n G4P3 \n G84 Z-0.5000 R.1 G98 F10 \n M5 M9");
end
if (mc.mcInEditor() == 1) then
m111()
end
(;-) TP