Traffic light driven by one status number | Runtime Script | WinCC Unified

Free

Made with the HMIx AI Generator

This resource was created with AI on ai.hmix.tech. Describe what you need and generate your own HMI controls in minutes — free.

WinCC Unified Runtime Script

A Scheduler task watches one status tag and switches on exactly one of three lights: 1 green, 2 yellow, 3 red. Three small property scripts colour the circles on the screen from the task's tags.

What it is for

  • Show the state of a machine (running, warning, fault) with one light on the overview screen.
  • Show the phase of a PLC sequence as a traffic light.
  • Show a tank level class as green, yellow or red.

An example

A filling line sends a status number from the PLC: 1 when running, 2 when a bottle jam is warned, 3 when stopped. The task sets the matching internal tag. The three circles on the line screen then show green, yellow or red.

What starts it and where it goes

Every time the value of the status tag changes.

In the Update event of a Scheduler task with the Tags trigger on the status tag, plus a BackColor property script on each circle.

How it works

  • Status numbers of each light. Sets which number switches on each light: 1 green, 2 yellow, 3 red.
  • Read the current status. Reads the number in the status tag without ever writing it.
  • Switch on only the matching light. Writes three internal tags so only the one for the received number is on.

Values you adapt

  • Green status: Status number that switches on the green light. (in the script: 1)
  • Yellow status: Status number that switches on the yellow light. (in the script: 2)
  • Red status: Status number that switches on the red light. (in the script: 3)

Requirements

Written for WinCC Unified V19, on a Unified PC.

  • Tag.Read: In Siemens' V16 manual
  • Tag.Write: In Siemens' V16 manual

Before you use it

  • Create three internal Bool HMI tags for the lights and dynamize the BackColor of each circle with its property script.

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.

Keywords: traffic light, status, Scheduler, tag trigger, BackColor, indicator, HMI tag.

⚠️ 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.

Share this item:
Version:v1
Last Update:Dec 3, 2026
Published:Dec 3, 2026
Layout:SIEMENS - SIMATIC

Product Reviews (0)

Question and Answers (0)

You may also like

Free