Decoding S7-300 CPU 317-2 PN/DP Diagnostic Buffer Hex Event IDs
A Siemens SIMATIC S7-300 CPU 317-2 PN/DP (order number 6ES7317-2EK14-0AB0 and earlier -AB0/-AK04 variants) maintains a non-volatile diagnostics buffer of up to 500 entries in its system data area. When the engineering station cannot resolve a hex event ID into a text message, the entry is rendered as "No entry in text database. Hexadecimal values will be displayed." This typically occurs when (a) the STEP 7 / TIA Portal version installed on the programming device does not contain a description for the firmware event class, (b) a custom application wrote a raw event using SFC 52 "WR_USMSG" without registering a corresponding text, or (c) the diagnostic interrupt originated from a PROFIBUS-DP slave whose GSD text is not loaded in the project. The first case is the most common in plants still running STEP 7 V5.5 against newer CPU firmware.
This reference decodes a real-world trace recorded on a CPU 317-2 PN/DP controlling an ET 200S distributed I/O station, explains the meaning of each hex field, and walks through the field-proven recovery sequence: power-cycle the failing DP station, replace the station if power cycling is not durable, and re-baseline the diagnostic buffer to confirm the fix.
1. Reading the Diagnostic Buffer
The diagnostics buffer is read online from the connected CPU. The procedure differs slightly between classic STEP 7 V5.x and TIA Portal but the underlying data record is identical.
1.1 STEP 7 V5.5 (classic)
- Open the SIMATIC Manager project containing the S7-300 station.
- Right-click the CPU 317-2 PN/DP in the component view and choose "Target System > CPU Messages > Diagnostics Buffer", or use the menu PLC > Diagnostics/Settings > Diagnostics Buffer.
- Set the time format to the plant's local time (the buffer stamps events in CPU real time, not PC time).
- Export the buffer to a
.txtor.csvfile using File > Save As for archival and ticket attachments.
1.2 TIA Portal V16 - V20
Connect online to the device, expand Online & Diagnostics, open the Diagnostics folder, and double-click Diagnostics buffer. The official Siemens procedure is documented at docs.tia.siemens.cloud — Reading out the diagnostics buffer of a CPU.
2. Anatomy of a Diagnostic Buffer Entry
Each entry in the buffer carries the following fields. The reference trace below is taken from the original fault.
| Field | Width | Source value | Meaning |
|---|---|---|---|
| Event ID | 16 bit | 16#A1F2 | Identifies the event class and sub-event |
| OB | 16 bit | 16#01 | OB number that was active when the event was raised (OB 1 = cyclic) |
| PK | 16 bit | 16#01 | Priority class / source flag for the event |
| DatID 1 | 16 bit | 16#59 | High word of the 32-bit DatID |
| DatID 2 | 16 bit | 16#C9 | Low word of the 32-bit DatID |
| Additional info 1 | 16 bit | 16#0002 / 16#000D | Event-specific parameter 1 |
| Additional info 2 | 16 bit | 16#0000 | Event-specific parameter 2 |
| Additional info 3 | 16 bit | 16#0003 | Event-specific parameter 3 |
3. Decoding the A1Fx Event ID Family
On S7-300/400 CPUs the diagnostics buffer uses a hierarchical 16-bit event ID. The high byte (A1 in this trace) identifies the event class; the low byte identifies the specific event within that class. Event class A1 is reserved for PROFIBUS-DP / PROFINET diagnostic interrupts raised by the CPU's integrated DP master / PN controller when processing a slave diagnostic frame.
| Event ID | Class | Plain-text meaning | Typical trigger |
|---|---|---|---|
| 16#A1F1 | DP diagnostic | Diagnostic interrupt incoming from a DP slave (OB 82 trigger) | Slave reports a channel or module fault |
| 16#A1F2 | DP diagnostic | Diagnostic interrupt removed (OB 82 trigger, going event) | Fault condition cleared at the slave |
| 16#A1F3 | DP diagnostic | Module change (drag & plug) detected on DP slave | IM 151 reports slot reconfiguration |
| 16#A1F4 | DP diagnostic | Return of submodule / module to OK state | Module plugged back into ET 200S |
| 16#A1F5 | DP diagnostic | Process interrupt (alarm) from DP slave | OB 40 / OB 55-57 trigger |
| 16#A1F6 | DP diagnostic | Status interrupt from DP slave | Operating mode change at the slave |
| 16#A1F7 | DP diagnostic | Update interrupt from DP slave | Slot/channel descriptor changed |
| 16#A1F8 | DP diagnostic | Vendor-specific interrupt (interrupt from manufacturer) | Application-specific alarm from ET 200S module |
The events captured in the reference trace are reconstructed below in chronological order (older events at the bottom):
| Time | Event ID | DatID | Add1 | Add2 | Add3 | Direction |
|---|---|---|---|---|---|---|
| 09:48:56.655 | 16#A1F6 | 16#59C9 | 16#000D | 16#0000 | 16#0003 | Incoming |
| 09:48:56.683 | 16#A1F7 | 16#59C9 | 16#000D | 16#0000 | 16#0003 | Incoming |
| 09:48:57.935 | 16#A1F8 | 16#59C9 | 16#000D | 16#0000 | 16#0003 | Incoming |
| 09:48:57.987 | 16#A1F1 | 16#59C9 | 16#000D | 16#0000 | 16#0003 | Incoming |
| 09:48:59.626 | 16#A1F2 | 16#59C9 | 16#0002 | 16#0000 | 16#0003 | Incoming |
Pattern analysis: at 09:48:56.655 the slave first issues a status interrupt (A1F6) followed by an update interrupt (A1F7) and a vendor interrupt (A1F8), all carrying the same DatID 16#59C9. About 1.3 seconds later the CPU raises the OB 82 incoming diagnostic interrupt (A1F1), and roughly 1.6 seconds after that the OB 82 going event (A1F2) with a different Additional info 1 (16#0002 instead of 16#000D) is registered. This sequence is the textbook signature of a DP slave briefly losing bus communication, the internal IM 151 re-establishing the link, and the OB 82 diagnostic interrupt being raised and then cleared.
4. Decoding DatID 16#59C9
The 32-bit DatID is split into two 16-bit halves. For PROFIBUS-DP events raised by the integrated DP master of the CPU 317-2 PN/DP, the high word is the slot / channel identifier class and the low word is the device-specific error code.
- High word 16#0059 — slot 89 (decimal). On a 1-slot IM 151-1 this is the interface module itself; on a multi-slot ET 200S it points to a power module (PM-E) or the IM 151 head. Slot 89 also matches the address of the first DO/DI module in many default ET 200S configurations.
- Low word 16#00C9 — 201 decimal. In the Siemens DPV1 diagnostic data set this code corresponds to "Station diagnostic: short circuit / overload on the backplane bus or on a module supply".
5. Decoding Additional Info Fields
| Field | Value | Decoded meaning for class A1 |
|---|---|---|
| Add1 = 16#000D | 13 decimal | Channel error identifier: "Short circuit" (per EN 61131-2 / IEC 61784) at the channel or module level |
| Add1 = 16#0002 | 2 decimal | Channel error identifier: "Overload" (24 V output driver or sensor supply) |
| Add2 = 16#0000 | 0 | Reserved / not used for this event class |
| Add3 = 16#0003 | 3 | Number of the channel that triggered the alarm (channel 3 on the failing module) |
So the trace reads, in plain English: "A diagnostic interrupt was raised by ET 200S slot 89, channel 3: first a short circuit (16#000D) was reported; roughly two seconds later the same channel reported an overload (16#0002) which then cleared."
6. Why STEP 7 Cannot Resolve the Text
Three technical reasons produce the "No entry in text database" message:
- STEP 7 version older than the CPU firmware. The CPU 317-2 PN/DP ships firmware V3.x. The text database for class A1 (DP diagnostic) was last extended in STEP 7 V5.5 + SP4 + HF7. STEP 7 V5.4 cannot resolve A1F6 / A1F7 / A1F8 because those event codes were introduced in a later DP master firmware build.
- Missing GSD file for the slave. The text shown when DatID 16#59C9 is decoded includes a reference to the module's GSD revision. If the project was built with a GSD that pre-dates the installed ET 200S IM 151 firmware, the text lookup fails.
- Application called SFC 52 "WR_USMSG" without a registered text. The user's own program wrote a user diagnostic entry to the buffer using SFC 52 with EventID = W#16#A1F2 etc., bypassing the system text database. SFC 52 allows arbitrary 16-bit EventIDs in the range 16#A000 - 16#AFFF for user-defined messages; if no text is registered for that ID in the CPU's user text library the buffer shows the raw hex.
7. SFC 52 "WR_USMSG" — Anatomy and Risk
SFC 52 "WR_USMSG" is the system function used to write a user-defined diagnostic buffer entry. Its signature is:
// SFC 52 - WR_USMSG - Write user element in diagnostic buffer
// Block number: 52
// Family: Base S7-300/400 system function
VAR_INPUT
REQ : BOOL; // FC 0/1: write on rising edge
EVENTID : WORD; // Event ID, e.g. W#16#A1F2
OB_NUMBER: INT; // OB number active at time of call (e.g. 1)
BUFFER : ANY; // Pointer to data buffer with additional info
DATA_LEN: INT; // Length of data buffer in bytes
END_VAR
When called from OB 1 (as in the captured trace) the parameters OB_NUMBER = 1, EVENTID = W#16#A1F2, and the data buffer filled with 16#0002 0000 0003 produce an entry that is visually indistinguishable from a genuine DP diagnostic interrupt. Operators reading the buffer later cannot tell whether the message came from the DP master or from the user program. This is a common maintenance trap.
8. Field-Proven Root Cause and Recovery
8.1 Initial power-cycle fix
Removing and re-applying the 24 V supply to the ET 200S head module (IM 151-1, order number 6ES7151-1AA04-0AB0) forces the station to re-enumerate on the bus. The CPU's DP master detects the station again, clears the OB 82 diagnostic interrupt, and writes the A1F2 going event to the buffer. This explains why the operator saw a self-healing recovery the first time the fault occurred.
8.2 Recurrence and final fix
When the same station failed a few hours later with BF (bus fault) and SF (system fault) LEDs blinking together on the CPU, a power cycle was no longer sufficient. The combination of BF + SF on a CPU 317-2 PN/DP points to a permanent DP slave failure that the master cannot recover automatically. The corrective action was to replace the entire ET 200S station (head module + power module + I/O modules) and re-terminate the PROFIBUS connector at the upstream T-piece. After replacement the diagnostic buffer remained clean.
9. Step-by-Step Recovery Procedure
- Export the diagnostics buffer to a file before any change. Use PLC > Diagnostics/Settings > Diagnostics Buffer in STEP 7 V5.5 or the online diagnostics view in TIA Portal.
- Decode the Event ID, DatID, and Add1/Add3 using the tables in Sections 3-5 of this article. Build a chronological timeline in a spreadsheet.
- Identify the failing slave by looking at the DP diagnostics structure in the buffer; the slot field (Add3 or low byte of DatID1) maps to the slot number configured in the DP slave properties.
- Inspect the slave physically: 24 V supply at PM-E terminals, PROFIBUS connector screws, terminating resistor position (ON only at the two physical ends of the bus segment), and any channel that Add3 pointed to.
- Measure the backplane current on the ET 200S station. ET 200S supports up to 5 A of 24 V backplane load; an overloaded PM-E will drop out and cause the symptoms seen above.
- Power-cycle the station by removing and re-applying 24 V to the PM-E. Observe whether the buffer registers a clean A1F2 going event.
- If the fault returns, replace the entire ET 200S station rather than individual modules. The A1F8 vendor interrupt with DatID 16#59C9 typically indicates internal power-supply degradation of the head module, which is not reliably field-repairable.
- After replacement, force an OB 82 scan by issuing PLC > Clear/Reset > Diagnostic Buffer or by performing a CPU restart (RUN -> STOP -> RUN). Monitor the buffer for at least 24 hours.
10. Verification Checklist
| Check | Pass criterion |
|---|---|
| BF LED on CPU 317-2 PN/DP | Off |
| SF LED on CPU 317-2 PN/DP | Off |
| BF / SF LEDs on the ET 200S IM 151 | Off (steady ON for "online" link LED is acceptable) |
| 24 V at PM-E terminals | 23.0 - 25.0 V DC under load |
| PROFIBUS terminating resistor | ON at both physical ends, OFF at all intermediate nodes |
| Diagnostic buffer growth over 24 h | Zero new A1Fx entries for the replaced station |
| OB 82 load (if monitored) | No additional invocations beyond the last going event |
| Process image consistency | PIW / PQW values match expected state in WinCC / HMI |
11. Preventive Measures
- Keep STEP 7 and TIA Portal up to date. Install the latest Hotfix for STEP 7 V5.5 or upgrade to TIA Portal V18 / V19 / V20. The diagnostic text database is refreshed with each service pack.
- Install the latest GSD files for every PROFIBUS slave in the project. Re-import the GSD whenever the IM 151 or PM-E is replaced with a newer firmware revision.
- Size the PM-E correctly. Sum the worst-case 24 V consumption of every downstream module and derate by 25%. If the sum exceeds 5 A, add a second PM-E segment.
- Use a dedicated 24 V power supply for the ET 200S stations rather than daisy-chaining off the CPU's sensor supply. Voltage drop under a short event is the most common cause of the A1F8 + 16#000D signature.
- Reserve the A1Fx event ID range for the operating system and use a different range (e.g. 16#A101 - 16#A1FF mapped via SFC 52) for application messages.
- Enable OB 82 and OB 86 in the CPU's hardware configuration. Without OBs the CPU will go to STOP on a DP diagnostic interrupt, masking the root cause.
- Add a periodic diagnostic buffer dump to the maintenance routine: a SFC 59 / SFB 4 transfer of the buffer to a CSV file on the engineering station every 7 days.
12. Cross-Reference: S7-300 vs S7-1500 Diagnostics
On an S7-1500 CPU the diagnostics buffer uses a similar 16-bit event ID, but the A1xx class has been restructured. PROFINET IO diagnostic events in S7-1500 use class 0xA0xx and are resolved automatically from the GSDML. If the application is being migrated, the S7-300 trace in this article maps to the following S7-1500 event IDs:
| S7-300 Event | S7-1500 equivalent | Source |
|---|---|---|
| 16#A1F1 (DP diag in) | 0xA001 / 0xA0C3 | PROFINET IO diagnostic interrupt, channel-level |
| 16#A1F2 (DP diag out) | 0xA002 / 0xA0C4 | Diagnostic interrupt going |
| 16#A1F8 (vendor) | 0xA0B0 | Vendor-specific interrupt |
The decoding logic for the DatID and Additional info fields differs; refer to the S7-1500 system diagnostics manual (Siemens entry ID 109478691) when migrating.
FAQ
What does the A1F2 event ID mean on a CPU 317-2 PN/DP?
16#A1F2 is the "diagnostic interrupt removed" (OB 82 going) event raised by the integrated DP master. It signals that a previously reported DP slave fault has cleared. Combined with 16#A1F1 (incoming) and a 32-bit DatID such as 16#59C9 it indicates a recoverable channel-level short circuit or overload on the referenced ET 200S module.
Why does my STEP 7 installation show "No entry in text database" for A1F6, A1F7, and A1F8?
These event codes were added to the CPU 317-2 PN/DP firmware in V3.x and require STEP 7 V5.5 + SP4 or later (or TIA Portal V13 or later) to resolve the text. If the engineering station still runs STEP 7 V5.4, upgrade to V5.5 + SP4 + HF7 or later and reinstall the S7-300 family support. The diagnostics buffer entry itself is intact — only the on-screen text is missing.
How do I decode DatID 16#59C9 in the diagnostic buffer?
For class A1 events DatID is a 32-bit word where the high word (16#0059) encodes the slot number 89 and the low word (16#00C9 = 201 decimal) encodes the diagnostic code 201: "Station diagnostic, short circuit / overload on the backplane bus or module supply". Confirm the location by reading the Add3 field (channel 3 in the example) and measure the 24 V supply at the indicated ET 200S PM-E terminal.
Can a user program inject A1Fx events into the buffer with SFC 52?
Yes. SFC 52 "WR_USMSG" accepts any 16-bit EventID in the user range 16#A000-16#AFFF. If the application uses 16#A1Fx IDs without registering the corresponding text, the buffer displays the raw hex. Best practice is to reserve 16#A1Fx for the operating system and use 16#A101-16#A1FF with a registered user text for application messages.
When should I replace an ET 200S station versus individual modules?
Replace the entire station when the diagnostics buffer shows repeating A1F8 vendor interrupts with DatID low word 16#C0-16#CF that recur after a power cycle. This signature indicates degradation of the head module (IM 151) or PM-E power section. Field-replaceable individual modules should only be attempted when the A1F8 carries a DatID low word > 16#D0, which points to a specific channel or I/O module rather than the head.