Kkula
Browse Questions » SIMATIC S7-1200: Preset inside Programmable logic controller & web server & 3rd party Human machine interface

About User

Questions Asked: 24.4K

Answers Given: 0

0
  • Open

SIMATIC S7-1200: Preset inside Programmable logic controller & web server & 3rd party Human machine interface

Hello,
I want to do universal solution for making some technological process. I want to have recipe, for example like this:




Recipe name



Sugar [kg]



Sirup [litres]





Cola



2



1





Pepsi



1



1





..



..



..



I want to have recipe inside PLC and i want watch(read) recipe, add new(write) recipe, delete bad recipe,see whole list of recipes from S7 1200 web server & 3rd party HMI. 3rd party HMI posibilities are read/write PLC tags (I,Q,M) and Program blocks ( User_data_type_1_Classic[DB1], User_data_type_1_Retain[DB1], User_data_type_1_Volatile[DB1] )
Some good idea?
Karel Fryd, Czech Republic

0 Likes 0 Favourites 0 Followers 0 Comments
Answers(1)

Recipe Management for S7-1200 with Web Server & 3rd Party HMI

Hello Karel,

For a universal recipe solution in your S7-1200 PLC, consider utilizing a structured data type to represent your recipes, stored within a Data Block (DB). Here’s a recommended approach:

1. Data Structure Definition (User Defined Data Type - UDT)

Define a UDT in TIA Portal that mirrors your recipe format (Recipe Name, Sugar [kg], Syrup [litres], Cola, Pepsi, etc.). Use appropriate data types for each ingredient (REAL for kg/litres, INT for quantities).

2. Recipe Storage (Data Block)

Create a DB (e.g., DB1) to store an array of your recipe UDT. The size of the array determines the maximum number of recipes you can store. Consider a 'RecipeCount' tag (INT) within the DB to track the number of valid recipes currently stored.

3. PLC Logic & Functionality

  • Read Recipe List: Create a function block to transfer the recipe array from the DB to a temporary buffer for efficient web server access.
  • Add Recipe: Implement logic to write a new recipe to the next available slot in the recipe array, incrementing 'RecipeCount'.
  • Delete Recipe: Logic to mark a recipe slot as invalid or overwrite with a default recipe, decrementing 'RecipeCount'.
  • Write Recipe: Logic to modify an existing recipe.

4. Web Server Integration

Utilize the S7-1200's built-in web server to create web pages for recipe viewing, adding, and deleting. You’ll need to map PLC tags (your 'RecipeCount' and the recipe array) to web HMI elements (tables, input fields, etc.).

5. 3rd Party HMI Integration

Leverage your HMI’s ability to read/write PLC tags and access DBs.

  • Read/Write Tags: Map key tags like 'RecipeCount' and individual ingredient values directly to HMI elements.
  • DB Access: Access the entire recipe DB (User_data_type_1_Classic[DB1] or similar) if your HMI supports direct DB access for structured data. This provides a more efficient way to read/write entire recipes.

Resources

This approach provides a flexible and scalable solution for managing recipes within your PLC. Remember to consider error handling and data validation within your PLC logic to ensure data integrity.

Best regards,
Siemens Self Support

0
Add a comment