How to spawn a nested process and one once?

Describe your system and processes, and post your config file.
Post Reply
BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

How to spawn a nested process and one once?

Post by BrunDog » Mon Dec 14, 2015 7:59 pm

I have a programming process issue I would like help with... I have an automatic cleaning cycle programmed to run in two processes. The first process is a rinse cycle, where my kettles are filled with water, recirculated, then dumped. The second process is a clean cycle, where the kettles are also filled and recirculated, but a pause (so I can add PBW) and heat is added.

I want to run the first process a few times, then run the second process once, then run the first process a few times again. I know I can use a continuing timer limits to exit the first process and start the next one, then start the first process once the second one ends, but how to I prevent the second process from running again? I have thought about using a register and ladder but not sure how to latch things there.

Any advice or direction would be appreciated!

-BD

User avatar
JonW
Site Admin
Posts: 1566
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: How to spawn a nested process and one once?

Post by JonW » Tue Dec 15, 2015 10:20 am

How many states are you using in these two processes? I have a few different ideas on ways to accomplish what you need.

User avatar
oakbarn
Posts: 738
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: How to spawn a nested process and one once?

Post by oakbarn » Tue Dec 15, 2015 11:36 am

If you had enough states, you have have the fill, dump, fill & Pause, Heat, Dump on First Cycle Start Clean and have the Second Process to Final Rinse. Sort of hard to say without your States and Order.

BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

Re: How to spawn a nested process and one once?

Post by BrunDog » Tue Dec 15, 2015 9:51 pm

Both processes are using all the available states. For rinse, it is: Prep, pre-fill, fill, level, rinse, rinse chillers, dump, dump&clean. For clean, it is: Prep, pre-fill, fill, level, rinse&heat, rinse chillers, pause, dump. If you want to know what these mean, they are: prep=get valves in correct position to receive inflow water, pre-fill = add water briefly before turning pumps on so they are not cycled dry, fill = add water and run pumps, level = a period where the water is allowed to balance between both kettles as one may take on more water during the fill, rinse = run the water through the sprayers by running the pumps, rinse chillers = same but water is routed through primary and secondary chillers, dump = open the dump valve and pump it all out, dump&clean = same.

During the rinse process, each state moves to the next sequentially. On the dump state, there are two exits: the state timer and the process timer. If the state timer elapses, it will go back to the first state in the process, which basically creates the loop. If the process timer elapses, the next state (dump&clean) is started, where the dump is completed, this process terminates, and the clean process is started. The clean process is similar to the rinse process but there is a pause to let the PBW soak for a while, then the dump occurs and the process terminates and the rinse process is started again. The rinse process will then start this whole sequence again. What I don't want to happen is that the clean process starts again - I want everything to end following the second rinse cycle.

Make sense?

TIA,

BD

User avatar
JonW
Site Admin
Posts: 1566
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: How to spawn a nested process and one once?

Post by JonW » Wed Dec 16, 2015 11:22 am

Do you have another free process available? Since you're using all the states in both processes, it would probably be the cleanest by having a master cleaning process that spawns and controls the other two.

Another thought is to have the rinse process spawn the cleaning one and stop and then have the clean process re-spawn the rinse process - but not stop and just keep waiting at the last state. If you do this, then when the rinse process tries to spawn cleaning again, it won't do anything since it is already running and waiting at the last state.

BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

Re: How to spawn a nested process and one once?

Post by BrunDog » Thu Dec 17, 2015 9:57 pm

I have one process left. I could use that but hate to commit 3 processes to cleaning.

Your last idea makes the most sense. Just leave the last state waiting for input. Thanks!!

-BD

User avatar
oakbarn
Posts: 738
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: How to spawn a nested process and one once?

Post by oakbarn » Fri Dec 18, 2015 8:01 am

Using the backup/restore utility, you can have a backup of your normal brew day and one of the cleaning process. You can load a single process or all of them. I have a corney keg process that I use after I have accumulated enough soaking kegs where I cycle warm PBW through them through the Gas In and Beer out as well as a spray inside an upside down keg. I do one keg at a time and use an endless loop. I do not need that process very often so I keep it as a back up and restore on the day I need it.

