Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: MitchB on December 30, 2015, 07:53:17 PM
-
Before I delve into this, I wanted to see if there's a simple way to assign Feed Hold to a keyboard key. Thanks.
-
Hit the space bar.
-
That worked for me in Mach 3. Not in Mach 4.
-
Sorry, I didn't see it was Mach4.
What about the keyboard plugin?
-
I don't see a Feed Hold function that I can assign to a key. I don't know if that means I need to write one or if it is somewhere that I don't see it. I see only functions for jogging.
-
The keyboard plugin is for inputs and feedhold is an output.
You could assign a function of none in the plugin and tie this to an input, then in your plc you can activate the feedhold when this input state is changed.
DazTheGas
-
Any chance there are step by step instructions somewhere describing how to do that?
-
This should sort you out http://www.machsupport.com/forum/index.php/topic,31585.0.html (http://www.machsupport.com/forum/index.php/topic,31585.0.html)
DazTheGas
-
Wow. That's great. I'm looking forward to trying it. Thanks a lot.
-
Is there a reason you put this in the PLC script instead of the Signal script?
-
No reason they both do the same thing,
DazTheGas
-
the other way to do it is as a signal table, it work's the same as what Daz said to do
SignalTable = {001,
[mc.ISIG_INPUT0] = function (on_off)
if (on_off == 1) then
mc.mcCntlCycleStart(inst)
end
end
}
SignalTable = {002,
[mc.ISIG_INPUT1] = function (on_off)
if (on_off == 1) then
mc.mcCntlCycleStop(inst)
end
end
}
SignalTable = {003,
[mc.ISIG_INPUT2] = function (on_off)
if (on_off == 1) then
mc.mcCntlReset(inst)
end
end
}
SignalTable = {004,
[mc.ISIG_INPUT3] = function (on_off)
if (on_off == 1) then
mc.mcCntlFeedHold(inst)
end
end
}
-
Two Lua questions about your example:
1. Are these table constructors redeclaring SignalTable each time? Shouldn't all the keys and functions be in one SignalTable?
2. What are the 001, 002, etc. for?
-
pass it's what I was told to do