Not sure what you are trying to get at but I have done many recipe systems in processes i.e. batching systems like sauces, spreads, soups etc.
Assuming your HMI has recipe capabilities then the following is one way.
Assume the recipe is loaded from the HMI into a Data block consider how you want the recipe to work i.e. try to keep all fields the same and flexible.
example:
The Recipe data block say contains up to 16 possible stages (does not matter how many as long as the stages & variables do not exceed the DB length not such a problem on Siemens).
Example:
Each stage is the same for example requires x number of variables
Recipe Header:
Description of Recipe: String
Number of stages: Word // The number of stages
Stage:
Type of Operation: Word (0-4) // this is the type of addition i.e. 0 = No Addition
1 = Water, 2 = Powder, 3 = Milk // the type of product add a value for each
Description: string // perhaps 32 chars i.e. "Onions diced 10mm"
Weight: Float // this is the required weight.
In-Flight: Float // This is the in-flight weight to allow the valve or pump to stop or even change from full to trickle speed.
Limits: Float //This is say some kind of alarm limit on the addition.
Mixer Required: word (0/1) Is the mixer motor required.
Mix Time: Word // Mix time in seconds
Heat Required: Word (0/1) // Heating i.e. heat to set point.
Temperature: Float // Temperature to heat to.
Temperature Hold Time: Word // Hold heating hold time.
Also to allow for different batch sizes it is common to base the additions on a 100kg recipe, in the logic it will ask operator to enter the batch size & compute the required quantity i.e. if a batch size of 500kg is required then it will take the stage value for example 50kg (per 100kg batch) so the actual will be 250kg.
The way it could work is :
The operator selects the recipe.
Enters the batch size.
Starts the process,
It loads the first stage, checks the stage type, calls the stage logic i.e. onion, starch, oil, water or what ever, calculates the required values etc.
At the end, it then loads the next stage until current stage = number of stages.
This way instead of a rigid recipe structure it can cater for adding additional stages as all stages are common, most probably would only use 5 or 6 stages but allows for others. The idea of having a stage type means you only need logic for the type of addition a good example is a manual addition so for example on stage 1 it may be tomato puree, on stage 3 it could be spices it runs the same sequence i.e. the operator opens the lid, adds the ingredients, mixes & heats but it only requires the same logic for manual addition just calls that block each time.
This becomes flexible as it means the sequence is recipe controlled and if it is decided that where ingredients are added in a particular sequence that could change for example milk before starch or starch before milk there are no code changes purely recipe driven.
Here is a snapshot of a stage of a typical recipe note there are a number of ingredients & their descriptions this is because up to 6 ingredients can be added at the same time but in general it is only one i.e. water or oil etc.
Cannot show actual data as this will not run on this PC.