How-to
How to Change WinCC Flexible Screens From the PLC
Short answer
Enable Screen number and Job mailbox in the connection's Area pointer tab, reserve a data block for each, and write the screen-selection job from the PLC as a one-shot: parameters first, job number last, and never again until the panel clears the job word to zero. The screen-number area pointer then reports the current screen back to the PLC.
On this page
WinCC flexible changes screens from the PLC without a single line of HMI script, and the whole exchange is three Words — 6 bytes — plus a zero-check on the job word. Enable the Screen number area pointer and the Job mailbox in the connection's Area pointer tab, then write the screen-selection job from the PLC program: parameters first, job number last, once per request, and never again until the panel clears the job word to 0. Every screen you create carries its own number, and the PLC addresses screens by that number, not by name: in the worked example below, Overview is 5 and Alarm detail is 12. Configure four things in the project, add one edge-triggered rung in the PLC, and the panel follows the machine state.
Two mechanisms, one per direction #
The Screen number area pointer reports from the panel to the PLC. Siemens documents that the number is transferred whenever a new screen opens, and again whenever focus inside the screen moves between screen objects. You enable it once, under Connections on the Area pointer tab of the PLC connection, and it reserves words in a PLC data block you assign. The Job mailbox runs the other way, PLC to panel: a command area where the PLC writes a job number followed by parameters. The screen-selection job takes the target screen number and a field number as its parameters, and the panel acknowledges a processed job by clearing the job word.
| Mechanism | Direction | Carries |
|---|---|---|
| Screen number area pointer | Panel to PLC | Number of the screen currently displayed |
| Job mailbox | PLC to panel | Job number, then parameters; screen selection takes the target screen number and a field number |
Give every screen change one owner #
A screen that two mechanisms both switch produces flicker and races, so assign each transition exactly one owner before you configure anything. Give the transition to the PLC when it depends on process state — an alarm, a recipe step, a mode change — or when several panels must follow one sequence. Keep it in the HMI, as a script or a function list on a button or tag event, when it depends only on operator action or HMI-side state. When the navigation itself is structured, as in two-level tab navigation with child screens, decide per level who triggers the change and write the assignment into the project documentation.
Record the screen numbers #
The numbers are the interface contract between the HMI project and the PLC program.
- Open each screen's properties in the project tree and note the number the tool assigned it.
- Record the number next to the screen name in the PLC documentation or a constant table.
- Treat the numbers as fixed: deleting and recreating a screen can change its number and silently break every PLC reference to it.
- After any project edit, re-check the list: one unique number per screen, no duplicates, no renumbered screens the PLC still points at.
Enable the area pointers in the connection #
- Open Connections, select the connection to the PLC, and switch to the Area pointer tab.
- Enable Screen number and assign a data-block range used by nothing else. Note the length the dialog reserves, and read the block layout for your panel type in the WinCC flexible online help instead of assuming it.
- Enable Job mailbox on the same tab and give it its own words, reserved with the same discipline.
- Download the project to the panel and confirm the data block exists in the PLC at the reserved size.
Then test the report path before you write any logic: change screens manually with a button and watch the current-screen word follow. If it never moves, the connection is down or the address points at the wrong block — start by showing only the PLC connection alarm in WinCC flexible, then fix the address.
Write the job from the PLC #
The job number for screen selection and the exact word order are listed per device family in the job mailbox table of the WinCC flexible online help. Look them up once, put the job number in a named constant, and run the same handshake whatever the values are.
- Read the job word. It must be zero before you write anything.
- Write the parameters first: the target screen number, then the field number (zero unless a specific field must receive focus).
- Write the job number last, so the panel never executes a half-written job.
- Do not send the next job until the panel has cleared the job word back to zero.
- Fire the whole sequence from a rising edge on the trigger bit — the same discipline as latching a timer until done with a one-shot input — never from the level of the condition, or the panel will fight the operator for the screen.
Worked example: an alarm pushes the alarm screen #
Worked example with illustrative values. The recorded screen numbers are Start = 1, Overview = 5, Alarm detail = 12. The trigger is bAlarm, a Bool that starts FALSE; the one-shot memory is bAlarmEdge, a Bool that starts FALSE. In the mailbox words of the assigned data block, wJob, wScreen and wField are Words, all 0 before the event, holding the job number, the target screen and the field number. The screen-number area pointer lands in wCurrentScreen, a Word reading 5 while Overview is open.
When bAlarm rises, the rung executes once: bAlarmEdge AND wJob = 0 gates three moves — MOVE 12 into wScreen, MOVE 0 into wField, MOVE the job-number constant into wJob. The panel switches to Alarm detail, clears wJob to 0, and wCurrentScreen changes from 5 to 12. That word change is the test that proves the result; a wJob that stays nonzero means the panel never accepted the job.
The sizes check out too: three Words written is 3 × 2 bytes = 6 bytes of the mailbox block, and the edge does the rest of the work. With the PLC cycling every 10 ms and the alarm held for 2 s, a level-driven write would attempt 2000 ms ÷ 10 ms = 200 jobs for one screen change; the one-shot writes exactly 1. The other 199 would be ignored while wJob is nonzero, then re-fire the moment the panel clears it. Edge plus zero-check, always.
Verify it end to end #
Run the first pass in the simulator, following the same sequence as testing HMI simulation against a live PLC, then repeat it on the machine.
- Start Runtime with the connection online: no connection alarm, and
wCurrentScreenshows the start screen's number. - Force the alarm trigger: the panel switches,
wJobreturns to 0, andwCurrentScreenreads 12. - Trigger a second target, then navigate with a button: both directions work, and the pointer follows each change.
- Take the PLC to STOP and back to RUN: the panel reconnects, the pointer updates, and no job fires spuriously because
wJobsits at 0.
What breaks PLC-driven screen changes #
- Operator lockout: a PLC that rewrites the request every scan takes the screen away from the operator. Pulse the request, then release.
- Number drift: screens renumbered after the PLC references them send the panel to the wrong page or get ignored.
- Shared addresses: area-pointer and mailbox words overlapping other PLC data corrupt both sides. Reserve the range exclusively.
- Half-written jobs: writing the job word before the parameters lets the panel run a job with stale values.
- Access control: a screen behind a login or password is not unlocked by a PLC command. Design navigation and user rights together.
- One safety note: a commanded screen change is visualization, not alarm annunciation — keep the alarm system independent, so a failed panel never suppresses notification.
Questions asked
Can I change WinCC flexible screens from the PLC without writing a script?
Yes. Enable the Screen number area pointer and the Job mailbox in the connection's Area pointer tab, and write the screen-selection job from the PLC. No HMI script or function list is involved; the script route is only worth it when the transition depends on HMI-side state such as an operator action.
The panel switches once and then never again. What is wrong?
The job word never returned to zero, or the PLC writes the job on the level of the trigger instead of on an edge. The panel clears the job word when it has processed the job, and a new job is only accepted from zero. Interlock the write with job word = 0 and fire it from a one-shot.
Do screen numbers change when I edit the project?
They can. The number belongs to the screen object, so deleting and recreating a screen can hand its number to another screen, and every PLC reference then aims at the wrong page. Record the number with the screen name, and re-check the list after any edit that removes or recreates screens.
Does the screen number area pointer update only on screen changes?
No. Siemens documents that the screen number is also transferred when the focus within a screen moves from one screen object to another, so the PLC sees transfers while the visible screen stays the same. React to the value of the number, not to the fact that the word was written.
Can the PLC open a screen that is protected by a password?
Not by commanding it. A screen-selection job navigates; it does not log a user in or override user rights, so a protected screen stays protected. Design the navigation and the user administration together, and route unauthenticated operators to a public screen with the information they need.