Hello Guest it is April 18, 2024, 08:55:15 PM

Author Topic: shut down output while close mach PMC  (Read 428 times)

0 Members and 1 Guest are viewing this topic.

shut down output while close mach PMC
« 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?

Offline smurph

*
  • *
  •  1,546 1,546
  • "That there... that's an RV."
    • View Profile
Re: shut down output while close mach PMC
« Reply #1 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