A recipe is a set of elements, each linked to a PLC tag, with one data record per product. Configure elements and records under Recipes, then transfer a record to the PLC with a handshake so the controller validates and accepts the values deliberately. Never allow a recipe download while a cycle is running.
- One recipe definition, many data records; adding a product should be a record, not a program change.
- Transfer with a handshake and validation, because an out-of-range parameter is worse than no parameter.
- Store records on the panel media and back them up; they are not inside the TIA Portal project.
Recipes, Elements and Data Records
Three terms, and mixing them up causes most of the confusion.
- Recipe: the definition. It says which parameters exist, for example mix time, temperature setpoint, fill volume, speed.
- Recipe element: one parameter inside that definition, linked to a PLC tag and carrying its own data type and limits.
- Data record: one set of values for those elements. Product A is a record, Product B is another.
Designed properly, a new product is a new data record entered by a production engineer. Designed badly, a new product is a PLC modification, a download and a shutdown.
| Element | PLC tag | Type | Range |
|---|---|---|---|
| Mix time | Recipe.MixTime | INT seconds | 30 to 600 |
| Temperature setpoint | Recipe.TempSP | REAL | 20.0 to 95.0 |
| Fill volume | Recipe.FillVolume | REAL litres | 5.0 to 200.0 |
| Mixer speed | Recipe.MixerRPM | INT | 50 to 1500 |
| Product code | Recipe.ProductID | STRING | Fixed list |
Configuring a Recipe in TIA Portal
Open Recipes under the HMI device and work through the two tabs.
- Elements: add one row per parameter with a name, the connected PLC tag, the data type and the display format. Set the upper and lower limits here so the panel refuses a bad entry at source.
- Data records: add one row per product and fill in the values. Keep the record name meaningful, because this is what the operator selects.
Point every element at a tag inside a dedicated recipe data block in the PLC, not at scattered tags across the program. One structure keeps the transfer simple and the validation in one place.
Recipe settings
| Setting | Effect |
|---|---|
| Synchronise with PLC | Keeps the recipe view and PLC tags aligned during editing |
| Update tags | Writes values to the PLC as they change in the recipe view |
| Data record path | Where records are stored, normally the SD card or USB |
| Number of data records | Storage limit; size it for the product range plus growth |
Be careful with Update tags. Combined with Synchronise, it can write values to a running machine while an operator is browsing recipes, which is exactly what a handshake exists to prevent.
Transfer, Handshake and Validation
The safe pattern separates the panel's copy of the values from the ones the machine is using.
- The operator selects a data record and presses Load, writing the values into a request area in the PLC.
- The panel sets a transfer request bit.
- The PLC checks the machine is idle and not mid-cycle.
- The PLC validates every parameter against its allowed range.
- If everything passes, the PLC copies the request area into the active recipe area and sets an accepted bit.
- If anything fails, it sets a rejected bit with a reason code and leaves the active values untouched.
The panel then shows the active values in read-only fields, so the operator can confirm what the machine is actually running rather than what was selected.
Why the PLC validates again
The panel already has limits on each element, but a SCADA station, a second panel or an engineering laptop can write the same data block. The PLC is the only place that sees every source, so it must repeat the check. The same principle applies to individual setpoints in HMI I/O fields and setpoint entry.
Build a full recipe system in class
Siemens sessions covering recipe elements, records, transfer handshakes and batch reporting.
Operator Screens, Storage and Backup
Add a recipe view to a dedicated screen. Configure it as a simple view for panels with small displays, or the full view where the operator needs to see all elements at once.
- Show the selected record name and the active record name side by side.
- Protect Save, Delete and Load with a user authorisation so operators cannot edit recipes accidentally.
- Display the reject reason in plain text when a transfer is refused.
- Log every successful transfer with the record name, time and user, which gives you batch traceability for free.
Storage and backup
Data records live on the panel storage medium, not inside the TIA Portal project. Restoring the project onto a replacement panel therefore restores the recipe definition but none of the records.
Back up the records to a USB stick or network path, and test the restore. This is part of the panel handover described in HMI user administration and runtime settings. Sites with more than a few dozen products usually move recipe storage into SQL Server on a SCADA station instead, which also gives central editing and version history.
Hands-On Lab: Build a Recipe with a Validated Transfer
Hands-on- TIA Portal with WinCC Comfort and a panel or simulation
- A PLC recipe data block with request and active areas
- Simulation only, no live batch
- Estimated time: 45 minutes
Create the recipe elements
Add four elements linked to the request area tags, with data types and limits.
Add three data records
Create records for three products with realistic values.
Build the transfer handshake
Add a Load button that writes the record and sets a transfer request bit.
Validate in the PLC
Write logic that checks idle state and parameter ranges, then copies request to active and sets accepted or rejected.
Display and protect
Show the active values in read-only fields and protect Save and Delete with an authorisation.
Recipes transfer only when the machine is idle and every parameter is in range, the operator can see the active values, and a rejected transfer explains itself.
Frequently asked questions
What is the difference between a recipe and a data record?
The recipe is the definition of which parameters exist and which PLC tags they map to. A data record is one set of values for those parameters, normally one per product.
Where are recipe data records stored?
On the panel storage medium such as the SD card or USB stick, not inside the TIA Portal project. They must be backed up separately.
Why should the PLC validate recipe values again?
Because the data block can also be written by SCADA, a second panel or an engineering laptop. Only the PLC sees every source, so only the PLC can guarantee the range check.
Can a recipe be downloaded while the machine is running?
It should not be. The PLC should check that no cycle is active before accepting a transfer, otherwise parameters change mid-batch and the product is out of specification.
