1. Problem Overview: S7-300 Stop After Power Loss
The SIMATIC S7-300 CPU family (CPU 312, 314, 315, 315-2 DP, 316, 317, 319) is highly sensitive to power supply interruption. When a power loss event occurs, the CPU can transition to STOP mode with a diagnostic buffer entry that references a missing or faulty organization block (OB), a watchdog timeout, or a parity check failure in the load memory. Field reports consistently identify three failure modes after a brownout, blackout, or uncontrolled 24 V DC rail collapse:
- CPU indicator LEDs:
SF(red, system fault),BF(bus fault, if Profibus present), andSTOP(yellow) all lit;RUNLED off. - Diagnostic buffer reports
OB86 (Rack failure),OB122 (I/O access error), orOB121 (Programming error)as missing, and the CPU refuses to restart because the requested OB is not loaded. - Retentive tags, timers, and counters are reset to their initial values because the backup battery is depleted, the MMC (Micro Memory Card) is missing, or the warm restart is misconfigured.
2. Root Cause Analysis: Why the S7-300 Stays in STOP
Unlike the S7-400, the S7-300 has only a single restart type - the warm restart (OB100). The CPU does not support a true cold restart in the S7-300 sense. When power returns, the operating system of every S7-300 CPU executes the sequence defined in Retentive behavior after loss of power (S7-300, S7-400) - STEP 7. If the program references an OB that the CPU cannot locate, the CPU enters STOP and writes the OB number to the diagnostic buffer.
Power-loss-induced STOP is driven by one or more of the following mechanisms:
- Missing error OB. The user program calls or implicitly requires OB1, OB82, OB85, OB86, OB100, OB121, or OB122. After a power-down event, the load memory image may be incomplete because the RAM was not flushed to a Flash MMC, and one of these OBs fails to load. The CPU then refuses to enter RUN.
-
RAM-only storage with low backup battery. Older S7-300 CPUs (CPU 31x series without MMC) hold the project in volatile RAM backed by a lithium backup battery (3.6 V, 1/2 AA). If the battery voltage drops below 2.7 V or the battery is removed while power is off, the program is lost. The CPU then has no valid block to execute, and the SF LED lights with diagnostic event
"No user program available". - Watchdog or scan-time overflow during ramp-up. Inrush current from disk drives, contactors, or 24 V DC supplies can sag the rail below 19.2 V momentarily. The CPU interprets the brownout as a power failure and a near-instant recovery. If OB1 contains a long initialization routine or the OB1 scan time exceeds the configured maximum cycle time (default 150 ms for CPU 315-2 DP), OB80 (Time error) is requested, and if OB80 is not loaded, the CPU transitions to STOP.
- Profibus or Profinet slave drop-out. When a DP slave or PN device loses power concurrently with the CPU, OB86 (Rack failure) is requested on startup. Without OB86 loaded, the CPU stays in STOP.
- Memory card mismatch or corruption. A 3.3 V MMC that was written on one project and inserted into a different CPU (or a different slot) can produce a checksum error during the boot sector read, leaving the CPU in STOP with the SF LED flashing at 1 Hz.
3. Diagnostic Procedure: Reading the S7-300 Diagnostic Buffer
The diagnostic buffer is the single most valuable source of information for a power-loss-induced STOP. Use any of the following Siemens tools to read it:
- STEP 7 V5.5 with Simatic Manager (full license)
- STEP 7 Lite (limited - online diagnostics only; cannot modify the program)
- STEP 7 (TIA Portal) V16 or later, with the S7-300 device package installed
- Web-based diagnostics via the CPU's integrated Ethernet port (CPU 31x PN/DP and CPU 319 PN/DP only) at the address
http://<CPU IP>/diagnostics
To read the buffer in Simatic Manager:
- Open the project that matches the CPU order number (MLFB) and firmware version, or select PLC > Accessible Nodes if the project is unknown.
- Right-click the target CPU and select Online > Online and Diagnostics.
- Select Diagnostics Buffer in the left tree.
- Read the events from newest to oldest. Pay specific attention to entries of the form:
"Stop by OB not loaded (OB 86)"
"Stop by programming error (OB 121 not loaded)"
"Stop by I/O access error (OB 122 not loaded)"
"BATTF: Backup battery voltage low" - Note the timestamp of the most recent STOP event and compare it with the UPS event log if one is installed.
If STEP 7 Lite is the only tool available, it can read the diagnostic buffer and display the requested OB number, but it cannot download replacement blocks. In that case, a full STEP 7 V5.x or TIA Portal license is required to push the missing OB back to the CPU.
4. The OB86 Mechanism and Other Critical Organization Blocks
Every S7-300 CPU ships with OB1 (main cyclic program) and OB100 (warm restart). All other OBs are optional but, if referenced implicitly by the operating system, must be present. The OBs that most frequently cause a power-loss STOP are summarized in the table below.
| OB Number | Name | Trigger | Effect if Missing |
|---|---|---|---|
| OB82 | Diagnostic interrupt | Slave reports diagnostic event | CPU STOP if interrupt occurs in RUN |
| OB85 | Priority class error | OB not loaded but interrupt fires | CPU STOP on first occurrence |
| OB86 | Rack failure / DP slave failure | Profibus or Profinet slave drop-out | CPU STOP - most common power-loss cause |
| OB100 | Warm restart | Power returns | CPU STOP - cannot enter RUN |
| OB121 | Programming error | Invalid instruction in OB1 | CPU STOP |
| OB122 | I/O access error | Read/write to faulty I/O | CPU STOP |
BE (Block End). This prevents the CPU from entering STOP when the corresponding event fires and is the single most effective preventive measure for power-loss recovery.5. RAM, Battery, and MMC Memory Architecture
S7-300 CPUs use a two-tier memory model:
- Load memory - Non-volatile on Flash MMC (if installed) or volatile RAM backed by the backup battery. Holds the project blocks.
- Work memory - Always volatile. Holds the active code and data during RUN.
Backup batteries are 3.6 V lithium cells, typically the Siemens 6ES7971-0BA00 battery. The BATTF LED on the CPU faceplate is the direct indicator:
| LED State | Meaning | Action |
|---|---|---|
| Off | Battery OK or absent in MMC-only CPU | None |
| On (red) | Battery voltage low or missing; load memory in RAM not protected | Replace within 1 week |
| Flashing | Battery test in progress (during power-up) | Wait 30 s; clears if battery healthy |
When the backup battery is depleted, the contents of load-memory RAM are lost on the next power-down. On power-up, the CPU finds no valid project and enters STOP with the SF LED on. A flash MMC inserted in the slot will still be recognized if it contains a valid project, but any RAM-resident blocks not yet flushed to the MMC are gone.
For MMC-only CPUs (CPU 31xC, CPU 319 PN/DP, and any firmware V2.0 or later on 31x PN/DP), the backup battery is optional because the MMC is non-volatile. The BATTF LED may still be active if the battery holder is unpopulated; in that case, configure "Battery not installed" in the CPU properties so the diagnostic does not flag a permanent fault.
6. Retentive Behavior After Power Loss
Retentivity in the S7-300 is configured per tag, per bit memory area, per S7 timer, and per S7 counter. The configuration is stored in the CPU's retentivity settings (Hardware > Properties > Retentive Memory in STEP 7). On a warm restart, only the configured retentive areas retain their values. Non-retentive areas are reset to their initial values.
Critical S7-300 retentive rules:
- Without OB100, the CPU will not perform a warm restart - it enters STOP immediately on power-up.
- The S7-300 cannot perform a cold restart. If you need cold-restart behavior (full memory reset), simulate it by manually setting
RUN-Restartvia PLC > Operating Mode > Cold Restart in Simatic Manager, but this option is only available on the S7-400 and not on the S7-300. - M-coded data blocks (DBs) are retentive by default. Instance DBs are retentive only if the associated FB is configured retentive.
- The number of retentive bit memory bytes, S7 timers, and S7 counters is limited by CPU type. For example, the CPU 315-2 DP (6ES7315-2AH14-0AB0) supports up to 2048 retentive bit memory bytes by default, configurable up to the full 16 384-byte range.
7. Step-by-Step Resolution: Restoring the S7-300 After Power Loss
- Verify supply voltage. Measure the 24 V DC at the CPU power supply module (PS 305, PS 307, or external 24 V). The 24 V must be within 19.2 V to 28.8 V (PS 307 wide range) or 22.0 V to 29.0 V (PS 305). Ripple must be below 5 %.
- Check the BATTF LED. If on, replace the backup battery before any further action. For MMC-only CPUs, verify that the MMC is firmly seated in the slot and the ejector is locked.
- Connect to the CPU via MPI/PROFIBUS (PC adapter, e.g., 6ES7972-0CB20-0XA0) or via the integrated Ethernet port on PN models.
- Read the diagnostic buffer as described in Section 3 and identify the missing or fault-triggering OB.
- Perform a memory reset. With the CPU in STOP, place the mode switch in MRES, hold for 3 s until all LEDs flash, release, and within 3 s turn back to MRES for another 3 s. The CPU will clear work memory and run a self-test.
- Download the project. In Simatic Manager, select PLC > Download. If the project archive is on an MMC, simply leave the MMC in place; the CPU boots from it.
-
Add missing OBs. In the project tree, expand S7 Program > Blocks, right-click, and insert OB82, OB85, OB86, OB121, OB122 as needed. Each can be inserted from the Standard Library under Organization Blocks. Leave the body as
BEif no specific error handling is required. - Recompile and re-download the entire program.
- Switch the CPU to RUN. Move the mode switch to RUN, or use PLC > Operating Mode > Run in Simatic Manager.
- Verify all I/O and confirm the SF/BF LEDs are off.
8. Verification Procedure
After resolution, perform the following verification checks before returning the system to production:
- Diagnostic buffer shows no new STOP events for 10 minutes of RUN operation.
- All configured retentive tags, timers, and counters hold their values across a controlled 24 V power-down / power-up cycle (simulate by opening the circuit breaker to the 24 V rail).
- Profibus slaves (if present) come online without triggering OB86. The BF LED is off within 5 s of power-up.
- The BATTF LED is off. Measure battery voltage at the battery holder terminals with the CPU powered down; reading should be above 3.0 V.
- The mode switch operates correctly: STOP ↔ RUN ↔ MRES transitions are clean, with no SF LED during any transition.
9. Preventive Maintenance and Best Practices
- Always populate the project with empty OBs for all error events (OB82, OB85, OB86, OB121, OB122) at the design stage. This single measure prevents the majority of power-loss-induced STOPs.
- Replace the backup battery every 3 years, or per the Siemens maintenance schedule. Document the date in the CPU's diagnostic buffer comment using the PLC > Properties > Comment field.
- Use a 3.3 V Flash MMC (order code 6ES7953-8LM20-0AA0, 4 MB, or larger) for all S7-300 CPUs that accept an MMC. The MMC makes load memory non-volatile and removes the dependency on the backup battery for program retention.
- Install a UPS or a Siemens SITOP DC UPS module (e.g., 6EP1931-2DC21) on the 24 V rail. The SITOP module signals an imminent power failure to the CPU via a digital input, allowing the program to call OB81 (Power supply fault) and execute a controlled shutdown.
- Configure the CPU's maximum cycle time to a value appropriate for the application. The default of 150 ms is too tight for many process-control applications; raise it to 600 ms or higher to absorb transient scan overruns during a brownout.
- Enable "Startup when expected/actual configuration differ" in the CPU properties (Hardware > Properties > Startup). This permits the CPU to enter RUN even if a Profibus slave is missing, as long as the slave is not required for the application to run safely.
10. Troubleshooting Matrix
| Symptom | Likely Cause | Action |
|---|---|---|
| SF + STOP LEDs on, BATTF off, OB86 in buffer | Profibus or Profinet slave drop-out | Load empty OB86; check slave 24 V |
| SF + STOP LEDs on, BATTF on | Backup battery depleted, program lost from RAM | Replace battery, re-download project |
| SF flashing at 1 Hz, CPU does not boot | MMC missing, unformatted, or project checksum error | Re-format MMC, reload project from STEP 7 |
| CPU enters STOP randomly during operation | OB121 or OB122 missing, programming error | Load empty OB121/OB122, review STL code |
| Retentive data lost on power-up | Retentivity not configured, or battery low | Configure retentive areas in CPU properties |
| CPU requests MRES at every power-up | Work memory parity error | Memory reset; if recurring, replace CPU |
11. Connection-Resource Considerations on Older S7-300 CPUs
Older S7-300 CPUs, particularly the CPU 312 IFM and CPU 313, have very limited connection resources - typically 4 PG connections, 4 OP connections, and 4 S7 connections. When an HMI panel, a programming PG, and multiple Profibus slaves all try to communicate simultaneously, the CPU can run out of connection slots, which is reported as an internal error. After a power loss, all open connections are reset, and the CPU re-allocates them during restart. If the application requires more connections than the CPU can provide, the CPU will enter STOP with a "connection resources exhausted" entry in the diagnostic buffer. Verify the connection count under PLC > Properties > Communication in Simatic Manager, and consider upgrading to a CPU 315-2 PN/DP or CPU 317 PN/DP if the connection count is the limiting factor.
12. Frequently Asked Questions
Why does my S7-300 stay in STOP after a power loss even though the program is in the CPU?
The CPU is in STOP because the operating system requested an organization block (most often OB86, OB121, or OB122) that is not loaded in the project. Load empty stubs for OB86, OB121, and OB122 into the project and re-download. The CPU will then enter RUN on the next power-up cycle.
Can I use STEP 7 Lite to recover a stopped S7-300 after a power failure?
STEP 7 Lite can read the diagnostic buffer and identify the missing OB, but it cannot download replacement blocks. A full STEP 7 V5.5 license (Simatic Manager) or a STEP 7 V16+ (TIA Portal) license is required to push the missing OB back to the CPU.
How do I check the S7-300 backup battery voltage?
Power down the CPU, open the battery holder, and measure the cell voltage directly with a multimeter. A healthy 3.6 V lithium cell reads above 3.2 V. If the BATTF LED is on with a fresh battery, check the polarity and the holder contact resistance.
Does the S7-300 support a cold restart after power loss?
No. The S7-300 supports only the warm restart (OB100). A cold restart is an S7-400 feature. To reset all memory on an S7-300, perform a manual memory reset using the mode switch in MRES position.
What is the simplest preventive measure against power-loss-induced STOP on an S7-300?
Add empty OB82, OB85, OB86, OB121, and OB122 to the project during development. Each OB can be created in Simatic Manager via Insert > S7 Block > Organization Block, and the body can be left as a single BE instruction. This prevents the CPU from entering STOP when the corresponding event fires during or after a power disturbance.