I am rewriting my waste treatment control program because I have come up with a whole new way to run the process. However there are lots of pumps and valves that need to operate in completely different ways for each mode. This started getting very difficult to understand.
So I have broken it up into COMmon programs that get shared by all modes, OFFline programs, CONTinuous programs, CLEANing programs, and SBMR programs. My plan is to activate all the COM programs except in an E-stop, and the others if not in E-stop when I am in one of the four modes.
There is a master Mode program for each mode. What is the best way to turn on and off all the subprograms? Currently I have run and halt rungs in the Main program that moves me between the 4 modes. I see also that run is modal, and stays on unless specifically halted. Do it the same way in Main? Do it in the master Mode program?
Thanks,