Problem Overview: S7-300 CPU STOP on I/O Access Error
A SIMATIC S7-300 (or S7-400) CPU transitions to STOP immediately when an I/O access error occurs during program execution, even if OB 85 is present in the project. The classic symptom is a CPU in STOP mode, an SF (system fault) LED lit, and a diagnostic buffer entry around event ID 16#4563. The engineer's expectation is that OB 85 — long taught as "the error OB" — should mask the fault and keep the CPU in RUN. That expectation is wrong: OB 85 and OB 122 serve different trigger conditions, and only one of them is fired by a direct I/O access error.
This article rebuilds the correct mental model around the two organization blocks, walks through the diagnostic buffer interpretation for event ID 16#4563, and provides a STEP 7 / TIA Portal procedure that prevents the CPU from going to STOP on distributed I/O faults. Real references from Siemens documentation are linked inline; do not rely on training material that conflates OB 85 and OB 122.
Root Cause: OB 85 and OB 122 Are Not Interchangeable
The training material that circulated widely taught that "OB 85 prevents CPU STOP on I/O access error." That statement is partially correct only if you read it carefully. The CPU operating system fires OB 85 for one class of faults and OB 122 for another. A diagnostic buffer that lists event 16#4563 after a STOP indicates an I/O access error — the precise event class handled by OB 122, not OB 85.
| Attribute | OB 85 (Program Execution Error OB) | OB 122 (I/O Access Error OB) |
|---|---|---|
| Trigger class | Fault during process image update by the system; update of a process image that does not exist; fault when an OB that has not been loaded is called | Synchronous error while the user program reads/writes an I/O module directly |
| Fault origin | Cyclic process image update (background of the operating system) | Direct I/O instruction (L / T / direct bit/byte/word access) in OB1, FB, FC, etc. |
| Default CPU behavior if OB is missing | CPU goes to STOP | CPU goes to STOP |
| Typical diagnostic event ID |
16#35xx range (e.g. 16#3501, 16#3502, 16#3505) |
16#4563 (and surrounding entries in the 16#45xx group) |
| Module context available | Partial — depends on event | Full — start information contains the slot and the address that failed |
| Common misapplication | Loaded as a generic "fault OB" by junior programmers | Forgotten, or left out of the project entirely |
The CPU differentiates the two fault classes internally. The operating system schedules OB 85 asynchronously (when the background OB1 cycle tries to refresh the process image and the slave is gone). OB 122 is scheduled synchronously — it is invoked immediately when the offending load/transfer instruction executes, before the next network is processed.
OB 85 Detailed Function and Trigger Conditions
Per the Siemens functional description of S7-300/400 CPUs, the CPU operating system calls OB 85 whenever one of the following events occurs:
- An I/O access error during update of the process image by the system.
- An error when the operating system attempts to update a process image that is not configured.
- A fault when an OB that is required but not loaded is called (for example, OB 121 missing in a fault path).
- Errors when an OB is started that does not exist on the CPU (e.g., missing OB 10 for a time-of-day interrupt).
OB 85 does not trigger for every slave failure. It triggers specifically when the operating system itself is performing the I/O update — i.e., the cyclic process image refresh. If the failure is detected in user code via a direct L/T access, the CPU does not consult OB 85; it consults OB 122.
For S7-300, OB 85 has local temp bytes that identify the event. The OB85_FLT_ID byte (in the start information / temp area of OB 85) tells you which subclass of fault triggered the OB. Common values include:
OB85_FLT_ID |
Meaning |
|---|---|
B#16#A0 |
Update of the process image by the system failed because the module / DP slave is faulty. |
B#16#A1 |
Update of the process image by the system failed because the module / DP slave has returned. |
B#16#A2 |
Update of the process image by the system failed because the module / DP slave does not exist (slot empty or not configured). |
B#16#B0 / B#16#B1 / B#16#B2
|
Process image update failure for an OB that was started but did not finish correctly. |
B#16#3A |
An OB was started that does not exist on the CPU (e.g., missing time-of-day OB). |
Reference: Siemens STEP 7 Professional V14.0 — OB 85 documentation and OB 85 call on a distributed I/O access error (DAE) — TIA Portal docs.
OB 122 Detailed Function and Trigger Conditions
OB 122 is the synchronous fault OB the operating system calls whenever an error occurs while the user program is reading or writing data directly on a module. This includes:
- Load instructions (L PEW, L PED, L PIB) against a slot that has failed or is missing.
- Transfer instructions (T PAW, T PAD, T PQB) to a failed or missing module.
- Symbolic accesses via %I / %Q to a PROFIBUS DP slave that has dropped off the bus.
- Accesses to analog value status bytes when the analog module has returned a diagnostic interrupt.
OB 122 contains the following relevant start information (temporary local data):
| Local byte / variable | Meaning |
|---|---|
OB122_SW_FLT |
Software fault identifier (typically B#16#42 for read, B#16#43 for write, B#16#44 for byte/word/DWord consistency fault). |
OB122_BLK_TYPE |
Block type of the block where the error occurred (OB/FB/FC/DB). |
OB122_BLK_NUM |
Block number of the block where the error occurred. |
OB122_PRG_ADDR |
Address in the user program (relative to the block start) of the failing instruction. |
OB122_MEM_AREA |
Memory area accessed (1 = process input, 2 = process output). |
OB122_MEM_ADDR |
Byte address within the memory area that failed (the byte offset inside the PII / PIQ). |
OB122_LEN |
Length of the access (1, 2, or 4 bytes). |
OB122_POINT_ADDR |
Logical base address of the module that caused the fault (the I/O address from HW Config). |
Reference: Siemens TIA Portal documentation — I/O access error organization block (OB 122) for S7-300/S7-400.
Diagnostic Buffer: Interpreting Event ID 16#4563
Event ID 16#4563 in the S7-300/S7-400 diagnostic buffer is the "I/O access error" entry. It is generated when the CPU detects an I/O access error and writes the relevant module, address, and OB information to the diagnostic buffer. In practice you will see entries such as the following after a CPU STOP on a PROFIBUS DP slave failure:
Event 1 16#4563 I/O access error when reading
Event 2 16#4303 Mode transition from RUN to STOP
Event 3 16#3501 OB 85 not loaded, process image update error
Event 4 16#3942 Module fault / station failure on DP master system 1
16#4563 is the proximate cause.The event class for OB 122 faults is 16#4563; the event class for OB 85 faults on the process image is typically in the 16#35xx group. Distinguishing the two is the first diagnostic step. If you only see 16#4563 entries and your project contains OB 85 but no OB 122, that is your smoking gun: the CPU needed OB 122, did not find it, and went to STOP.
Decision Flow: Which OB Does Your Fault Trigger?
Step-by-Step Resolution
The resolution is to insert OB 122 into the project (and verify the OB 85 DAE setting if PROFIBUS DP is in use). The OB itself needs no logic — an empty OB is sufficient to prevent the CPU from going to STOP on the fault class it covers. You can later add diagnostic or setpoint substitution code inside it.
Prerequisites
- STEP 7 V5.5 / V5.6 (classic) or TIA Portal V14 / V15 / V16 / V17 / V18 / V19 / V20 installed.
- The S7-300 / S7-400 project with online access to the CPU (MPI / PROFIBUS / Ethernet).
- PLC password if the project is write-protected online.
- The S7 program must be in a STOP-or-deferred state if you intend to do a full download; for incremental changes a "download to target device" of just the new OB is sufficient while the CPU is in STOP.
Procedure in STEP 7 V5.x (Classic)
- Open the S7 project in SIMATIC Manager.
- Right-click the Blocks container in your S7 program. Select Insert New Object > Organization Block.
- In the dialog, choose OB122 from the list and confirm. A stub block opens.
- Save and compile the project. OB122 is now present in the offline program.
- Connect online (PLC > Connect to Target System). Select the CPU and download the block. Use Download (not "Download to Target Device" with stop/start if you want to keep the CPU in STOP for safety).
- Switch the CPU to RUN. Verify that the SF LED clears and that the diagnostic buffer no longer shows
16#4563followed by a STOP event.
Procedure in TIA Portal (S7-300/400 target)
- Open the project in TIA Portal. In the project tree, navigate to Program blocks.
- Double-click Add new block. Under Organization blocks, select OB122 — I/O access error.
- Accept the default empty OB and save the project.
- Go online. Right-click the new OB122 block in the project tree and select Download to device > Software (only changes).
- Confirm the download. TIA Portal reports the new OB on the target.
- Run the CPU. Check the diagnostic buffer for the original event
16#4563and confirm it no longer produces a STOP.
Optional STL snippet inside OB122 (informational logging)
// OB 122 — I/O access error handler (STL)
// Latches fault info into DB99 for offline analysis.
L #OB122_SW_FLT // B#16#42 read, B#16#43 write
T DB99.DBB 0
L #OB122_MEM_AREA // 1 = PI, 2 = PQ
T DB99.DBB 1
L #OB122_MEM_ADDR // byte offset in PII/PIQ
T DB99.DBW 2
L #OB122_POINT_ADDR // logical base address of module
T DB99.DBW 4
L #OB122_LEN // 1, 2, or 4
T DB99.DBB 6
L #OB122_BLK_TYPE // block type of failing block
T DB99.DBB 7
L #OB122_BLK_NUM // block number
T DB99.DBW 8
SET // DO NOT RAISE — keep CPU in RUN
SAVE
BEU
This snippet is illustrative. The exact local variable names in TIA Portal may be SW_FLT, MEM_AREA, etc., depending on the generated interface. The principle is the same.
Distributed I/O (DAE) Configuration: OB 85 Call Behavior
If your project uses PROFIBUS DP (the user's case is a PROFIBUS-connected drive), there is an additional CPU-level setting that controls how aggressively OB 85 is invoked. According to the Siemens functional description, you should configure OB 85 calls only for incoming and outgoing errors, otherwise the CPU will fire OB 85 on every scan cycle in which the slave is still missing, which can quickly overload the OB 85 priority class and degrade the cycle time.
Where to find the setting
- STEP 7 V5.x: In HW Config, open the CPU properties → Cycle/Clock Memory tab → OB 85 Call for I/O Access Errors dropdown. Choose "Only for incoming and outgoing errors".
- TIA Portal: In the device view, open the CPU properties → Cycle time / OB 85 call on distributed I/O access error. Select the same option.
| Setting | OB 85 call frequency | Recommended for |
|---|---|---|
| "On each access to a non-existent/faulty module" | Every scan cycle — high CPU load | Diagnostic / development rigs only |
| "Only for incoming and outgoing errors" (default for most production CPUs) | Once when fault starts, once when fault clears | Production lines, drives, motion systems |
| "None / disabled" | Never — CPU goes to STOP on any DAE | Not recommended unless you have a higher-level watchdog |
Reference: OB 85 call on a distributed I/O access error (DAE) — S7-300/S7-400.
Verification Procedures
After inserting OB 122 (and configuring OB 85 DAE behavior if applicable), verify the fix on the live system:
- Diagnostic buffer: Clear the buffer (PLC > Clear/Reset Diagnostic Buffer). Power-cycle the DP slave or pull its PROFIBUS connector. Confirm that an OB 122 entry appears in the buffer but no STOP transition is recorded.
- CPU mode: The CPU stays in RUN with the SF LED lit. This is correct — OB 122 handles the fault, the CPU does not stop.
- Process behavior: Your application logic should treat the substituted input as "stale." If the drive was reading a process value (e.g., actual velocity) from the failed slave, the OB 122 should set a substitute value or freeze the last good value; do not allow the program to act on garbage.
- Fault clearing: Restore the slave. Verify that an "incoming/outgoing fault" pair is recorded and that no follow-on faults accumulate in the buffer.
- Watchdog check: If OB 122 is called frequently (e.g., on a hot loop reading a faulty input), monitor OB1 cycle time — large amounts of OB 122 traffic can inflate the cycle time and approach the watchdog.
Troubleshooting Matrix
| Symptom | Diagnostic buffer event | Likely root cause | Fix |
|---|---|---|---|
| CPU STOP after slave drop, OB 85 in project |
16#4563, no OB 122 entry |
OB 122 missing — project has OB 85 only | Insert OB 122, download |
| CPU STOP on first access after restart, OB 85 and OB 122 in project |
16#4563 followed by STOP |
OB 122 block not actually downloaded to the target CPU | Verify with PLC > Accessible Nodes that OB 122 exists online |
CPU STOP when PROFIBUS slave fails but no 16#4563 in buffer |
16#3501, 16#3502
|
OB 85 missing — fault is on process image update, not direct access | Insert OB 85, set DAE to "only incoming/outgoing" |
| CPU runs but cycle time blows up after slave failure | OB 85 called every cycle | DAE setting left at "every access" | Change CPU property to "only incoming and outgoing errors" |
CPU STOP with 16#3570 or 16#39xx entries only |
Module/station fault | Wiring, terminating resistor, slave address conflict | Inspect PROFIBUS cable, terminators, slave GSD file consistency |
| OB 122 present but not called on fault | Fault on input mapped to process image | Access is via PI (process image), not direct I/O — OB 122 not triggered; OB 85 expected | Add OB 85 or change code to direct I/O read |
| CPU STOPs after I/O fault on ET200S / ET200M / ET200pro |
16#4563 + station failure |
OB 122 not in program; OB 85 DAE misconfigured | Add OB 122, set DAE to incoming/outgoing only |
CPU STOP with 16#3582 after firmware update |
PROFINET IO controller diagnostic | Different firmware handling; PROFINET I/O has its own OBs | Add OB 82 (diagnostic interrupt) and OB 122 for direct access |
Safety and Engineering Considerations
Masking I/O faults with an empty OB 122 is appropriate for non-safety faults on non-safety-critical I/O. For safety-related I/O (F-CPU, fail-safe DP slaves, PROFIsafe), the fault handling rules are different and you must follow the safety program documentation from the F-library (Distributed Safety, F-Configuration Pack). A bare empty OB 122 on a safety program is almost always a violation of the safety validation.
For motion applications (the user's PROFIBUS drive case), best practice is to:
- Insert OB 122 with a substitute-value strategy (e.g., zero speed command, last good actual value) so the drive receives a defined state.
- Trip the drive via a separate safety path (STO, hard-wired E-stop) — do not rely on PLC-side fault masking for safety.
- Configure OB 85 DAE to "only incoming and outgoing" so the CPU cycle time is not consumed by repeat OB 85 calls.
- Wire the slave status word to a diagnostic DB so the engineering team can correlate OB 122 events with drive alarms.
Quick Reference Summary
- OB 85 ≠ I/O access error OB. OB 85 handles faults during system process image update.
- OB 122 = the actual I/O access error OB for direct read/write access.
- Diagnostic event
16#4563= I/O access error class — needs OB 122. - Diagnostic event
16#35xx= process image update error — needs OB 85. - An empty OB is enough to keep the CPU in RUN; logic inside the OB is optional.
- For PROFIBUS DP / PROFINET IO, also configure the OB 85 DAE call behavior to "incoming and outgoing errors only."
- Always cross-check the diagnostic buffer after the fix — no
16#4563-induced STOP transitions should remain.
What is the difference between OB 85 and OB 122 in S7-300 / S7-400?
OB 85 is called when the CPU operating system itself fails to update the process image (e.g., a DP slave dropped out during the background update). OB 122 is called synchronously when the user program executes a direct I/O instruction (L PEW, T PAW, symbolic %I/%Q) against a failed module. They cover different fault classes — you typically need both.
Why does my S7-300 CPU go to STOP even though OB 85 is loaded?
The fault is almost certainly an I/O access error triggered by a direct L/T instruction in your user program. OB 85 does not catch direct-access faults; OB 122 does. Insert OB 122 into the project, download to the CPU, and verify the diagnostic buffer no longer shows event 16#4563 followed by a STOP transition.
What does diagnostic buffer event 16#4563 mean on S7-300 / S7-400?
Event 16#4563 is the "I/O access error" class. It is written when the CPU detects an error during a direct I/O access and indicates that OB 122 is the appropriate handler. If OB 122 is not loaded, the CPU transitions to STOP after this event.
Do I need to write any code inside OB 122 to prevent the CPU from going to STOP?
No. An empty OB 122 is sufficient to keep the CPU in RUN on a direct I/O access error. You only need to add code if you want to log the fault, substitute values, or take specific action. The local variables of OB 122 (SW_FLT, MEM_AREA, MEM_ADDR, POINT_ADDR, BLK_NUM, etc.) are available for diagnostic logic.
How should I configure OB 85 calls for distributed I/O on PROFIBUS DP?
In the CPU properties (HW Config in STEP 7 V5.x, or device view in TIA Portal), set the OB 85 call behavior to "Only for incoming and outgoing errors." This avoids OB 85 being called every cycle while a slave is missing, which would inflate the OB1 cycle time and risk the watchdog. See the Siemens functional description for S7-300/400 CPUs.