Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: KatzYaakov on August 29, 2021, 08:35:02 PM

Title: shut down output while close mach PMC
Post by: KatzYaakov on August 29, 2021, 08:35:02 PM
i have several output i control them by PMC(its mean i force directly not need by define as Mach output,i use pokeys)
now when i shut down mach i want this output will turn off
how can i do that?
is there option by PMC
or only with "screen unload" script?
Title: Re: shut down output while close mach PMC
Post by: smurph on August 29, 2021, 11:03:10 PM
I think the unload script is the only place where that could be done.  One could make a PMC object that does just what you want and then that PMC object could be called from the screen unload script. 

example using myPmcObj object and calling it from the screen unload script. 

Code: [Select]
machDir, rc = mc.mcCntlGetMachDir(inst)
myPmcObj = require(machDir .. "/myPmcObj.lua")
myPmcObj.PlcCycle() -- this will cycle that PmcObject one time. :) 

I will see if I can add something in that can run PMC objects on startup and shutdown without having to add code. 

Steve