We also have a stable of "standard" beers that we regularly brew :D . I have a backup of those beers (and in some cases more than one depending on how big a batch we do), and just reload the backup that has all our Volumes, Times, Hops, Temperatures all set for the brew day. I personally find this easier than the recipe utility as I repeat beers and am not making that many "new" ones that are "one offs".

By doing this, I do not worry about losing "data". In fact, I had a BCS glitch (thunder storm) where it basically lost evrything including its firmware IP. I replace the BCS with my spare (soon to be dedicated to Fermentation) and reloaded one of our backed up Processes and was ready to go.

BTW, a 15 second Reset restored the glitched BCS. I was just about to send it back for Brewers Hardware to reflash when I decided to try a 15 second reset. It worked!

Also, because the Green Terminals on the side of the BCS are removable, it was easy to change out the BCS with wiring in place and I only had to restore one Temp Probe wire that had come loose from the terminal.

BrunDog
Posts: 96
Joined: Wed Mar 25, 2015 6:56 am
Bot?: No

Re: How to spawn a nested process and one once?

Post by BrunDog » Sat Dec 19, 2015 4:47 pm

Great points oakbarn!!

-BD

Timbrew
Posts: 26
Joined: Sat Jun 29, 2013 2:40 pm
Bot?: No
Location: Kent, UK

Re: How to spawn a nested process and one once?

Post by Timbrew » Sun Dec 20, 2015 1:15 am

Agree. I've been using the back up and restore utility constantly and faultlessly for a variety of 'recipes' I've been developing to commission my BCS-based system. It's very cool and gives you limitless scope for design. Problem is the Recipe Utility variables/input tab doesn't work across backed up 'recipes' that have distinct sets of processes and states. This means you have to input variables such as times and temp manually into the BCS process editor. It would be great each backed up 'recipe' would also back up its respective variables (oh, and with decimal points allowed especially for Celcius users ;) ).

User avatar
oakbarn
Posts: 738
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: How to spawn a nested process and one once?

Post by oakbarn » Sun Dec 20, 2015 7:40 am

I do not use the variables. I just set up my process for my specific brew and batch size and then save it. I have an MS Access program that I use in conjuction to track my beers and do some HBU calculations based upon the AAU of my Hops, but all the Volumes, Strike, Times, Temperatures and Exits are set and hard coded. For example:


I have 3 backed up processes for my TGS brew:

32 Gal All Grain TGS

27 Gall All Grain TGS

22 Gal All Grain TGS

Almost everything is the same except for a Strike Temp and some Timers I use to fill my vessels. I am moving to float valves so in the end, about the only thing I would change in different batch sizes is the strike Temp.



I just load the BCS with the right backed up JSON file and am ready to brew.

I guess it would be OK to have varibles for volumes and Strike Temps and times for my filler valves, but it is just as easy to modify my 32 Gal All Grain TGS to the 27 Gal All Grain TGS figures and save it.

I can see how variables such as Strike Temp, Mash Temp, Hop Times, Filler Valve Times (if using time to fill vs a float switch) if I was making "one offs" all the time, but it still might be just as easy to edit a generic process with the Process Editor instead of the Recipe Utility.

My poor brain required me to go back to the Process Editor and look at where the "variables" would go anyway, so I was setting up the variable, returning to the Process Editor, and then going back to the Utility, Repeat in an endless loop!

I find it also musch easier to use the Process Editor as I know "who is on first". I do not have the same confidence when I am part of the equation.

Of course, I am only using one BCS for the Hot side and not for fermentation. But even if I was using a couple of Processes for fermentation, I could individually load just my "Heat Strike" Process for different batch sizes as that is the only Process where the variables would be anyway. At most , I would be loading 3 processes for different brews. Since I only use this BCS for a Brew Day, just easier to load the whole JSON backup.

And the BCS Process Editor will take decimals in Celcius.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest