Creato con il generatore IA di HMIx
Questa risorsa è stata creata con l'IA su ai.hmix.tech. Descrivi ciò che ti serve e genera i tuoi controlli HMI in pochi minuti — gratis.
WinCC Unified Runtime Script
When the button is pressed, it checks four setpoints against their allowed limits. If all are inside the limits, it writes them to the PLC in one go and reports the result in Recipe_Status.
Minimum version: WinCC Unified V16 and later.
What starts it and where it goes
When the operator taps the button Btn_ApplyRecipe.
In the event OnTapped of the object Btn_ApplyRecipe.
How it works
- Lists the recipe values and limits. Each row holds a setpoint tag, the value to send, and its lowest and highest allowed value. A constant makes the write wait for the PLC's answer.
- Stops if any value is out of range. If any value is outside its limits, nothing is written. The names of the bad tags go to the trace and to Recipe_Status.
- Puts all four values in one group. It collects the four setpoint tags into one group and gives each tag its recipe value.
- Sends the group and waits for the PLC. It writes the whole group in one call and waits for the PLC's answer without blocking the screen.
- Reports success when every tag was written. It collects the tags that report an error. If there are none, it traces the result and writes 'Recipe applied' to Recipe_Status.
- Reports the tags that failed. It traces each tag that failed with its error text. It then writes to Recipe_Status how many setpoints were not written.
- Reports a write that failed completely. If the whole write is rejected, it traces the error and writes 'Recipe not written' to Recipe_Status.
Values you adapt
- Speed setpoint tag: The HMI tag that receives the speed value. (in the script: Line1_SpeedSetpoint)
- Temperature setpoint tag: The HMI tag that receives the temperature value. (in the script: Line1_TempSetpoint)
- Pressure setpoint tag: The HMI tag that receives the pressure value. (in the script: Line1_PressureSetpoint)
- Batch size tag: The HMI tag that receives the batch size. (in the script: Line1_BatchSize)
- Status tag: The HMI tag that shows the result of the write to the operator. (in the script: Recipe_Status)
Minimum version
Minimum version: WinCC Unified V16. It runs on WinCC Unified V16 and every later version.
- Trace: From V16 (Siemens' V16 system manual)
- Tag.Write: From V16 (Siemens' V16 system manual)
- Tags.CreateTagSet: From V16 (Siemens' V16 system manual)
- TagSet.Item: From V16 (Siemens' V16 system manual)
- TagSet.WriteAsync: From V16 (Siemens' V16 system manual)
In the package
- The script, with a header that says where it goes and which values to adapt.
- Its documentation as PDF and as an editable ODT: purpose, example, the TIA Portal steps, the script part by part.
- A README with the same in one page.
⚠️ AI-Generated: This script was written with AI and checked against Siemens' documentation, not on a device. Test it on your own HMI before using it in production.
Condividi questa risorsa:
Versione:v2
Ultimo aggiornamento:4 dic 2026
Pubblicato:4 dic 2026
Layout:SIEMENS - SIMATIC
Tag:
Recensioni del prodotto (0)
Domande e risposte (0)
Potrebbe interessarti anche
Gratis