How-to
Configure PLC Screen Changes by Tag Event or Job Mailbox in WinCC
Short answer
A controller changes a WinCC Advanced screen in two documented ways: a Boolean tag's Value change event running Activate screen by number on an integer tag, or a Job Mailbox area pointer where the first word of a four-word area carries constant 51 and the second word carries the screen number. In both, write the screen number first, then issue the request.
On this page
WinCC Advanced V13 SP1 gives a controller two documented ways to select an HMI screen. The first is a Value change event on a Boolean controller tag running the function Activate screen by number with an integer tag as its argument. The second is a Job Mailbox area pointer: a four-word PLC area where the first word carries the constant 51 and the second word carries the screen number. Both need one rule on the controller side: write the screen number first, then issue the request. Use the tag event for a plain screen change; use the job mailbox when the connection already carries area pointers or you want the whole request in one place. This is the TIA Portal equivalent of changing WinCC Flexible screens from the PLC, which covers the older engineering tool.
Prepare the screens and their numbers #
Every screen carries a reference number, and both methods depend on it being right. The number is a property, not the name and not the position in the project tree.
- Create the project and at least two screens. In the sample project these are
RootscreenandScreen_0: Project tree → HMI → Screens → Add new screen. - Open each destination screen's Properties → General → Number and record the value shown. Do not derive a number from a name; a screen called
Screen_0can carry any number the project assigned. - Open both screens manually in runtime and confirm each displays correctly. If manual navigation fails, fix the screen or runtime project before adding controller selection.
- Confirm the project targets the runtime or panel you will actually test. An engineering version opening the project does not prove the configured target executes every function; check the installed help for your target before proceeding.
Method one: the value-change event #
This method separates the destination from the request. An integer tag carries the screen number; a Boolean tag's change invokes the function.
- Create an integer PLC tag named
ScreenNumber, for example in the PLC tag table, and drag and drop it into the HMI. Under Properties → Settings, set Acquisition mode =Cyclic continuous. - Create a Boolean PLC tag named
Triggerthe same way and also set its Acquisition mode =Cyclic continuous. - Select
Triggerand go to Properties → Events → Value change. Assign the functionActivate screen by numberand set its ScreenNumber argument to the HMI tagScreenNumber, not to a fixed value. - In the PLC, write the desired screen's number to
ScreenNumber, then invertTrigger.
Cyclic continuous matters because the request can arrive while an unrelated screen is open. A tag acquired only when a screen uses it is unobserved when no object on the current screen needs it, and the event has nothing to react to.
Why the controller order is number first, then invert #
A value-change event responds to a change in the acquired Boolean state. Inverting Trigger produces a new state regardless of its previous value; repeatedly writing the same state produces no transition and is the wrong practice for repeated requests.
- Write the destination screen's number to
ScreenNumber. - Invert
Trigger. The acquired Boolean changes and the configured function executes with whatever screen number runtime currently holds. - For the next request, update the screen number first, then invert
Triggeragain.
PLC scan order and HMI acquisition are different processes. Writing the number before the Boolean expresses the correct command order but does not prove the independently acquired tags reach runtime in that order. If an old screen number is used intermittently, watch the HMI-side tag values at the event, not only the controller values. A controller pulse can also disappear between two acquisitions; a retained toggle avoids requiring runtime to catch a brief pulse, though several toggles within one acquisition still execute only one.
Method two: the Job Mailbox area pointer #
The mailbox needs no HMI tags at all. Runtime watches a configured block of controller data and executes the job it finds there.
- Create a connection to the PLC, for example by dragging a PLC tag into the HMI.
- In the project tree, select HMI, open the
Connectionsfolder, and select the PLC connection. Go to intermediate area → area pointers and edit the lineJob Mailbox: set active = set, access mode = absolute address, and Address = the first word of a continuous four-word PLC area. - In the PLC, write the desired screen number into the second word of that area.
- Write the constant 51 into the first word. That constant is the job number that tells runtime the request is a screen change.
The same word-then-trigger ordering rule applies here in reverse layout: the parameter (word 2) is written before the job number (word 1), because runtime acts as soon as it sees the job. Area pointers in general are covered in how the LS system area screen change register works, which explains the related screen-change mechanism Comfort Panels use in the other direction.
Worked example: laying out the four-word area #
Suppose the mailbox address is MW100 (an example value). One word is 2 bytes, so the four words are:
- Word 1:
MW100— the job number, 51 for a screen change - Word 2:
MW102— the screen number, read from the destination screen's Number property - Word 3:
MW104— not used by job 51 - Word 4:
MW106— not used by job 51
If Screen_0's Number property shows 2 (an example; read your own project), the PLC writes 2 to MW102 first, then 51 to MW100. Runtime picks up the job and activates screen number 2. For the next request to a screen whose number is 1, the PLC writes 1 to MW102 and then 51 to MW100 again. Do not place the area where the PLC program reuses those words for other data; the job number must be the last thing written.
Choosing between the two methods #
The decision follows from what your connection and code already look like:
- Plain screen changes, few destinations, no area pointers configured: use the tag event. It is two tags and one event, visible in the tag table and easy to trace with a status display.
- The connection already exchanges area pointers, or you want navigation handled alongside other controller-requested jobs in one fixed area: use the Job Mailbox. No HMI tags are needed and the request lives in one documented place.
- Whichever you choose, stop competing navigation while testing. If the intended screen opens and then another appears, another screen command or event function is overwriting the request; coordinate ownership so one source controls navigation.
For projects on the newer runtime rather than WinCC Advanced, the equivalent setup is described in changing the HMI screen from the PLC in WinCC Unified.
One safety note: screen navigation is an operator convenience, never an interlock. A machine state that must force an operator response belongs in the PLC safety and sequence logic, with the screen change as a display of it, not the control of it.
Verifying the configuration #
- Compare the controller value with the runtime tag value for
ScreenNumberandTriggerafter acquisition. If they differ, resolve the connection or acquisition settings before testing the event. - Trigger one request and confirm the destination screen opens and stays open.
- Trigger a second request to a different screen number and confirm the new destination opens. A failure on the second request usually means the number was written after the trigger, or the Boolean was not inverted.
- For the mailbox, confirm the active flag is set, the address matches the PLC writes, and the constant lands in word 1 after the number lands in word 2.
Questions asked
Where do I find the other job numbers the mailbox accepts?
The job numbers are listed in the WinCC runtime online help under the job mailbox section for your runtime version. Job 51 is the screen-change request; other numbers control things like user administration, recipe data transfer and printing, and each expects its own parameter layout in the remaining words.
Can I pulse the Trigger bit for one PLC scan instead of toggling it?
You can, but you risk losing requests. The HMI acquires the tag on its own cycle, and a pulse that rises and falls between two acquisitions produces no observed value change, so the event never fires. A retained toggle guarantees one transition per request; just accept that several toggles within one acquisition still execute only one.
Does the Job Mailbox method need HMI tags configured?
No. The mailbox works purely through the connection's area pointer configuration, so no HMI tag is required and nothing appears in the tag table. The controller writes directly into the PLC words at the absolute address set in the connection, which also means the address is fixed on the HMI side and cannot be moved from the PLC program.
Why does my screen number not match its position in the project tree?
The number is an independent property shown under the screen's Properties, General, Number. It is not derived from the screen name or from the order screens appear in the tree, so a screen called Screen_0 can carry any number. Always read the value from the property before writing it from the controller.