Problem Details: Operation Record Loses the User Name in PCS7
In a standard WinCC V6.2 SP2 project, an engineer can build an "operation record" simply by configuring Alarm Logging, opening the Message Blocks tab, and assigning the WinCC internal tag @CurrentUserName to Process_Value_1. Whenever a user triggers a WinCC-side message event, the operator's login name is written into the archived message text and the audit story is complete. The same configuration, however, fails on a PCS 7 V7.0 SP1 OS: process values of an alarm raised by the Alarm_8P block (FB 35 in PCS 7 APL) display dashes or zero strings, even though the corresponding WinCC-only alarm on the same OS still shows the correct @CurrentUserName.
The operator's user name must be captured because the project is used for FDA-style batch record keeping, where every acknowledged event must be tied to a named, logged-in individual. Without the user name in Process_Value_1, the archived CSV/SQL record is not acceptable as a regulated operation record.
Observed Behavior Matrix
| Message Source | OS Environment | Process_Value_1 Configuration | Runtime Result |
|---|---|---|---|
| WinCC-only message (e.g. script-triggered) | Stand-alone WinCC 6.2 SP2 | @CurrentUserName |
Operator name visible, archived correctly |
| PCS 7 alarm from Alarm_8P | PCS 7 V7.0 SP1 OS | @CurrentUserName |
Empty / locked field, user name NOT archived |
| PCS 7 alarm from Alarm_8P | PCS 7 V7.0 SP1 OS | Hard-wired text or PLC tag | Value visible, OS-compilation link is enforced |
| OS-generated login event | PCS 7 V7.0 SP1 OS | Derived from WinCC UserAdmin | User name visible in the operation list, not in Alarm Logging |
Root Cause: Alarm_8P Owns the Process Values at the PLC Level
The PCS 7 alarm pipeline is fundamentally different from a stand-alone WinCC project:
- Alarm sources live in the AS (Automation Station) inside CFC charts. The standard PCS 7 library block Alarm_8P (APL-style, FB 35 with multi-instance data block) raises up to eight discrete events. Each event can carry up to ten associated values (
PV1throughPV10) that the block transmits as part of the ALARM_S frame to the OS. - During the OS compilation, WinCC reads the block's message configuration from the S7 project and writes the Process Values columns in the WinCC message configuration to fixed tag references taken from the CFC chart. The process values are therefore tied to a physical (or symbolic) source — typically an
INPUTpin of the Alarm_8P instance. - The WinCC internal tag
@CurrentUserNameexists only on the OS side. Because the OS compiler has already hard-bound Process_Value_1 to the corresponding CFC pin, the user-friendly assignment of@CurrentUserNamein the Alarm Logging editor is silently rejected: Alarm Logging will not overwrite an OS-compiled value, and the field shows whatever the AS transmits (an empty string for an unwired pin, or a process value for a wired pin). - The reason the same trick works in a stand-alone WinCC project is that no OS compilation ever happened, so Process_Value_1 was never bound to a PLC pin and the editor was free to attach the internal tag.
This is not a bug; it is the documented PCS 7 split of responsibility:
"In PCS 7, alarms are generated in the AS and transferred to the OS by means of ALARM_S/ALARM_8P. The process values are part of the message frame and are defined on the AS side."
— PCS 7 V7.0 OS Configuration Manual
Why the Operator's Identity Is Not a Process Value at All
PCS 7 is a multi-station system. A single AS can be monitored by several OS servers and clients, each with their own user administration database. The current user is therefore an OS-local concept, not a process concept. The AS has no knowledge of who is watching the panel. Trying to push the WinCC user name into an AS-generated message inverts the architecture and is, by design, not supported.
PCS 7 already provides a purpose-built feature for the missing data: the Operation List view in the WinCC Alarm Control. Every operator action that goes through the OS — logon, logoff, picture change, acknowledgment, SFC step operation — is logged with the WinCC user name, OS station, and timestamp, and is queryable independently of the Alarm Logging archive.
Solution Overview
Three robust strategies are available. The right one depends on the regulatory scope and the existing license stack:
- Use the WinCC Operation List as the operator action log. This is the simplest and most PCS 7-native approach. No PLC code changes are required.
- Generate AS-side messages at user login and pass the user name explicitly. The OS triggers a PLC job when an operator logs in, Alarm_8P then re-emits a tagged message whose process value is a WinCC-written string tag, and the result is archived in Alarm Logging.
- Use the WinCC/PCS 7 Audit option (TIA Portal: SIMATIC Logon Audit / PCS 7 Audit Trail). The licensed audit component provides a tamper-evident, FDA-aligned action log that already includes the operator, role, reason code, and process tag.
Solution 1 — Use the WinCC Operation List (Recommended Baseline)
Step-by-step
- Open the Graphics Designer on the OS and drop a WinCC Alarm Control into the picture set used for message review.
- Switch the message class filter to the Operation class. The Operation List view shows: Date/Time, OS station, User name, Action, and Comment.
- Open Alarm Logging > Message Classes > Operation and confirm that Logging is enabled and that the archive is sized so the operation records overlap the alarm archive (default project setting: 1000 segments × 1000 messages).
- Define a separate User Archive or a relational table (e.g. via WinCC Connectivity Pack / OPC UA) if downstream reporting must join alarm and operation records on the same time window.
Verification
- Log in as operator_A, change a process value, then log off.
- In the Alarm Control, open the Operation tab. The line
operator_A | 14:32:07 | Tag PV_101 changed from 50 to 75must appear. - Export the view to CSV via the toolbar. The user name field must be non-empty for every row.
This approach requires no CFC change and works on every PCS 7 OS from V6.1 SP4 forward, including V7.0 SP1, V7.1, V8.0, V8.1, V8.2, and V9.0. The WinCC Alarm Control Operation List is documented in the WinCC Information System > Alarm Logging > Operation List.
Solution 2 — AS-Side String Transfer with Alarm_8P
If the audit requirement is strict and the action record must live inside Alarm Logging (for example because the customer wants a single archive CSV to satisfy a 21 CFR Part 11 review), the user name must be moved from the OS to the AS. The mechanism is a write job from the OS to a WinCC string tag, mirrored onto a PLC string tag, and used as PV1 of an alarm that the OS triggers on every operator action.
Prerequisites
- An AS-side string tag (e.g.
DB_USER.CurrentUser, typeSTRING[24]) accessible from the OS. - An
Alarm_8Pinstance in the CFC whose EV_ID is reserved for "user action" events. - WinCC Global Script C or VBS that writes the user name into the PLC tag on PictureChange, OperatorAction, or UserLogon events.
Step-by-step AS Configuration
- Open the CFC chart that owns the central
Alarm_8Pfor user-action messages. In the PCS 7 V7.0 APL, the block icon is in the APL Library > Blocks > Operator Control & Monitoring palette. - Connect the input
PV1of the chosenEV_IDto a string tag that will carry the user name (e.g.DB_USER.CurrentUser). The pin acceptsSTRINGonly if the corresponding process value type in the message text is configured as Associated Value: STRING; otherwise the value is truncated or rejected. - Compile the S7 program and download.
Step-by-step OS Configuration
- Open the OS project in WinCC Explorer. In OS-Project Editor > Tag Management, add an external tag
DB_USER.CurrentUserof typeTEXT_ASCII, length 24, and the appropriate AS-OS connection. - In Global Script > C-Editor, create a project-wide action on the UserLogon trigger:
// Triggered on every successful logon char* user = GetTagChar("@CurrentUserName"); SetTagChar("DB_USER.CurrentUser", user); // Wait one scan, then raise the AS-side message DWORD msgState = 0; MSG_RMSGD_C p; p.bAckn = 0; p.szMsgText = "User action"; p.dwMsgNr = 0x0001; p.evid = (DWORD)g_usrEvID; // EV_ID of the user action Alarm_8P MS_RMStartMsg(&p, &msgState); - Run the OS-Compile so the Process_Value_1 column of the new message is bound to the
DB_USER.CurrentUsertag. - In Alarm Logging, switch the user-action message class to Logging: Yes and Archive: Yes.
Verification
- Log in as operator_B. WinCC writes operator_B into
DB_USER.CurrentUser. - The Global Script triggers the AS message. The archived CSV row in the Alarm Logging export shows Process_Value_1 = operator_B on the same row as the user-action message.
- Open the message with the WinCC Information System tool, switch to Hit list, group by Process_Value_1. The user distribution must match the actual logon list of the day.
Solution 3 — PCS 7 Audit Trail (Regulated Environments)
For pharmaceutical and FDA 21 CFR Part 11 environments, Siemens offers a dedicated audit package. The PCS 7 Audit / SIMATIC Logon Audit component extends WinCC with:
- Tamper-evident hash-chained action log.
- Forced reason code selection per operator action.
- Electronic signature workflow.
- Cross-reference of user, role, SFC step, setpoint, and tag value in a single audit record.
Activation requires the SIMATIC Logon Audit license and a WinCC user administrator configured for the project. The component is part of the PCS 7 catalog from V7.1 SP3 onward and is fully integrated in V8.0, V8.1, V8.2, and V9.0. The PCS 7 V8.2 Process Control System Manual > Compliance & Audit describes the architecture, the required ES/OS project settings, and the audit log database layout.
Diagnostics: Confirming That the Process Value Is Locked
Before applying any of the three solutions, run the following one-minute diagnostic to verify the root cause and not chase a different defect.
- On the OS, open Alarm Logging, right-click the user-action message, and choose Properties > Process Values.
- Note the configured tag (for example
DB_USER.CurrentUser). A locked value displays a fixed tag name, not@CurrentUserName. - Open the ES project, navigate to the CFC chart that owns the message, and read the Message Configuration of the Alarm_8P block. The pin connected to
PV1must match the OS-side tag. If they diverge, run a full OS compile. - On the WinCC side, open a Online Trend Control and add
DB_USER.CurrentUser. Trigger an action and verify the string actually arrives from the AS. If the trend is empty, the OS-to-AS link is broken (check the WinCC Channel Diagnosis and the AS-OS connection in SIMATIC Manager > PC Station > Configuration). - Confirm that the OS user is part of the user group allowed to operate the block; the WinCC User Administrator will silently drop actions by an unauthorized user, leaving Process_Value_1 empty.
Troubleshooting Matrix
| Symptom | Likely Cause | Corrective Action |
|---|---|---|
| PV1 empty on Alarm_8P messages; WinCC-only messages show user name | OS compile locked PV1 to an unwired CFC pin | Use the Operation List (Solution 1) or wire a real string tag (Solution 2) |
| PV1 still empty after wiring DB_USER.CurrentUser | Tag type mismatch (STRING on AS, TEXT_ASCII on OS, length mismatch) | Match type/length; rebuild the OS project; run OS compile |
| PV1 populated for one OS, empty on the second OS | AS-OS connection missing on the second OS | Add the connection in PC Station > Configuration; re-import S7 connections |
| User logs in, but PV1 still carries the previous user | Global Script on UserLogon not enabled in the runtime properties | Right-click the action → Properties > Trigger; tick UserLogon and confirm the action is assigned to all OS servers |
| Audit log shows user, but no reason code | Audit option not licensed, or reason-code dialog not configured | License SIMATIC Logon Audit; configure ReasonCode in the User Administrator |
| CSV export of Alarm Logging shows dashes for PV1 | Archive written before OS compile completes | Always run OS-Compile > Full before activating runtime; check OS Project Editor > Compile Logs |
Preventive Best Practice
For every PCS 7 OS project that must satisfy a regulated audit requirement, lock the following defaults into the ES master project:
- Reserve a single
Alarm_8Pinstance per OS pair with the naming conventionUSER_AUDIT_xxxand document the EV_ID allocation in a central spreadsheet. - Make the user-name string tag (
DB_USER.CurrentUser) part of the standard AS template; the OS compile will then bind Process_Value_1 to the same symbol in every OS of the plant. - Centralize the Global Script in the project function library. The action must be triggered on UserLogon, UserLogoff, and OperatorAction events.
- Add a WinCC Channel Diagnosis picture to the engineering picture set so the AS-OS string link is observable at runtime.
- After every CFC or S7 program change, run a full OS Compile and re-export the message configuration to confirm the process-value bindings are intact.
Field-Proven Caveats
- PCS 7 V7.0 SP1 and WinCC V6.2 SP2 are long out of mainstream support. Siemens Lifecycle Database lists V7.0 as "Out of Service" since 2017; consider a hardware migration to PCS 7 V9.0 / WinCC V7.5 to receive security patches and Audit support.
- Operator authentication in PCS 7 V7.0 is handled by the WinCC User Administrator. For plants that need central RBAC, the upgrade to SIMATIC Logon (introduced in V7.1) is the documented path.
- If multiple OS clients display the same AS, each must execute its own copy of the UserLogon Global Script; do not assume the server-side action will replicate.
- The Alarm Logging archive is not the same as the TagLogging archive. A regulatory review that requests "all operator actions" must be answered from the Operation List export, not from the tag archive.
- WinCC internal tags with the leading "@" character (e.g.
@CurrentUserName,@LocalMachineName) are read-only on the OS side and cannot be written from the AS; they cannot be re-bound to AS-bound messages.
Summary
The @CurrentUserName does not show up in Process_Value_1 of an Alarm_8P message symptom is not a defect but the documented PCS 7 separation of PLC and OS responsibilities. The PLC owns the process values; the OS owns the user identity. The three durable solutions are: (1) read the WinCC Operation List for operator action audit, (2) push the OS user name into a PLC string tag and re-raise the message through a dedicated Alarm_8P, or (3) license the PCS 7 Audit component. The selection depends on whether the requirement is a single Alarm-Logging CSV or a tamper-evident audit trail. Run the diagnostics, identify which process value is locked, and apply the matching solution before re-running the OS compile.
Frequently Asked Questions
Why does @CurrentUserName work in WinCC but not in PCS 7?
Standard WinCC projects are not compiled from a CFC chart, so the Alarm Logging editor is free to bind Process_Value_1 to the OS-internal tag. In PCS 7 the OS compile binds Process_Value_1 to the AS-side pin of the Alarm_8P block, so @CurrentUserName cannot be assigned.
Can I reassign Process_Value_1 in Alarm Logging to @CurrentUserName in a PCS 7 project?
No. The next OS compile overwrites the change. Any user-name value must be written to the AS first (for example through a WinCC Global Script that copies @CurrentUserName into a STRING tag) and then reflected back as a real process value.
Where can I see the operator's name in PCS 7 then?
Open the WinCC Alarm Control, switch to the Operation message class, and the operator's user name, OS station, and the action are recorded for every operator-driven event. This is the PCS 7 native audit log and is enabled by default.
Do I need a special license to log the operator name with every alarm?
Only if you require a regulated, tamper-evident audit trail with electronic signature and reason code. In that case license the SIMATIC Logon Audit option, which is part of PCS 7 from V7.1 SP3 onward. The basic operator name in the Operation List is included in every standard PCS 7 OS.
What happens to my process-value binding after a CFC re-compile?
The binding is regenerated automatically. Always run a full OS-Compile after a CFC re-compile, and then verify Alarm Logging > Properties > Process Values for the affected messages. A controlled OS compile window and a binding verification step are the documented Siemens best practice.