Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: Vandabrackin on December 05, 2016, 12:16:27 PM

Title: Mist (M07) stays on if the program is stopped
Post by: Vandabrackin on December 05, 2016, 12:16:27 PM
It is not a big deal to go into the run ops tab and turn it off after the stop button is pushed, but it does get annoying. Mach 3 did not do this and i know of several others who are bugged by this feature. Is there any way i can make the mist turn off with the stop button?
Title: Re: Mist (M07) stays on if the program is stopped
Post by: Chaoticone on December 05, 2016, 01:36:07 PM
Editing your Cycle Stop function in the screen load script to look like this might work.

Code: [Select]
---------------------------------------------------------------
-- Cycle Stop function.
---------------------------------------------------------------
function CycleStop()
    local hSig = mc.mcSignalGetHandle(inst, mc.OSIG_MISTON); --Get the mist on signal handle
    mc.mcSignalSetState(hSig, false); --Turn the mist on signal off
    mc.mcCntlCycleStop(inst);
    mc.mcSpindleSetDirection(inst, 0);
    mc.mcCntlSetLastError("Cycle Stopped");
end
Title: Re: Mist (M07) stays on if the program is stopped
Post by: Vandabrackin on December 05, 2016, 04:05:30 PM
worked perfect, Thanks
Title: Re: Mist (M07) stays on if the program is stopped
Post by: Chaoticone on December 05, 2016, 04:42:04 PM
 :)

Just remember, now your screen is custom and you are not using the default. You need to save the screen as something unique if you haven't already so when you update your custom tweak doesn't get overwritten.