381
Mach4 General Discussion / Re: Screen Set Ideas
« on: May 06, 2014, 06:21:21 PM »
Nice work! you are a mad man!
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.
G0 Z1
X1Y1
M98 P1 L4
G0 X0Y0
m30
o1
G91 X2.5
G90
Z-1
G13 I1 F1000 (speed for sim Smiley )
Z1
M99
SigLib = {
--Enable
[mc.OSIG_MACHINE_ENABLED] = function (state)
machEnabled = state;
end,
--HeadUp
[mc.ISIG_INPUT1] = function (on_off)--mc.ISIG_INPUT1
if( on_off==1 ) then
-- On
else
-- Off
end
end,
--HeadDn
[mc.ISIG_INPUT2] = function (state)--mc.ISIG_INPUT2
if( state == 1 ) then
-- On
else
-- Off Call A function here if you wanted
end
end,
[mc.ISIG_INPUT3] = function (state)--mc.ISIG_INPUT3 --Used as an enable button
if( state == 1 ) then
local inst= mc.mcGetInstance();
local reg = mc.mcSignalGetHandle(inst, mc.OSIG_MACHINE_ENABLED)
state = mc.mcSignalGetState(reg);
if(state == 1)then
state = 0
else
state = 1
end
mc.mcCntlEnable(inst, state);
end
end,
[mc.ISIG_INPUT4] = function (state)--mc.ISIG_INPUT2 button to do feed hold
if( state == 1 ) then
local inst= mc.mcGetInstance();
mc.mcCntlFeedHold(inst)
end
end,
[mc.ISIG_INPUT5] = function (state)--mc.ISIG_INPUT2
if( state == 1 ) then
CycleStart() --Run my cycle start function
end
end
}
Then in the signal script I do this:if(SigLib[sig] ~= nil)then
SigLib[sig](state);
end