Whether we are manufacturing beverages, wood panels, chemicals, pharmaceutical or any other product in industry, one common feature they all share, is they are created with consistency by using recipes.

Every product contains a list of ingredients that needs to be precise, day after day and shift after shift, to deliver consistent products to customers every single day.

Today I'll walk through creating a recipe for a Siemens Basic Panel HMI in TIA Portal  to be used with a Siemens S7-1200.

In my example I'm going to have a little fun and recipes of life’s priorities – one for a balanced life and another for an overworked life.

PLC Setup – S7-1200 programming

The first thing I did was to add a data block to my S7-1200 with tags for each of my recipe ingredients. Ingredients are all “REAL” data type and are designed to be entered in minutes of a day spent on each task.

My next task was to add a simple (cyclic interrupt) ladder program for my recipe. Here I add all the ingredients together except for one.

I then subtract all the ingredients that were added together from the total minutes in a day (1440) and I am left with the last ingredient, “SLEEP”

HMI Setup – Basic Panel HMI Project Configuration

I can now switch over and configure the HMI portion of the project. The first thing I did was to create a graphic screen called “Recipe Load”.

The next thing I did is to create a recipe, which I call “Recipe_Test”.  My recipe (shown below) contains all the elements that are in the recipe connected to the corresponding “Tag” in the plc.

On my graphic screen, I need to add a “Recipe view” which is located in the “Controls” toolbox on the right side of the TIA Portal pane. I had to do zero configuration to this Recipe view tool, simply add it to the display.

Next, I added the tags from my S7-1200 data block. This will be the “Loaded” tags in my program. The tag shown here is “PROD_RECIPE_EAT” which is the loaded recipe time spent eating each day.

I then compile and download my project. Again, the HMI simulation tool is wonderful to use here, to test and get the project correct, before downloading to the Basic HMI Panel. This saves a lot of time.

Runtime

At runtime, I can now create New Data Records of my Recipe. Simply select the Recipe and then use the four buttons in the bottom left corner of the Recipe view to: Create a New Data Record, Save the Data Record, Delete the Data Record or Rename the Data Record. In this display, I created a Data Record called “Balanced” and scrolled through each of my recipe elements and added values for how much time to spend on each element (ingredient).

Note the two buttons on the bottom right of the Recipe view – they are to download to the PLC and Upload from the PLC. Here, I have downloaded my “Balanced” data record to the PLC. This life recipe gives time to multiple aspects of an individual’s life and provides a good nights’ rest at the end of the day.

Here, I have created Data Record #2 and called it “Overworked”. I scrolled through each element and modified the recipe so that the life recipe is out of balance, with too much time spent on work, not enough on self-care or family time and at the end of the day, gets little rest. I wouldn’t recommend using Data Record #2. I also downloaded this Data Record to the PLC as shown below.

Here, I take one look back at my S7-1200 PLC program with the “Balanced” data record loaded and see the calculations working.

Conclusion

I was honestly very pleased and impressed with how easy it was to configure and manipulate recipes in TIA Portal.

I hope this project helps you with your first recipe handling project in TIA portal, and I encourage you to keep the “Balanced” recipe loaded in your life instead of the “Overworked” one.

Written by Brandon Cooper
Senior Controls Engineer and Freelance Writer

Have a question or comment on this article? Join our community to take part in the discussion! You'll also find all of our courses at TheAutomationSchool.com.