Hello Guest it is March 28, 2024, 07:45:52 AM

Author Topic: Mach4, Esc key to stop program running  (Read 1444 times)

0 Members and 1 Guest are viewing this topic.

Mach4, Esc key to stop program running
« 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
Re: Mach4, Esc key to stop program running
« Reply #1 on: June 02, 2019, 05:13:47 PM »
Hi,
yes that can be done.

Daz's video shows the workaround:

https://www.machsupport.com/forum/index.php?topic=31585.0

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: Mach4, Esc key to stop program running
« Reply #2 on: June 09, 2019, 04:27:44 PM »
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
Re: Mach4, Esc key to stop program running
« Reply #3 on: June 10, 2019, 03:16:41 AM »
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

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'