Machsupport Forum
Mach Discussion => Mach4 General Discussion => Topic started by: Riddler on June 02, 2019, 04:41:41 PM
-
How can Mach 4 be modified so the Esc key, when hit, will stop a program currently running? Like the old Mach 3 did. I tried mapping the Esc key in the keyboard inputs under plugins but I don't know what input to map the ESC key to on the Config-Inputs page to make it work. E-stop has to be mapped to Input#52 (the message that pops up if you do anything else)
Thanks
Scott
-
Hi,
yes that can be done.
Daz's video shows the workaround:
https://www.machsupport.com/forum/index.php?topic=31585.0 (https://www.machsupport.com/forum/index.php?topic=31585.0)
Craig
-
It took me abit to get the correct code for a Estop. the help file and what is in the PCL Lua code is not 100% the same.
Here is the code "I" got to work.
if mc.mcSignalGetState (mc.mcSignalGetHandle (inst, mc.ISIG_INPUT63)) == 1 then
mc.mcCntlEStop(inst)
else
-- Do something else
end
Scott
-
Hi,
yes I can see how that code works, it has the advantage of simplicity but is woefully inefficient.
Mach is designed to use a signal library called SigLib in the screenload script. I wrote an introductory .pdf about using
the signal library:
https://www.machsupport.com/forum/index.php?topic=40051.msg267764#msg267764 (https://www.machsupport.com/forum/index.php?topic=40051.msg267764#msg267764)
Craig