Hello Guest it is December 11, 2019, 06:40:08 AM

Author Topic: Mach4 M8 and M62 is not disabled when program is stopped  (Read 199 times)

0 Members and 1 Guest are viewing this topic.

Mach4 M8 and M62 is not disabled when program is stopped
« on: February 14, 2019, 12:43:14 PM »
I'd like to use mach4 to control a laser, using M62/M63 However, if I have to stop the program by the stop button, or even by the emergency stop button, the output does not stop. Is this a bug in mach4 (build 3804)?
I thought I could rather use M8/M9 to control the output, however, I get the same problem here also. The output stays open even if I hit the emergency stop button. Controller is a CSMIO IP-M.
Re: Mach4 M8 and M62 is not disabled when program is stopped
« Reply #1 on: February 14, 2019, 06:39:22 PM »
Tried another version, and tried without the controller. So it looks like it's not supported in the screen set (wx4). I am able to add the g-code in a script for each button, or in the function in the screen load script using, for example, mc.mcCntlMdiExecute(inst, "M9"). However, I find it very strange that such a thing isn't included by default. Especially for the M62 M63 scripts that are designed to control lasers. If you hit the e-stop, feed hold, cycle stop, reset or disable button the laser should switch off without every user having to figure out a way to implement it in the screen.
Re: Mach4 M8 and M62 is not disabled when program is stopped
« Reply #2 on: February 17, 2019, 10:51:51 AM »
jorgenbli,
If you want outputs to turn off with E Stop, Cycle Stop, Feedhold, or Reset, you have to add that functionality to the buttons/functions in the screen editor.   
I have several outputs that I want to turn off with Reset, E Stop, and Cycle Stop, so I have no issues with adding those to the screen script.
Everyone has different ideas of how machines are "supposed" to operate, the joy of Mach4 is that you can make it operate just the way you want it to.
Chad Byrd
Re: Mach4 M8 and M62 is not disabled when program is stopped
« Reply #3 on: February 17, 2019, 11:20:11 AM »
I'was able to add scripts to stop, reset and feed hold buttons. However, I couldn't find a way to add to the disable buttton and the e-stop routine. Any suggestions?
Re: Mach4 M8 and M62 is not disabled when program is stopped
« Reply #4 on: February 17, 2019, 11:51:14 AM »
You can put it in the Signal Library in the screen load script.

[mc.ISIG_EMERGENCY] = function(state)
    if (state == 1) then
       local inst = mc.mcGetInstance()
       local Output1 = mc.mcSignalGetHandle(inst, mc.OSIG_OUTPUT1)
       mc.mcSignalSetState(Output1, 0)
    end
end,
 
The same with disable, there is an Machine Enabled signal you can use.  Just check for the state to be 0 instead of 1.
Chad Byrd
Re: Mach4 M8 and M62 is not disabled when program is stopped
« Reply #5 on: February 17, 2019, 02:02:48 PM »
Awesome. Thank you!