Dear Forum Members,
I need to calculate the mass of each ingredient used for the production of a recipe from the production steps.
A recipe has up to 12 production steps.
Below is an example of a recipe:
Step 1: Dosage of Flour, Value: 200kg
Step 2: Dosage of Salt, Value: 5kg
Step 3: Mixing, Value: 30s
Step 4: Dosage of Sugar, Value: 20kg
Step 5: Mixing, Value: 30s
Step 6: Dosage of sugar, Value: 10kg
Step 7: Mixing, Value: 30s
Step 8: Dosage of chocolate, Value: 100kg
Step 9: Mixing, Value: 30s
Step 10: Dosage of sugar, Value: 5kgStep 11: Mixing, Value: 2min
So the ingredients of the recipe are:
I create a PI AF Attribute for each Step:
Each step attribute has a 'Value' child attribute
From these steps, I need to calculate the mass of each ingredient with PI-Analysis.
The results will be copy to the "Ingredients" PI AF attributes. Each attribute is mapped to a PI Point.
I don't know how to do this.
I've thought to create a variable analysis for each ingredient and to calculate the mass like below:
I don't know which expression I could write to calculate the sum of each ingredient.
Can I use a loop FOR from 1 to 12 for iterating each step ?
How could I calculate the mass of each ingredient of the recipe ?