← Engineering notes

Stop clicking: bind 54 HMI properties with one WinCC Unified loop

WinCC UnifiedScriptingHMI

Nine objects on a screen, six tags each. Would you rather click 54 times in the property panel — or write a few lines of JavaScript?

WinCC Unified ships with a real JavaScript runtime, and Screen.FindItem is the hook that makes repeated widgets manageable:

for (var p = 1; p <= 9; p++) {
    var climate = Screen.FindItem("Climate Zone_" + p);
    climate.Properties.HumPV      = num100("Zone_H_PV_" + p);
    climate.Properties.HumSP      = num100("Zone_H_SP_" + p);
    climate.Properties.TempPV     = num100("Zone_T_PV_" + p);
    climate.Properties.TempSP     = num100("Zone_T_SP_" + p);
    climate.Properties.HumOutput  = ("Zone_H_OP_" + p);
    climate.Properties.TempOutput = ("Zone_T_OP_" + p);
}

Name your objects in a pattern

Climate Zone_1 through Climate Zone_9. The PLC tags follow the same numbering — Zone_H_PV_1 through Zone_H_PV_9. Now the index is the only thing that varies between iterations.

Screen.FindItem is the hook

It returns the on-screen object by its display name. Whatever you can reach in the editor’s property panel, you can reach from script. Faceplates, gauges, trends, pie charts — same pattern.

One source of truth

Add zone 10? Bump the loop to 10. Rename a tag prefix? One string edit. Try doing that across 54 manually-bound fields without missing one.

The same trick scales across the screen

The same screen uses it for Press Trend_1..3, Pie Chart_1..3, Bar Chart_1..3 and txt_1..9. The script grows with property count, not widget count.

When a screen has more than about three copies of the same thing, stop clicking and start looping. WinCC Unified gives you a real JavaScript runtime — use it.

Need this on your plant?

Everything in these notes is a thing we build for clients — describe your problem and we'll quote it straight.

Request a quote