361
Mach4 General Discussion / Re: Signal Scripts
« on: May 10, 2014, 05:38:00 PM »
I did an update to the Sig Lib it now is tested to be working and I made it simulate a tool release button .
SigLib = {
[mc.ISIG_INPUT1] = function (state)
end,
--Tool Release Button
[mc.ISIG_INPUT2] = function (state)--mc.ISIG_INPUT1
local inst = mc.mcGetInstance();
local hsig = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT1);
if( state==1 ) then
--Check to see if the spindle is stopped here
--Turn On Tool Release (Unclam Tool)
mc.mcSignalSetState(hsig, 1 );
else
--Turn Off Tool Release (Clamp Tool)
mc.mcSignalSetState(hsig, 0 );
end
end
}
You also need to have a signals script with this code
if(SigLib[sig] ~= nil)then
SigLib[sig](state);
end
Thanks
Brian
SigLib = {
[mc.ISIG_INPUT1] = function (state)
end,
--Tool Release Button
[mc.ISIG_INPUT2] = function (state)--mc.ISIG_INPUT1
local inst = mc.mcGetInstance();
local hsig = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT1);
if( state==1 ) then
--Check to see if the spindle is stopped here
--Turn On Tool Release (Unclam Tool)
mc.mcSignalSetState(hsig, 1 );
else
--Turn Off Tool Release (Clamp Tool)
mc.mcSignalSetState(hsig, 0 );
end
end
}
You also need to have a signals script with this code
if(SigLib[sig] ~= nil)then
SigLib[sig](state);
end
Thanks
Brian