1. Problem Statement
When a Profibus DP slave is physically disconnected, powered down, or stops responding on a Siemens SIMATIC S7 master, the central processing unit (CPU) typically transitions from RUN to STOP with the diagnostic LED pattern BUSF (Bus Fault) lit solid on the CPU or CP (Communications Processor) front panel. The diagnostic buffer of the CPU records a Rack Failure or Station Failure event with the slot number of the affected DP slave, and the user program halts immediately. This behavior interrupts the entire machine or process and is one of the most common reasons for unplanned downtime in brownfield Profibus networks.
The default behavior is intentional: Siemens designs S7-300/400 CPUs to enter STOP on asynchronous errors that threaten the integrity of the I/O image, because continuing to execute a program with stale, missing, or undefined process data is more dangerous than a controlled shutdown. For processes that must keep running (or for diagnostic systems that need to log and isolate the fault), the engineer must load the appropriate Error Organization Blocks (OBs) into the CPU. Once the relevant OB exists in the active program—even if it is empty—the CPU stays in RUN and calls that OB when the matching error class occurs.
2. Root Cause Analysis
Profibus DP slave loss is detected by the DP master through a watchdog timer on each slave's diagnostic telegram. When the master does not receive a valid response within the configured Slot_Time × Watchdog window, it marks the slave as failed and raises an asynchronous error to the CPU. The CPU consults its error OB dispatch table:
- Is the matching error OB loaded and valid? → call it, stay in RUN.
- Is the OB missing, corrupt, or in a non-restartable state? → transition to STOP, write the event to the diagnostic buffer, and set the corresponding fault LED.
For a Profibus slave that disappears, the error class is OB 86 – Rack Failure (for ET 200M/ET 200S modular stations) or sometimes OB 82 – Diagnostic Interrupt (for compact slaves that report a diagnostic event before going silent). If the master itself detects the lost frame and the slave's I/O addresses are accessed in the user program, the next access can additionally raise OB 122 – I/O Access Error. All three OBs are typically required to keep the CPU fully operational through a slave drop.
Common root causes in the field:
- Profibus connector not seated, terminating resistor missing at end-of-segment, or shield drain wire not clamped to the connector housing.
- Slave 24 V supply dropped below 20.4 V (S7-300 / ET 200 minimum per Siemens SIMATIC S7-300 System Manual).
- Slave address duplicated on the segment, causing bus contention and watchdog timeouts.
- Baud rate mismatch between master and slave (Profibus must run at the lowest slave-supported rate—auto-detect via STEP 7 HW Config helps avoid this).
- Cumulative segment length exceeding the spec for the chosen baud rate (e.g., 1,200 m at 9.6 kbps but only 100 m at 12 Mbps per IEC 61158-2 / Profibus EN 50170).
- Slave firmware bug or GSD file mismatch after a hardware replacement.
- EMC interference on long cable runs routed parallel to VFD output cables—mandatory separation ≥ 200 mm and use of fiber-optic OLM/OLP for runs > 50 m near VFDs.
3. Siemens Error OB Architecture
The S7-300/400 error OB model is event-driven. Each asynchronous error OB covers a specific fault class, and the priority is fixed. Synchronous error OBs (OB 121, OB 122) fire during program execution when a specific instruction fails.
| OB Number | Name | Triggering Event | Priority | Effect if OB Missing |
|---|---|---|---|---|
| OB 81 | Power Supply Failure | Backup battery / 24 V failure on CPU or IM | 2/26 | CPU → STOP |
| OB 82 | Diagnostic Interrupt | Slave enters/leaves diagnostic state, channel fault | 5/28 | CPU → STOP |
| OB 83 | Remove/Insert Interrupt | Hot-swap of a module or station | 6/28 | CPU → STOP |
| OB 84 | CPU Hardware Fault | Memory parity error, MPI/DP interface hardware fault | 3/27 | CPU → STOP |
| OB 85 | Program Execution Error | Update OB for I/O that has failed; OB not yet loaded | 5/28 | CPU → STOP |
| OB 86 | Rack / Station Failure | Profibus slave, Profinet device, or expansion rack drops out | 4/26 | CPU → STOP |
| OB 87 | Communication Failure | Global data comms failure, bad SFB call parameters | 7/26 | CPU → STOP |
| OB 88 | Communication Failure (extended) | STOP on S7-400 after OB 87 also missing | 28 | CPU → STOP |
| OB 121 | Programming Error | DB not loaded, indirect addressing range error | Priority of OB that called the instruction | CPU → STOP |
| OB 122 | I/O Access Error | Access to a failed or missing slave's I/O area | Priority of OB that called the instruction | CPU → STOP |
For a Profibus slave disconnect the minimum required set is OB 86 + OB 122. In practice, add OB 82 and OB 85 as well, since slave dropouts often cascade through several of these classes in sequence (diagnostic interrupt → station failure → next I/O access raises OB 122). All four can be loaded as empty blocks; this is the standard field expedient to keep the CPU running while the maintenance crew locates the physical fault.
4. Prerequisites
Before implementing the fix, verify the following:
- STEP 7 V5.5 + SP2 (or TIA Portal V13 SP1 / V14 / V15 / V16 / V17 for S7-1200/1500 projects) installed and licensed.
- CPU firmware version is current. S7-300 CPUs at firmware ≤ V2.x have known issues with diagnostic OB dispatch; upgrade to the latest firmware available in the Siemens Online Support portal—search by CPU order number (e.g., 6ES7315-2EH14-0AB0 for CPU 315-2 PN/DP).
- You have the hardware catalog (HW Config) GSD files for every Profibus slave imported.
- An MPI/Profibus PC adapter (PC Adapter USB A2, 6GK1571-1AA00) or Ethernet routing into the CPU for online download.
- The current program archive is backed up (TIA: Project → Archive; STEP 7 V5.5: File → Archive).
5. Step-by-Step: Loading Empty Error OBs in STEP 7 V5.5
The fastest field fix is to add the four empty error OBs into the S7 program and download only the block container.
- Open the S7 project in SIMATIC Manager. Expand the
S7 Programnode and thenBlocks. - Right-click the empty area in the right pane and select Insert New Object → Organization Block.
- In the dialog, set OB Number = 86 and confirm. STEP 7 opens the LAD/STL/FBD editor with a new, empty OB 86.
- Close the editor without adding any code. A new empty OB contains only the OB header and the
BE(Block End) instruction inserted by the compiler. - Repeat steps 2–4 for OB 82, OB 85, and OB 122. (OB 85 is recommended because the operating system raises it the first time it tries to refresh the I/O image of a missing slave.)
- Select all four OBs in the block container, right-click and choose Download to Target System, or use the menu PLC → Download.
- When prompted about STOP the CPU to download, choose Yes if the process can tolerate a brief restart; otherwise, on S7-400 CPUs you can use the Run-Stop-Run download if the program structure permits (no FC/FB changes, only block additions).
- Verify the download by opening PLC → Online & Diagnostics and checking the Block Folder: OBs 82, 85, 86, and 122 should be listed with timestamp matching the download.
5.1 Equivalent Procedure in TIA Portal (S7-300/400 with TIA)
- In the project tree, expand PLC_1 → Program Blocks.
- Double-click Add new block, select type Organization block, and pick the required OB number from the drop-down. The portal creates the OB in the project.
- Repeat for each of OB 82, OB 85, OB 86, and OB 122.
- Compile the project (Build → Compile or shortcut Ctrl+B) and download the software to the target device.
- Select the Run mode download option in the download dialog if available—on S7-300/400 the CPU will briefly enter STOP; on S7-1500 the change is hot-swappable.
6. Profibus Diagnostics with FC125 / FB125
Empty OBs keep the CPU running but provide no visibility into which slave failed, when, or with what diagnostic code. Siemens publishes FC 125 (S7-300/400) and FB 125 (with instance DB for S7-400) for Profibus DP diagnostic evaluation. They parse the diagnostic data set (DS0/DS1) returned by the failed slave and populate a status word plus a per-slave event log. The blocks are part of the SIMATIC NET library and ship as part of the standard STEP 7 installation starting with V5.3.
6.1 FC 125 Interface
| Parameter | Declaration | Type | Description |
|---|---|---|---|
DP_MASTERSYSTEM |
INPUT | INT | DP master system ID (1 = first master system on the CPU/CP) |
LIST_LENGTH |
INPUT | INT | Number of slaves in the diagnostic list to evaluate |
DIAG_LIST |
OUTPUT | ANY | Pointer to a data block holding the per-slave diagnostic record (length ≥ 28 bytes × list length) |
ERROR |
OUTPUT | BOOL | TRUE = error executing FC 125 |
ERROR_CODE |
OUTPUT | WORD | Error code: W#16#0000 = OK, W#16#8001 = invalid master system, W#16#8002 = DB too small |
6.2 Sample Call in STL (OB 1, cycle-driven at OB 1 priority 1)
// FB / FC call – S7-300/400 STL
CALL FC 125
DP_MASTERSYSTEM := 1 // First DP master on the CPU
LIST_LENGTH := 16 // Up to 16 slaves on this master
DIAG_LIST := P#DB100.DBX0.0 BYTE 448
ERROR := M 100.0
ERROR_CODE := MW 102
The data block DB100 must be at least 28 bytes per slave in the list. The first 28-byte slice contains: slave address (byte 0), slot number (byte 1), diagnostic state code (bytes 2–3), station status 1/2/3 (bytes 4–6), master address, and the vendor-specific diagnostic bytes. Engineers can monitor DB100.DBB0 through DB100.DBB(28 × N − 1) in a VAT or HMI tag list to display slave health in real time.
7. Step-by-Step: Implementing a Non-Empty OB 86 Handler
When the application requires acknowledgment or annunciation of the fault (e.g., to drive a HMI banner or to set a safe-state output), the OB must contain code. The OB 86 local data provides the slot number of the failed station and the event type.
7.1 OB 86 Local-Temp Variables
| Local Variable | Type | Meaning |
|---|---|---|
OB86_EV_CLASS |
BYTE | 16#38 = incoming event (failure), 16#39 = outgoing event (return) |
OB86_FLT_ID |
BYTE | 16#01 = power down, 16#02 = plug removed, 16#03 = rack/Profibus station failure, 16#04 = DP station failure |
OB86_MDL_ADDR |
WORD | Logical base address of the failed master system / module |
OB86_RACKS_FLTD |
WORD | Bit mask of failed racks/stations (bit 0 = station 0, bit 7 = station 7, etc.) |
7.2 Sample OB 86 Logic in STL
// OB86 – Rack / Profibus Station Failure
// L = temporary local, only valid inside this OB
L #OB86_EV_CLASS // Disturbance type
L B#16#38 // "Fault came" (incoming)
<>I // is the failure coming?
JC END1 // otherwise, jump out
L #OB86_FLT_ID // Failure cause code
L B#16#04 // 0x04 = DP station failure
<>I
JC END1 // not a DP fault, ignore
L #OB86_RACKS_FLTD // bit-coded failure image
T MW 200 // store in a flag for HMI
SET // Set a "Profibus fault" marker
S M 210.0 // = M210.0 (DB or flag)
S M 210.1 // Optional: trigger horn/light
CALL SFC 52 // Write a user diagnostic
REQ := TRUE
OB_NUM := 86
INFO1 := W#16#DEAD // any 16-bit identifier
INFO2 := MW 200
RET_VAL := MW 204
END1: BE
This OB sets a flag the HMI can read to display "Profibus slave X failed at HH:MM:SS", then logs the event to the CPU's diagnostic buffer using SFC 52 (WR_USMSG). The HMI can also poll MW 200 to identify which bit—and therefore which Profibus address—dropped out.
8. Verification Procedure
After loading the OBs and downloading, prove the fix works without taking the process down:
- Connect STEP 7 online (PLC → Online) and force the CPU into Online & Diagnostics.
- Open the Diagnostic Buffer and clear it (PLC → Clear/Reset Diagnostic Buffer) to set a clean baseline.
- With the CPU in RUN, physically unplug a Profibus connector from a non-critical slave (typically the last one on the segment, since terminating resistor loss will be the easiest to verify visually).
- Observe the CPU: the
BUSFLED on the CPU should blink (not stay solid), and the CPU should remain inRUN(status display:RUNwithSFsystem fault). The diagnostic buffer should show a Station failure event, not a STOP caused by missing OB event. - Reconnect the slave. The Station return event should appear in the buffer, and the
BUSFLED should clear. - Repeat the test with a second slave to confirm that OB 86 correctly dispatches the incoming and outgoing events.
- For S7-1500 / S7-1200 projects (TIA Portal), the same test is performed but the OB names and tools differ—see Section 9 below.
9. Platform Variations: S7-300/400 vs S7-1200/1500
| Feature | S7-300 / S7-400 (STEP 7 V5.5 / TIA) | S7-1200 / S7-1500 (TIA Portal) |
|---|---|---|
| Error OB model | Discrete OBs 80–88, 121, 122 | OB 82 (DiagnosticInterrupt), OB 83 (Plug), OB 86 (Rack), etc.; identical numbering retained |
| Default on missing slave | CPU → STOP if OB not loaded | CPU stays in RUN by default for diagnostic interrupts; explicit fault only if Fail-safe or user-configured |
| Diagnostic API | FC 125, FB 125, SFC 13 / 51 / 52 / 59 |
GET_DIAG instruction (LAD/FBD/SCL), RD_SINFO, DeviceStates
|
| Slave status from HMI | DB100 read by WinCC / Panel via VAT | Bind HMI tag to a UDT that mirrors GET_DIAG output structure |
| Hot download of new OBs | S7-300: requires STOP; S7-400: possible in RUN with SFM | Yes – TIA Portal supports Run-mode block download on S7-1500 for most changes |
For S7-1200/S7-1500 the workflow differs. Empty OBs are still created in Program Blocks → Add new block, but the diagnostic data is exposed via the GET_DIAG instruction rather than FC 125. The GET_DIAG block returns a structure containing the channel, slot, and error type, suitable for direct visualization in a WinCC Unified / TIA HMI tag list.
10. Troubleshooting Matrix
| Symptom | Probable Cause | Diagnostic Step | Resolution |
|---|---|---|---|
CPU goes to STOP on first slave disconnect, STOP caused by missing OB in buffer |
OB 86 not loaded, or not downloaded with the rest of the program | Online → Block Folder: confirm OB 86 present and current timestamp | Add OB 86 to project, compile, download |
| CPU stays in RUN briefly, then STOP after ~1 s | OB 122 firing on the next read of the failed slave's I/O area | Diagnostic buffer → look for I/O access error | Add empty OB 122 |
CPU stays in RUN but BUSF LED is solid red |
Master has lost frame sync — usually cable/EMC | Check segment termination, bus topology with BT 200, signal with Profibus analyzer | Replace connector; reroute cable away from VFD |
| CPU goes to STOP, buffer shows Diagnostic interrupt from slot N | OB 82 not loaded | Buffer → verify OB class and ID | Add empty OB 82 |
| OB loaded but process still goes to STOP on first cycle after return | OB 85 not loaded — fires on the first I/O update after station return | Buffer → search for Program execution error | Add empty OB 85 |
| Multiple OBs loaded, CPU still stops | Another error class (e.g., OB 87 from GD comms or OB 121 from indirect addressing) | Read the Cause of STOP byte in the diagnostic buffer | Load the OB matching the actual cause |
| Slave "flickers" in/out every few seconds, OBs fire repeatedly | Loose connector, marginal power supply, or baud rate too high for cable length | Scope the 24 V at the slave, check PROFIBUS segment with BT 200 | Tighten connector, replace PS, lower baud rate or shorten segment |
| FC 125 returns ERROR = TRUE, ERROR_CODE = W#16#8001 | Invalid master system ID | Verify DP_MASTERSYSTEM matches HW Config |
Set to 1 for first/only master |
| FC 125 returns ERROR = TRUE, ERROR_CODE = W#16#8002 | Target DB too small for the list length | Confirm LIST_LENGTH × 28 ≤ DB size |
Resize the target DB |
11. Edge Cases and Field-Proven Caveats
- Stop-on-STOP propagation: If the CPU is in STOP, OB 86 is not called. A slave drop on a CPU that is already stopped is invisible to user code. Test the slave-drop scenario with the CPU in RUN only.
- Restart OB (OB 100): When the CPU restarts after a STOP, OB 86 is not executed for prior failures. After a download or warm restart, the diagnostic buffer will be cleared only if the operator explicitly resets it.
-
SFC 52 licensing: The
WR_USMSGfunction requires that System Data Blocks (SDB) for the diagnostic message be configured. Without SDB support, the call returnsRET_VAL = W#16#8081. Verify Options → Message Configuration in HW Config or the corresponding TIA Alarm Configuration. - S7-1500 fail-safe (F-CPU): F-CPUs treat loss of a Profisafe slave differently. OB 86 alone is not sufficient; the F-runtime library raises its own diagnostic state. Consult the S7-1500 F-CPU Safety Manual in addition to the standard error OB setup.
- HMI polling rate: Calling FC 125 once per OB 1 cycle is fine. Calling it from a 10 ms cyclic interrupt OB is wasteful and may distort the diagnostic state machine. Poll at 100–500 ms cadence for HMI display, once per cycle for the fast handling path.
- ET 200S with missing modules: The same OB 86 mechanism covers module-level failures within an ET 200S station, but OB 83 (Remove/Insert Interrupt) is also required if any module is configured for hot-swap.
-
Multiple DP masters on one CPU: Each master system has its own logical ID (1 for the integrated port, 2 and above for CP 342-5 / CP 443-5 / IM 467). Make sure
DP_MASTERSYSTEMin FC 125 matches the target master, otherwise the function returnsW#16#8001. - Profibus to Profinet gateway (IE/PB Link): If the slaves hang off an IE/PB Link PN IO, the gateway itself becomes a Profinet device on the CPU. A slave drop on the Profibus side raises OB 86 on the CPU with the gateway's Profinet diagnostic; the underlying Profibus slave address is reported inside the diagnostic record, not as the slot.
12. Commissioning Checklist
- Import latest GSD files for every Profibus slave on the segment.
- Verify baud rate consistency: the segment runs at the rate of the slowest slave.
- Confirm terminating resistors are ON at the two physical ends and OFF on every node in between.
- Set the Profibus watchdog in HW Config to a value ≥ 3× the worst slave update time (typical: 100 ms for ET 200, 600 ms for drives).
- Load empty OB 82, OB 85, OB 86, OB 122 into the program. Download the project.
- Implement FC 125 in OB 1 (or in a cyclic interrupt OB at 500 ms) and bind the diagnostic DB to a HMI screen.
- Perform the verification procedure from Section 8 and archive the diagnostic buffer export for the commissioning report.
- Document the slave-drop behavior in the FMEA: which slaves are non-critical (can lose), which drive the safety chain (must trigger a controlled stop via code in OB 86).
Why does my Siemens S7 PLC go to STOP when I disconnect a Profibus slave?
The default behavior of S7-300/400 CPUs is to enter STOP on any asynchronous error class for which the corresponding error OB is missing from the active program. A Profibus slave that disappears from the bus is a Station Failure, which the CPU maps to OB 86. If OB 86 is not loaded, the CPU transitions to STOP. In practice, you also need OB 82, OB 85, and OB 122 loaded, because the fault often cascades through several of these classes within a single cycle.
Is an empty OB 86 a valid solution to keep the CPU in RUN?
Yes. A newly created OB 86 with no user code (only the implicit BE) tells the CPU to acknowledge the error class and continue execution. This is the standard field fix for non-critical slaves. For critical slaves, the OB should set a safe-state output pattern or trigger a controlled shutdown, and the fault should be annunciated to the HMI via SFC 52 (WR_USMSG) or by reading FC 125 diagnostic data.
How do I tell which Profibus slave is currently failed?
Use FC 125 (S7-300/400) or the GET_DIAG instruction (S7-1200/1500). FC 125 populates a data block with a 28-byte record per slave, including station address, slot, and the diagnostic-state bits. On S7-1500, GET_DIAG returns a structured output that can be bound directly to a WinCC Unified HMI tag for per-slave health display.
Do S7-1200 and S7-1500 CPUs need the same OBs as S7-300/400?
They use the same OB numbers (82, 83, 85, 86, 121, 122) but the default behavior on a Profibus/Profinet station drop is different. S7-1200 and S7-1500 CPUs will not stop on a Profinet/Profibus diagnostic interrupt out of the box—they raise the OB and continue. Forcing a STOP requires the F-CPU failure model or a user-defined reaction in the OB body. Diagnostic data is read with GET_DIAG rather than FC 125.
Can I download the new OBs without stopping the process?
On S7-1500, yes—TIA Portal supports Run-mode block download. On S7-300, adding an OB requires a brief STOP-RUN transition (typically 3–10 seconds). On S7-400, if the only change is the addition of empty OBs, you can use the Run-Stop-Run download mode to keep the process running through the download. Always test the procedure on a non-production CPU first to confirm the transition time is acceptable for your process.
What should I check first if the CPU still goes to STOP after loading OB 86?
Open the diagnostic buffer (PLC → Online & Diagnostics → Diagnostic Buffer) and read the Cause of STOP entry. The buffer tells you exactly which error class tripped the transition. In nearly every case the cause is a cascading OB 82, OB 85, or OB 122 that fires shortly after the OB 86 event. Load all four OBs as a single batch download and re-test.
Where can I download FC 125 and FB 125 for free?
FC 125 and FB 125 are included in the SIMATIC NET Block Library shipped with every STEP 7 V5.5 installation DVD. If the blocks are missing from a project, they can be re-imported from the Siemens Online Support portal by searching for "FC125 Profibus" or "FB125 Profibus". The library is provided at no additional cost to licensed STEP 7 users; no activation key is required.