1791
Mach4 General Discussion / Re: Needing help with screens
« on: December 03, 2014, 10:37:14 PM »
I cannot set up output 5 in the DEMO. BUT I did setup output3 and ran this code and it turned ON the output3.
--Laser Zero
--Get the instance of the controller
local inst= mc.mcGetInstance();
mc.mcCntlGcodeExecute(inst, "G1 X10 Y10 F50");--run some g-code
mc.mcAxisSetPos(inst, 0, 0.000);
mc.mcAxisSetPos(inst, 1, 0.000);
--Get the out3 handle
local out3= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT3);
--Output TOGGLE
local outstate = mc.mcSignalGetState(out3);
if (outstate == 1) then
mc.mcSignalSetState(out3, false);
else
mc.mcSignalSetState(out3, true);
end
--Laser Zero
--Get the instance of the controller
local inst= mc.mcGetInstance();
mc.mcCntlGcodeExecute(inst, "G1 X10 Y10 F50");--run some g-code
mc.mcAxisSetPos(inst, 0, 0.000);
mc.mcAxisSetPos(inst, 1, 0.000);
--Get the out3 handle
local out3= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT3);
--Output TOGGLE
local outstate = mc.mcSignalGetState(out3);
if (outstate == 1) then
mc.mcSignalSetState(out3, false);
else
mc.mcSignalSetState(out3, true);
end