PCS 7 AlarmControl: Fix Empty BatchName in Status Messages
In SIMATIC PCS 7 V8.x and V9.x, the WinCC AlarmControl often displays a blank BatchName column for messages generated by the "Status Message - PLC" message class, while the same field is populated correctly for "Process Message - PLC", "Operator Message - PLC", and "Fault Message - PLC" messages. This article documents the root cause, the working workarounds, and the configuration steps verified on production plants.
1. Problem Description
On an OS runtime server, the AlarmControl view is configured to expose six columns: Date/Time, Event, BatchName, Acknowledgement, Priority, and State. Operators report that any active message generated by a block running on the AS (automation system) configured with the "Status Message - PLC" message class produces an empty BatchName cell, even when:
- The CFC chart for the block is named with the full KKS coding string (for example,
10PGA01CT001). - The associated
BatchNameinput of the underlying ALARM_8P block is wired to a valid STRING tag. - The Plant View Hierarchy (PH) is correctly built and the chart is located under its assigned hierarchy folder.
The same block, configured for "Process Message - PLC" instead of "Status Message - PLC", returns the correct KKS string in the BatchName column without any further changes.
Symptoms observed in the field:
- Empty
BatchNamecolumn for every status-type message, regardless of which CPU / AS originates it (S7-400H, S7-410, S7-1500). - CSV export from AlarmControl logs shows
;;;;;in the BatchName position for Status messages only. - Block icon "Header" text linked to the
.BatchNametag resolves correctly for non-status messages but stays blank for status messages.
2. Root Cause
2.1 Where BatchName Comes From
The text shown in the BatchName column of AlarmControl is not the raw value of an AS tag named BatchName. AlarmControl displays the value found in the message header field BatchName that is assembled by the OS at the moment the message is queued. The OS reads that field from the PCS 7 message frame received via the named connection or the S7-OS coupling, and the value is produced at the AS side by the ALARM_8P / ALARM_8P_2 / MSG_LOCK evaluation logic, or substituted from the active batch context if SIMATIC BATCH is licensed.
The header field has two AS-side inputs that drive it:
| AS input | Data type | Source | Default behavior |
|---|---|---|---|
BatchID |
INTEGER (DWORD) | BATCH API (when SIMATIC BATCH active) or manual wiring at the block instance | If 0 and BATCH is not licensed, the OS does not append a BatchName |
BatchName |
STRING [32] visible to OS | BATCH API or tag wired to the block instance | If BatchID = 0, the BatchName header field is left empty regardless of the wired value |
The critical link is BatchID <> 0. As long as BatchID remains at its default value of 0, the entire batch header in the message frame is suppressed, including any value present at the BatchName input.
2.2 Why "Status Message - PLC" Behaves Differently
The "Status Message - PLC" message class is delivered by PCS 7 with its own ALARM_8P instance metadata in which, by default, the message is configured as an "Information" message (class = "STATUS") rather than a "Process" or "Fault" message. The standard PCS 7 message configuration delivered via WinCC Configuration Studio assigns the default BatchID and BatchName values to the Process and Fault categories only; the Information/Status category is shipped with both fields empty.
Consequences:
- When the message is generated, the AS still does not populate
BatchIDfor status messages unless the block instance has explicit wiring. - AlarmControl honors the standard PCS 7 column configuration, but the OS message dispatcher treats the empty
BatchIDas "no batch context" and writes nothing into the BatchName header field, so the column is displayed blank. - Process, Fault, and Operator classes have the BatchID/BatchName fields auto-mapped by the BPL/APL symbol set, which is why those messages appear to "just work" once a chart / block is renamed with the KKS code.
ALARM_8P (S7-400), ALARM_8P_2 (S7-1500 with PCS 7 V9), or the newer APL blocks with embedded alarm capability. The header evaluation logic on the OS side is the same.
3. Prerequisites
Before applying any workaround, verify the following on the engineering station (ES) and the OS server:
- SIMATIC PCS 7 V8.2 SP1 or later recommended. The fix applies to V8.0+, but text-library resolution rules changed between V8.1 and V9.0; check the relevant release notes.
- WinCC Configuration Studio installed on the OS server with full administrator rights.
- PCS 7 OS Project Editor run at least once on the active OS project (creates the standard message classes).
- CFC library version matches the OS image: BPL >= V8.0 or APL >= V8.1 when V9 is used.
- A valid Plant View hierarchy under
\Plant View\Unit\...so block paths can be resolved to KKS strings.
4. Workaround Selection
Three approaches are documented, ranging from the simplest to the most flexible. Choose based on the number of charts affected, whether KKS is already embedded in chart names, and whether the project is integrated with SIMATIC BATCH.
| Method | Best for | KKS source | Drawback |
|---|---|---|---|
A. $$AKZ$$ token in the alarm line |
Small projects where the PH is one level deep | Hierarchy folder + chart name | Entire path is inserted; multilanguage repetition; no header binding for block icons |
B. Manual BatchID wiring on each block instance |
Mixed installations with BATCH active | Any STRING source (CSV, derived tag) | Repetitive in Process Object View |
C. BatchID = 1 + @1%s@ placeholder |
Most production plants; new V9 projects | Any STRING tag fed from derived block attribute | Requires derived tag at chart level |
5. Solution A: Use the $$AKZ$$ Token
The $$AKZ$$ token (German Anlagenkennzeichnung, "plant designation") inserts the full path of the originating block into the alarm line of ALARM_8P, including:
-
\Plant Viewroot - All hierarchy folder names traversed
- Chart name
- Block instance name
5.1 Configure the alarm line
- Open the block icon of the affected function (e.g.,
MotSped,VlvAnL). - Switch to Messages view in the CFC/SFC editor.
- Select the "Status Message - PLC" entry.
- In the Alarm line / Event text field, replace the placeholder with
$$AKZ$$ - additional free text. - Compile the OS. Run OS Project Editor → Compile / Generate.
The result in AlarmControl is an event text containing the full PH path. The BatchName column is still not affected because AKZ modifies the event, not the batch header.
5.2 Limit AKZ to the KKS code only
If you want a column with the KKS only (not the full path) you cannot use AKZ directly. Generate an additional STRING tag at the chart level by parsing the chart name; see Siemens Support Entry 109751706 for a sample SCL routine. Apply this in the chart-level CFC under a derived block attribute named KKSCode.
6. Solution B: Manual BatchID Wiring on Every Block
This method bypasses SIMATIC BATCH entirely by forcing the ALARM_8P header to carry the KKS regardless of the message class.
- Compile the program. Open the Process Object View (POV) of the affected chart.
- For every block that emits status messages, locate the
BatchIDinput and write a constant, non-zero INTEGER value, for example1. This single integer acts as the "batch slot" identifier. - On the same block, locate the
BatchNameinput and wire the STRING source containing the KKS (e.g., a chart-level constant'10PGA01CT001'). - Compile the AS program and re-download.
BatchID of 0 is reserved for "no batch". Any non-zero value allows the BatchName to be displayed, but must be unique per logical batch slot if you also use SIMATIC BATCH.6.1 CSV-driven KKS
To avoid editing every block instance manually, build a CSV with columns ChartName, KKS, BatchID, import it via SIMATIC PCS 7 Plant Configurator (PCS 7 V9.0+) or via the older Bulk Engineering Manager, and let the import tool generate the wirings automatically.
7. Solution C: BatchID = 1 and @1%s@ Placeholder
The recommended solution for most plants combines a constant BatchID = 1 with a placeholder-driven message line.
7.1 ALARM_8P message configuration
- In the CFC block instance, open Object properties → Messages.
- Select the "Status Message - PLC" line.
- Edit the alarm text to read:
KKS: @1%s@ - free text - Open the message configuration dialog. In the Source column of the associated values list, set the source for value 1 to the chart-level tag that contains the KKS string.
7.2 Wire the BatchID and BatchName inputs
At the ALARM_8P instance inputs:
BatchID := 1; // Any non-zero DWORD
BatchName := "KKS_TAG"; // STRING source from chart
7.3 Why this works for Status messages
The @1%s@ substring is resolved by the OS into the first associated value of the message frame. Because the message is generated with associated values included regardless of class, the placeholder renders the KKS even when the BatchID-driven header path is empty. Combined with a non-zero BatchID, the BatchName column also receives the value from the BatchName input, giving you both:
- A free-text KKS in the Event column (via
@1%s@). - The same KKS in the BatchName column (via the BatchName input + non-zero BatchID).
7.4 Bind the BatchName to a block-icon Header
Once the OS receives the populated header, you can reference the value via the standard WinCC online tag @BatchName or the picture-internal alias .BatchName on the block-icon faceplate. Configure the Header field as follows:
Header source: Process tag
Tag selection: <chart_path>\<block_name>.BatchName
8. Multilanguage Considerations
The PCS 7 text library stores a separate string per language for every BatchName-equipped field. When the BatchName is rendered on the HMI, the active project language is used. Symptom patterns observed in the field:
- KKS appears in English alarm log but is missing in the Russian view, or vice versa.
- Switching the runtime language back and forth toggles visibility of the value.
8.1 Diagnosis
- Open WinCC Explorer → Text Library.
- Search the Batch header namespace; verify that an entry exists for every active project language, not only for the source language.
- Compare translations. Identical-looking entries may differ in the underlying OEM text ID: PCS 7 uses an indexed scheme and a missing index means the fallback to English.
- Open the CFC message configuration and check whether the language toggle inside the CFC editor mirrors the OS text-library state.
8.2 Recommended fix
- Export the text library to CSV from the ES (Tool → Text Library → Export).
- For any batch-name entry with an empty Russian translation (or any other secondary language), fill in the missing row using the same KKS string. KKS codes are language-independent, so the value should be identical across languages.
- Re-import and compile the OS, including the Text Library regeneration.
9. AlarmControl Column Configuration
To verify that the OS expects a BatchName column, open WinCC Configuration Studio → AlarmControl → Column Configuration. The default PCS 7 project ships with these columns selected:
| Order | Column | Header text | Source |
|---|---|---|---|
| 1 | Date/Time | Date/Time | Frame Date/Time field |
| 2 | Event | Event | Alarm line text |
| 3 | BatchName | Batch | Message header BatchName |
| 4 | Acknowledgement | Acknowledgement | Single ACK state |
| 5 | Priority | Priority | Message priority byte |
| 6 | State | State | Frame state |
The fourth column is the one that fails to populate for Status messages in default projects. If you renamed it to KKS in the column header text, the OS still reads the same header field from the message frame, so the header label is independent of the source.
10. Verification
After applying any of the three workarounds, perform the following checks:
- Bring the OS to Runtime. Trigger a status message from a hand-rail block (for instance a
MotSpedLwith a forcedSP_EXTtransition). - Open the AlarmControl and confirm the BatchName / KKS column contains the expected STRING.
- Export the AlarmControl view to CSV and grep for the KKS code in the BatchName column for the triggered message.
- Open the message statistics (WinCC → Message Flow) and verify the associated value 1 in the Status message class also carries the KKS when Solution C is used.
- Switch the OS runtime language to every active language and confirm the BatchName column is still populated for all of them.
10.1 Acceptance Criteria
| Check | Expected value |
|---|---|
| BatchName cell populated for a generated Status message | KKS string, identical to the chart name |
Event column shows @1%s@ resolved |
KKS string, identical to BatchName |
| Block-icon Header field displays KKS | KKS string, identical to BatchName |
| CSV export BatchName column | KKS string in every Status row |
| Multilanguage switching | KKS visible in every language |
11. Troubleshooting Matrix
| Symptom | Likely cause | Action |
|---|---|---|
| BatchName empty for every message class | Missing BatchID wiring on the block, or BATCH license not active and no manual wiring |
Set BatchID = 1 at the block instance input |
| Empty only for Status messages | Status class shipped without BatchID mapping in message class table | Apply Solution A or C; never rely solely on the BPL default |
KKS truncated or wrong in $$AKZ$$
|
Plant View hierarchy inconsistent across OS servers | Re-run PCS 7 OS Project Editor; recompute hierarchy |
| Header text on block icon shows empty string | Tag reference points to @BatchName instead of the instance tag |
Change the faceplate header source to the instance tag path |
| KKS shown in English only | Missing translations in text library | Fill all language rows; recompile text library |
| BatchName appears once, then disappears on next message | BatchID was changed at runtime but BatchName was not | Always update BatchName together with BatchID |
| CSV log BatchName populated but AlarmControl UI blank | AlarmControl column configuration does not include the BatchName field | Add the column in WinCC Configuration Studio and re-deploy |
12. Field Notes and Caveats
-
One chart, one KKS: If your plant uses mixed-level hierarchies (different PH depths per unit), Solution A's
$$AKZ$$approach returns paths of different lengths, which is hard to filter in AlarmControl. Prefer Solution C when the PH depth varies. -
BATCH coexistence: When SIMATIC BATCH is licensed, the BATCH API overrides the manual
BatchIDvalue during batch execution. Use a high-numbered manual BatchID (e.g.,9999) only for non-BATCH messages to avoid collisions with the BATCH enum. -
S7-1500 / PCS 7 V9: Use
ALARM_8P_2instead ofALARM_8P. The associated-value placeholder syntax@1%s@is identical, but the input names areBATCH_IDandBATCH_NAME(uppercase) in the new block. - OS redundancy: When you have a redundant OS server pair, the text-library regeneration must be performed on both servers; otherwise, the Standby server may run with stale translations and reproduce the language-specific blank effect.
13. Related Documentation
Refer to the manufacturer documentation for the underlying behavior described in this article:
- SIMATIC PCS 7 - WinCC AlarmControl Configuration Manual
- SIMATIC PCS 7 - OS Configuration Guide
- PCS 7 Block Libraries - ALARM_8P Reference
- PCS 7 V9.0 Plant Configurator Manual
14. FAQ
Why is the BatchName column blank only for the Status Message - PLC class?
The PCS 7 standard message class table maps BatchID and BatchName header fields only for Process, Fault, and Operator classes. The Status / Information class is delivered with these header fields empty by default, so the OS dispatcher writes no BatchName into the message frame unless you wire a non-zero BatchID and a BatchName value at the ALARM_8P instance.
Does setting BatchID alone populate the BatchName column?
No. A non-zero BatchID only unlocks the header slot. You must also supply a STRING value to the BatchName input of the ALARM_8P block, otherwise the slot is unlocked but contains an empty string.
Can I just rename the alarm line to include the KKS without touching BatchID?
Yes, using @1%s@ in the event text with a KKS associated value will render the KKS in the Event column for every message class. However, the BatchName column will still remain blank unless you also provide a non-zero BatchID and BatchName value, because those are independent header fields.
Why does the KKS appear in English but not in other project languages?
The PCS 7 text library stores one entry per language, and the OS runtime renders only the entry that matches the active project language. If the secondary-language row is empty, the rendered cell is blank for that language. Fill every language row with the same language-neutral KKS string and recompile the text library.
How do I avoid editing BatchID on every block instance?
Build a chart-level derived STRING tag with the KKS and let every block in that chart read the same value through the OS picture-internal alias .BatchName. Combine this with a constant BatchID value (e.g., 1) using a CFC chart-level global variable. For large fleets, use the PCS 7 Plant Configurator bulk import to populate BatchID and BatchName from a CSV.