1. Overview: Dual-HMI Single-PLC Operator Authorization
Plant retrofits, line migrations, and operator-station rebuilds routinely produce a topology where two HMIs must share a single S7 controller: a fixed Siemens Multipanel (e.g. MP 277 10" Touch, MP 377 12" Touch, MP 377 15" Touch) mounted at the machine, plus a WinCC Flexible PC Runtime on a Panel PC or office workstation that the same operator may want to use remotely. Both devices project to identical tags on the same S7-300 / S7-400 / S7-200 CPU, and both can issue setpoint writes, mode changes, and acknowledgements.
The engineering question that follows is not whether this topology is legal — the SIMATIC area-pointer and tag-handle mechanisms do allow it — but how to ensure that only one HMI station has write authority at a time, that the inactive station is cleanly muted, and that the handover is logged and password-protected. The pattern used in the field is a PLC-resident control latch: one Boolean tag — typically HMIActive — that is set TRUE by the active station, FALSE by the standby station, and verified on every write through a screen-side enable expression.
This reference documents the full implementation: tag design on the S7 side, parallel configuration in WinCC Flexible on both the Multipanel project and the PC Runtime project, user-administration with role-based permissions, function-script enforcement, area-pointer wiring, and a verification procedure that exercises both handover directions.
2. Prerequisites
| Component | Specification | Notes |
|---|---|---|
| Engineering station | WinCC Flexible 2008 SP5 (ES) installed | Same ES may author both the PC Runtime project and the Multipanel project. |
| PC Runtime host | Panel PC 677 / PC 870 / IPC547C or office PC | WinCC Flexible Runtime 2008 SP5 license required (RT 128 / RT 256 / RT 2k / RT 4k depending on tag count). |
| Multipanel | MP 277 10" Touch (6AV6 643-0CD01-1AX1) or MP 377 12" Touch (6AV6 644-0AA01-2AX1) | Image must match the ES target. Transfer via Profibus, Ethernet, or USB/PPI. |
| Controller | SIMATIC S7-300 (e.g. CPU 315-2 PN/DP, 6ES7 315-2EH14-0AB0) or S7-400 | Free flag byte or DB bit required for the latch tag. |
| Firmware | CPU FW ≥ V3.2 for S7-300, FW ≥ V6 for S7-400 | Required for consistent PUT/GET access if a PN/CP is used. |
| Connectivity | PN interface or CP 343-1 Lean / CP 443-1 | Enable Permit access with PUT/GET on the CPU protection tab if the HMI is on Ethernet and not on the same logical subnet. |
| STEP 7 | STEP 7 V5.5 SP4 (or compatible) for online testing | Optional: only needed for forcing the latch from PG during commissioning. |
3. Architecture and Tag Design
The control latch is implemented as two bits in a global PLC data block so that both HMI stations read the same authoritative source and write through the same handshake:
-
DB_HMI.ActLocal— Bool, set TRUE by the Multipanel when local operator takes control. -
DB_HMI.ActRemote— Bool, set TRUE by the PC Runtime when remote operator takes control. -
DB_HMI.LockLocal— Bool, TRUE blocks all Multipanel write tags. -
DB_HMI.LockRemote— Bool, TRUE blocks all PC Runtime write tags. -
DB_HMI.HMIActive— Bool, summary latch: TRUE = local active, FALSE = remote active. -
DB_HMI.OperatorID— Int, last accepted user number (1..32) for audit log. -
DB_HMI.HandoverAck— Bool, one-shot acknowledgement of handover event.
Create the data block in STEP 7 (or in the PLC program if running TIA):
DATA_BLOCK "DB_HMI"
STRUCT
ActLocal : BOOL; // request from Multipanel
ActRemote : BOOL; // request from PC Runtime
LockLocal : BOOL; // disables Multipanel writes
LockRemote : BOOL; // disables PC Runtime writes
HMIActive : BOOL; // TRUE = local active, FALSE = remote active
OperatorID : INT; // 0..32
HandoverAck : BOOL; // pulse, must be reset by both stations
END_STRUCT
END_DATA_BLOCK
The mutual-exclusion rule, written in the OB1 cyclic scan, is straightforward:
// Mutual exclusion and latch state
IF "DB_HMI".ActLocal AND NOT "DB_HMI".ActRemote THEN
"DB_HMI".HMIActive := TRUE;
"DB_HMI".LockRemote := TRUE;
"DB_HMI".LockLocal := FALSE;
ELSIF "DB_HMI".ActRemote AND NOT "DB_HMI".ActLocal THEN
"DB_HMI".HMIActive := FALSE;
"DB_HMI".LockLocal := TRUE;
"DB_HMI".LockRemote := FALSE;
ELSE
// Both asserted or both released - hold last state
// Lock bits stay at their last value
END_IF;
// Pulse the handover acknowledgement on any change
"DB_HMI".HandoverAck := "DB_HMI".HMIActive XOR "DB_HMI_HMA_last";
"DB_HMI_HMA_last" := "DB_HMI".HMIActive;
4. WinCC Flexible PC Runtime Project — Configuration
4.1 Connection definition
Open the PC Runtime project in WinCC Flexible ES. Under Project > HMI_1 [Name] > Connections configure an Ethernet (ISO-on-TCP) or Profibus (MPI/DP) connection depending on how the Panel PC is wired to the S7 CPU. Typical parameters:
| Field | Value (Ethernet example) |
|---|---|
| Communication driver | SIMATIC S7-300/400 Ethernet (RFC1006) |
| HMI device address | 192.168.0.10 (static, fixed on Panel PC) |
| PLC address | 192.168.0.1 (CPU PN interface) |
| Access point | S7ONLINE |
| Slot / Rack | Slot 2 (typical for CPU 315-2 PN/DP) |
4.2 Tag mapping for write authority
Create external tags for every operator-controllable point on the PC Runtime, each pointing at the matching PLC address:
-
Sp_SetSpeed— Int, DB_HMI.DBW10 -
Sp_ModeSelect— Int, DB_HMI.DBW12 -
Cmd_Ack— Bool, DB_HMI.DBX14.0 -
Cmd_Start— Bool, DB_HMI.DBX14.1 -
Cmd_Stop— Bool, DB_HMI.DBX14.2
For every write tag, open Properties > Events > Change Value and enable the "Enable via PLC tag" option, then bind it to DB_HMI.LockRemote. WinCC Flexible supports a built-in enable mechanism that suppresses the write entirely when the assigned tag is TRUE. This is the cleanest way to enforce the latch from the configuration side, with no script overhead.
4.3 Take-control button (script)
Place an "Activate Remote" button on the main screen. Under Events > Press attach a function list that performs:
// Function list — Press event of "Activate Remote" button
SetBit("HMIActive_Sel"); // local HMIActive_Sel = TRUE
SetValue("DB_HMI.ActRemote", 1); // request remote
SetValue("DB_HMI.ActLocal", 0); // release local claim
LogMessage("Operator", "Remote station requested control");
Mirror the operation on the Multipanel side with the inverse logic. The two requests feed the mutual-exclusion block in OB1.
5. Multipanel Project — Configuration
5.1 Connection and tag mirroring
In the same WinCC Flexible ES session open the Multipanel project (target: MP 277 or MP 377). Define a connection identical in PLC endpoint but with the Multipanel's own IP or MPI address. Re-create the same external tags; the absolute addresses in the PLC are the same because both stations read the same DB.
For each Multipanel write tag, set Enable via PLC tag = DB_HMI.LockLocal. When LockLocal is TRUE the Multipanel cannot write to the PLC, even if a button is pressed.
5.2 Take-control button on Multipanel
// Function list — Press event of "Activate Local" button
SetBit("HMIActive_Sel"); // local HMIActive_Sel = FALSE
SetValue("DB_HMI.ActLocal", 1);
SetValue("DB_HMI.ActRemote", 0);
LogMessage("Operator", "Local Multipanel requested control");
Both stations are now peer-equivalent: each can assert its claim, each is blocked by the other's lock, and the latch in OB1 enforces mutual exclusion.
6. Area Pointers for Coordination
Beyond the latch tag, configure the coordination area pointer on both HMI stations so the runtime knows when the partner project starts and stops. In the connection properties of each project:
- Enable the Coordination area pointer.
- Reserve a byte in the same DB_HMI, e.g.
DB_HMI.DBB20. - Bit 0 = "Coordinator active". Bit 1 = "Coordination bit — life sign". Bits 2..7 are user-definable.
WinCC Flexible sets bit 0 on the Multipanel side automatically when the panel starts; the PC Runtime does the same. Each station can poll CoordDB & 0x01 to confirm the partner is alive — a missing partner bit allows the active station to keep operating, while a reappearing partner triggers a handover prompt instead of an uncontrolled write race.
7. User Administration and Password Layer
A bare latch without authentication is not acceptable on most lines. In WinCC Flexible open Project > User Administration on both projects:
- Define three groups: Operators (level 1, password required), Supervisors (level 2), Administrators (level 3).
- Create user SUP_LOC in Operators on the Multipanel, SUP_REM in Operators on the PC Runtime.
- Bind the "Activate Local" / "Activate Remote" buttons to a function list that first calls
ShowLogonDialogif no user is signed in, then issues the SetValue toDB_HMI.ActLocal/DB_HMI.ActRemote. - Under Screen > Properties > Security, mark the handover screens as protected and assign them to group Operators or higher.
8. Display Logic — Hiding Inactive Writes
Suppressing writes is half the job. Operators should also see which station is active so they do not press buttons that silently fail. Add a status indicator on both projects:
// Animation — Visibility of "Remote Active" banner
if (GetTagBit("DB_HMI.HMIActive") == 0) {
return VISIBLE;
} else {
return INVISIBLE;
}
// Animation — Visibility of "Local Active" banner
if (GetTagBit("DB_HMI.HMIActive") == 1) {
return VISIBLE;
} else {
return INVISIBLE;
}
Color the input fields grey when the lock is TRUE (use the Appearance animation linked to the lock bit), and add a tooltip: "Locked — other station is active." This prevents operator confusion during handover.
9. Logging the Handover Event
Configure an alarm/message in the message configuration of each project:
- Trigger tag:
DB_HMI.HandoverAck(rising edge). - Text: "HMI control handed over to %s — operator ID %d", with the active-station tag and
DB_HMI.OperatorIDas parameters. - Class: Warning (orange) so it appears in both the operator log and the historian.
WinCC Flexible writes the message to its log file and to the configured archive (CSV, RDB, or SQL via the Logging option). Each station records the handover locally — set the archive retention to ≥ 30 days for audit traceability.
10. Verification Procedure
- Compile both projects. In WinCC Flexible ES select Project > Compiler > All. Both the PC Runtime and Multipanel targets must compile clean. Address warnings on any tag whose enable-via-PLC property is missing.
- Download PC Runtime. Start the Panel PC in transfer mode (or push via Ethernet/RDP). Confirm the runtime loads and the connection LED turns green.
- Download Multipanel. Use Transfer > MPI/Profibus/Ethernet from the ES. Verify firmware compatibility — WinCC Flexible 2008 SP5 images target MP 277 FW ≥ V4.x and MP 377 FW ≥ V8.x.
-
Baseline test. Open STEP 7 online on the S7-300. Monitor
DB_HMI.LockLocalandDB_HMI.LockRemote. They should both be FALSE on first scan. -
Handover test A — local to remote. On the Multipanel, log in as SUP_LOC. Press "Activate Local". Confirm
LockLocal= FALSE,LockRemote= TRUE,HMIActive= TRUE. Try pressing a write field on the PC Runtime — it should be greyed out and reject any value change. The handover alarm appears in both logs. - Handover test B — remote to local. Log in on the PC Runtime as SUP_REM. Press "Activate Remote". Confirm bits flip and the Multipanel now rejects writes.
- Conflict test. Simultaneously press both "Activate Local" and "Activate Remote" from a second engineer laptop on the same network (use a second PC Runtime instance if needed). Verify that the latch holds its previous state — the XOR-snapshot in OB1 prevents both bits from being TRUE at once.
- Connection-loss test. Disconnect the Ethernet cable from the PC Runtime. The Multipanel should continue operating normally. The PC Runtime should display a connection-failure alarm and re-show its input fields as soon as the cable is reconnected.
11. Troubleshooting Matrix
| Symptom | Likely Cause | Remedy |
|---|---|---|
| Both stations write simultaneously; no handover alarm | Enable-via-PLC tag not assigned to write tags | Open each write tag's Properties > Events and bind the enable to DB_HMI.LockLocal or LockRemote as appropriate. Recompile and redownload. |
| Multipanel always locked out, even at startup | OB1 initial value of LockLocal is TRUE |
Set initial value FALSE in the DB; OB1 only writes TRUE on remote-takeover, never on first scan. |
| PC Runtime cannot read tags at all ("Connection failed" banner) | Permit access with PUT/GET not enabled on CPU, or wrong slot | In STEP 7 hardware configuration, open CPU Properties > Protection, tick Permit access with PUT/GET. Verify slot = 2 for S7-300 PN CPU. |
| Handover button has no effect | User is not logged in or wrong group | Check Security > Screen setting on the button's screen; verify the assigned group is ≥ the user's group number. |
| Both stations show "Local Active" simultaneously | Area pointer not configured; HMIActive read from different DB copies |
Confirm both projects point at the same DB number (e.g. DB 100) and the same offsets. Use STEP 7 online monitor on DB_HMI to validate. |
| Operator can press buttons but no setpoint change is sent | Enable-via-PLC is suppressing writes silently — no visual feedback | Add the visibility/colour animations from §8 so operators see the lock state. |
| Handover alarm logged but no actual handover happens |
HandoverAck pulse not reset by either station |
Add an acknowledgment reset: SetValue("DB_HMI.HandoverAck", 0) at the end of each press-event function list. |
| MP 277 reports "Image version mismatch" during transfer | ES image was compiled for MP 377 or Comfort target | Re-compile the project with the correct target device selected. Confirm Project > Device > Type matches the actual panel. |
| Multipanel freezes on start; PC Runtime works | Both stations hold the same IP address on Ethernet | Assign static, distinct IP addresses to each station. Verify with ping from a service laptop. |
12. Field-Proven Caveats
- One project, two compilations. Build the project once for the PC Runtime and once for the Multipanel in the same ES session. Do not maintain two parallel sources; tag-list drift between them is the most common source of latch desync.
- Compile-time warnings on enable-via-PLC. WinCC Flexible 2008 SP5 emits a warning if the assigned enable tag is not the same DB number as the tag being protected. Treat such warnings as errors during code review.
-
MP 277 vs MP 377 image. MP 277 expects
*.imgcompiled for 800 × 480 / 640 × 480; MP 377 expects the same image file but loaded at a higher resolution. If you swap panels on the line, recompile rather than reuse the old.img. - Transition to TIA Portal / WinCC Comfort. When migrating, the equivalent mechanism is the "Operate enable via PLC tag" property on each IO field and button under Comfort/Advanced. The PLC tag design in DB_HMI stays unchanged.
- Safety-relevant writes. This pattern is intended for operator-level control (setpoints, mode selection, acknowledgements). Do not route safety-relevant commands (F-Stop, safety door acknowledgement) through this latch; use the dedicated PROFIsafe stack on the F-CPU and a separate F-DQ pathway.
- Time synchronisation. Both stations should NTP-sync to the same time source so that handover messages can be correlated in the log. WinCC Flexible supports time synchronization via the Date/Time area pointer on the same PLC connection.
13. Standards and Documentation References
- Siemens Industry Online Support — WinCC Flexible entry point
- WinCC Flexible 2008 SP5 — Operating Manual (PDF)
- SIMATIC HMI MP 277 / MP 377 — Device Manual
- WinCC Flexible — Communication with S7-300/400 (entry point)
- S7-300 CPU 31x — Communication functions manual
Can both HMIs be active at the same time without a latch tag?
Technically yes, but a simultaneous setpoint write from two stations will produce a race condition in the PLC: the last write wins, the first is lost, and neither operator sees the result they expected. The latch tag (DB_HMI.HMIActive) and the LockLocal / LockRemote enable bits on each write tag are the only way to enforce exclusive authority without modifying the PLC program logic.
What happens if both stations press "Activate" within the same PLC scan cycle?
The OB1 mutual-exclusion block holds the previous state and ignores the conflicting request. The HandoverAck pulse will not fire because HMIActive did not change. Operators must release one button before the other request is accepted — a single-press handover takes exactly one scan cycle, so collisions only occur when both stations deliberately assert at the same moment.
Is the same approach valid if the Multipanel is replaced by a Comfort Panel on TIA Portal?
Yes. The PLC tag design is unchanged. On the TIA side use the IO-field property "Operate enable via PLC tag" or the equivalent "Enable" property on a button, both pointing at the same DB_HMI.LockLocal / LockRemote bits. The user-administration structure in TIA is configured under "Users & Roles" instead of the legacy "User Administration" dialog but the result is identical.
How do I migrate the configuration without losing the latch during cutover?
Compile both projects, transfer to the Multipanel first while the PC Runtime remains disconnected, verify local operation, then enable the PC Runtime connection and verify remote operation. Test the handover in both directions before signing off the migration. Never run both stations connected to the new image against the same DB_HMI until each has been independently verified.
Does the latch tag consume a CP / CPU license slot?
No. DB_HMI lives in the S7 CPU's load memory and is read over the existing HMI connection; the area pointer for coordination uses one byte of the same DB. No additional CP slots, no OPC server, no extra PN connection — the cost is one DB and one FC (or an OB1 segment) in the S7 program.