731
Mach4 General Discussion / Re: Lua Sizer Confusion tying Sizer to Panel
« on: June 02, 2015, 12:58:30 AM »
don't ya girl friend know shes ya mistress the mill`s the wife
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.
--Laser Zero
------------------------turn output on/off------------------------------------
local inst = mc.mcGetInstance();--Get the instance of the controller
local out5= mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT5);--Get the out5 handle
local outstate = mc.mcSignalGetState(out5);--Output TOGGLE
if (outstate == 1) then
mc.mcSignalSetState(out5, false);
else
mc.mcSignalSetState(out5, true);
end
wx.wxMilliSleep(10);
--------------------------Move to work zero------------------------------------
local inst = 0;
local rc = 0;
local Xmove = "X20"; --set to x offset from spindle
local Ymove = "Y30"; --set to y offset from spindle
mc.mcCntlGcodeExecute(inst, "G91 G0" .. Xmove .. " \n" .. Ymove.."\n G90 \n");--run some g-code
wx.wxMilliSleep(10); --this is here other wise it`s to fast to see anything on DRO`S in editor
mcState = mc.mcCntlGetState(inst);
while (mcState ~= mc.MC_STATE_IDLE) do --This part is so it will Zero axis`s after movement
mcState = mc.mcCntlGetState(inst);
wx.wxMilliSleep(10);
end
mc.mcAxisSetPos(inst, 0, 0.000) --zero x axis
mc.mcAxisSetPos(inst, 1, 0.000) --zero y axis