How-to
Change the HMI screen from the PLC in WinCC Unified
Short answer
In WinCC Unified the Job Mailbox is gone. Give each target screen a screen number, link an HMI tag to the PLC integer command tag, and call ChangeScreenWithNumber from a value-change event on an object in a persistent base screen. Never call the UI system functions from a scheduled task or global module — those scopes have no UI context and raise "UI not supported in current scope".
On this page
WinCC Unified removed the Job Mailbox, so the controller can no longer post a screen-change job the way it did on a classic panel. The replacement is built from ordinary parts: an integer command tag written by the PLC, a screen number configured on each target screen, and the change-screen-by-number system function fired from a value-change event on an object that stays on display. Placement decides whether it works. The event must sit on a persistent base or header screen — a scheduled task or a global module has no interface of its own, and runtime answers with "UI not supported in current scope". This article sets up the numbered navigation that replaces the mailbox, adds the script variant for name-based projects, and gives the reset handshake that keeps repeat commands working.
What replaced the Job Mailbox #
On a classic panel, the controller wrote a job number into a fixed interface area and the panel executed the matching action, screen selection included. The Unified generation — Unified Basic, Unified Comfort panels, Unified PC Runtime — has no mailbox to write to. Siemens documents the replacement in the Modernization How-Tos and in support entry 109794243. The method is a chain of three ordinary pieces instead of one address: an HMI tag connected to the PLC command variable, a screen number stored in each screen's properties, and a screen-level event that executes the change. If you are keeping classic machines alive, Job Mailbox screen-change setup for a classic KTP700 panel shows the interface Unified retires, and the WinCC Flexible way to change screens from the PLC covers that earlier generation.
Command tag and screen numbers #
Use one integer tag as the navigation command and keep 0 as the idle value; this article uses the name PLC_Screen_Switch for it. Create the matching HMI tag in the Unified project, connect it to the PLC variable, and check that the data type covers every value you plan to configure: a five-screen scheme needs values 0 through 5, and even an 8-bit unsigned tag holds 0 through 255, so range is never the constraint — uniqueness is.
Open each target screen and enter its number in the screen properties, Miscellaneous group, "Screen number" field. Three rules keep the mapping unambiguous:
- Every screen in the scheme carries a unique number; a duplicate makes one command value point at two destinations.
- A number with no screen behind it is an invalid command the controller must never send.
- 0 stays unassigned; it means "no request".
The controller writes the screen number itself, with no scaling and no offset: command value 3 opens the screen whose "Screen number" entry is 3. LS formalizes the same idea on its side as the LS system-area screen change register; in Unified you build the register yourself from a tag. The example scheme for a small machine:
| Command value written by the PLC | Screen that opens |
|---|---|
| 0 | none (idle) |
| 1 | Plant overview |
| 2 | Automatic mode |
| 3 | Manual mode |
| 4 | Alarm list |
| 5 | Batch setup |
Build the change, step by step #
- Create the integer command tag in the controller program with initial value 0.
- Create the HMI tag in the Unified project and connect it to that variable.
- Set a unique "Screen number" on every target screen in the Miscellaneous group of the screen properties; leave 0 unassigned.
- Place an I/O field on a base or header screen that is on display at all times, connect it to the HMI tag, and size it so it does not disturb the picture.
- In that field's event list, select the value-change event of the tag and add the screen-change system function from the function list. The documented entry is ChangeScreenWithNumber with the parameters "screen number" and "screen window path": wire the tag value to the first and the content screen window of your layout to the second. Keep the call as the last function in the list, as the function documentation requires. Community posts often write the name as ChangeScreenByNumber — identify the entry by its parameter pair.
- Load the project and start runtime with the base screen shown.
- Test from the controller side: write 3 and watch the screen numbered 3 appear, write 0, write 3 again and watch it reappear. Both transitions must fire.
- Replace the test writes with the request-and-reset handshake below.
Script variant for name-based navigation #
Numbered navigation keeps the mapping inside the screens. If you would rather see the mapping in code — command value 2 always means the automatic-mode screen, even after screens are renamed or reordered — put the script in the same field's value-change event:
// Value-change script on the command tag, on the I/O field
// that lives on the persistent base screen.
// "value" is the new value of the tag.
switch (value) {
case 2:
HMIRuntime.UI.SysFct.ChangeScreen("Automatic mode");
break;
case 3:
HMIRuntime.UI.SysFct.ChangeScreen("Manual mode");
break;
default:
// 0 is idle; send any other unexpected value to diagnostics
break;
}
HMIRuntime.UI.SysFct is the entry point for system functions from a screen script, and the editor offers the change-screen action under snippets > HMI runtime > screen > change base screen, which drops a ready call into the case you have open. ChangeScreen takes the configured screen name, so match the spelling exactly; check your version's script reference for the signature, because some versions take a screen window as a second argument. Screen-level context is what gives the script access to the UI — the same rule the next section explains.
Why a scheduled task or global module fails #
The failure pattern is exact: the PLC tag changes on schedule, the script runs, and runtime reports "UI not supported in current scope". The cause is scope. HMIRuntime.UI.SysFct is accessible only in screen context; scheduled tasks and global modules execute outside the UI rendering context, with no displayed screen behind the call. Reading tags cyclically in a scheduled task is fine — changing screens from there is not.
Moving the call into a global module changes nothing, because a module inherits the caller's scope and the caller is still background logic. The fix is to hang the event on an object inside a screen that is on display: the persistent base or header screen from step 4. A runtime can serve more than one client, and background code has no single interface to act on, so navigation belongs to the active client. Treat the PLC value as a request that the displayed screen executes.
Handshake: request, accept, reset #
A value-change event fires on a transition, not on a level, so the controller writes the destination once per request and then returns the tag to idle. On the example scheme: the plant wants Manual mode, the PLC writes 3, the event fires and screen 3 opens. The PLC then writes 0; nothing visible happens, because 0 has no screen. An hour later the plant wants Manual mode again and the PLC writes 3 — the tag has travelled 3 to 0 to 3, so the transition fires and the screen reopens. Skip the reset and the second write of 3 is no transition at all; the command looks dead.
Keep the navigation command separate from operating-mode and status variables. A cyclically reasserted "auto mode" level would drag the operator back to the automatic-mode screen on every scan, while a command tag carries a one-shot request. A single Bool works when there is exactly one destination — its own change event calls one fixed screen — but a bit cannot name a destination, so anything beyond one screen wants the integer command. One boundary: navigation is operator guidance, never a safety function — E-stop and interlock response stays in the controller's safety program, not in screen logic.
When the screen still does not change #
- The HMI tag never changes: monitor the PLC variable and the HMI tag side by side before touching navigation. If the tag stopped following after a network change, work through HMI comms errors after a PLC IP address change.
- The tag changes and runtime reports the UI-scope error: the event is running in background scope. Move it onto the persistent screen object.
- The tag changes, no error, no switch: the object carrying the event is not on the displayed screen — it sat on a content screen that was replaced — or the command value was already at the destination, so no transition occurred. The persistent base screen and the idle reset each fix one of those two causes.
- The wrong screen opens: the command value does not match the configured screen number, two screens share a number, or the "screen window path" parameter points at the wrong window.
- One command works, later ones do not: the controller never returned the tag to 0, so the next identical write fires no event. Restore the reset.
Run the event from the persistent screen, wire the change-screen-by-number function to the command tag and the content window, and reset the command to idle after every request. The controller then asks once, the displayed client executes, and PLC-driven navigation behaves like the mailbox it replaced.
Questions asked
Is the Job Mailbox still available anywhere in WinCC Unified?
No. The mailbox interface was removed in the Unified generation, including Unified Basic and Unified Comfort panels, so a migrated project has to carry screen commands in a normal integer tag. Panels still running the classic operating image keep the old Job Mailbox behavior; the Unified runtime does not.
What data type should the screen command tag be?
Any integer type the controller and the HMI tag both support, and the range is comfortable: an 8-bit unsigned tag covers 0 through 255 and a 16-bit unsigned covers 0 through 65,535, while a real panel project needs single-digit values. Range never constrains the scheme; unique screen numbers and the idle reset decide whether it works.
Can a single PLC bit change the screen?
Yes, for exactly one destination. Connect a Bool HMI tag to the bit and call the screen change from its value-change event with the one fixed screen name. A bit cannot carry a destination, so as soon as the controller must request a second screen, move to an integer command tag with numbered screens.
Does the same setup work on Unified PC Runtime and on a Unified panel?
The mechanism belongs to the Unified runtime rather than to one panel model, so the command tag, the screen numbers and the screen-level event carry over between panel and PC targets. Confirm the ChangeScreenWithNumber entry and its parameters in the function list of the TIA Portal version you are engineering in, because function lists are version specific.
Where does Siemens document this screen-change method?
In support entry 109794243, and in the Modernization How-Tos, where screen selection is the chapter numbered 51 — the chapter number of the document, not a Job Mailbox job number. Both sources describe the same tag-plus-screen-number method this article implements.