Overview
The SIMATIC S7-400H CPU 417H (order number 6ES7417-4HT14-0AB0 and predecessors) is the high-availability redundant controller used in critical process applications. A recurrent field issue on long-running commissioning campaigns is that the load memory (the area holding all block types, comments, symbols and system data) grows by 10–20 % per online modification until a download is no longer accepted and the engineering station (ES) can no longer reach the controller. The work memory and code footprint typically grow by less than 0.5 % per change, which proves the growth is in load-memory housekeeping, not in logic. This article details the architecture, root cause, the limits of the manual and SFC 25 (COMPRESS) approach, the FEPROM vs RAM card decision, and a deterministic procedure that keeps a CPU 417H pair online across many online modifications.
S7-400H CPU 417H Memory Architecture
Understanding the four memory areas is essential before diagnosing load-memory growth. The CPU 417H separates them strictly:
| Memory area | Location | CPU 417H typical size | Volatility |
|---|---|---|---|
| Work memory (Code) | Integrated RAM | Up to 10 MB (4 MB on early -4HL04) | Volatile, battery-backed |
| Work memory (Data) | Integrated RAM | Up to 10 MB (4 MB on early -4HL04) | Volatile, battery-backed |
| Load memory | Plug-in memory card (FEPROM or RAM) | 16 MB / 32 MB / 64 MB / up to 2 × 64 MB | FEPROM = non-volatile; RAM = volatile |
| System memory | Integrated RAM | Fixed (bits, timers, counters, I/O image) | Volatile, battery-backed |
The load-memory card is a separate physical module (MMC predecessor — actually called memory card in the S7-400 family, since it is a 72-pin SIMATIC memory card, not the MMC used in S7-300/1200/1500). Two card types are available:
- FEPROM (Flash-EPROM) — non-volatile, retainable, slower write cycles (~100 000 per block guaranteed). Used when a permanent record of the program is required.
- RAM card — battery-backed, unlimited write cycles, faster. Used for high-flux development and online modification.
During every Download or Online → Download to target device, STEP 7 writes the new block to the load memory of the active CPU; the previous active version is retained as a passive block to support online modification tracking. Each modification therefore leaves a residue in the load memory until compression consolidates the layout.
Problem: Load Memory Filling After Online Modifications
Symptom pattern reported in the field and reproduced in the Siemens support database:
- Initial cold download on a CPU 417H with a 16 MB FEPROM card populates load memory to roughly 30–40 %.
- After 3–5 online modifications (logic tweaks, comment edits, symbol additions) the load memory rises to 60–80 %.
- After 10–15 modifications the load memory reaches 95–99 % and STEP 7 reports: “Insufficient memory in the CPU”, “Online: download not possible”, or the PLC is no longer reachable through the routing node.
- Manual Compress via PLC → Module Information → Memory → Compress releases only ~30 % of the growth (compression is rarely 100 % efficient while the CPU is in RUN).
- After 3–4 days of heavy commissioning, the CPU is forced into STOP; a full reset (MRES) and complete reload is the only way to recover.
Work memory and code size barely move, which proves the growth is fragmentation and passive-block retention in load memory, not logic growth.
Root Cause Analysis
Three architectural behaviours combine to produce the symptom:
- Passive block retention. Every online modification (block type, instance DB, SDB, SFC, SFB, F-block) is written as a new version in load memory. The old version is marked as passive, not deleted. This is intentional — it allows online delta downloads and view of historic versions — but it consumes load memory until a Compress consolidates the area.
- Compression requires STOP or undisturbed RUN. The SFC 25 “COMPRESS” function and the equivalent Compress dialog in STEP 7 only achieve full compaction if the user program is not actively writing to the same area. With monitoring blocks, forces, VATs and HMI variable polling active, compression recovers roughly 2/3 of the fragmented space, not 100 %.
- Active monitoring tools block the cleanup. STEP 7 explicitly refuses to compress when monitoring functions (monitoring blocks, force table, VAT) are open and bound to the CPU. This is documented in the S7-400 system manual, chapter Load memory / Compress.
The combination of (1) residue accumulation, (2) partial compression, and (3) monitoring blocking full compression explains the 10–20 % per modification growth pattern. A FEPROM card cannot be defragmented in place — the card must be read completely, compressed in the ES, and re-flashed, or compressed inside the CPU if it has enough free space to absorb the temporary duplicate.
Compression Limits on the CPU 417H
The CPU 417H supports compression through two paths:
| Path | Where | CPU state | Recovery efficiency | Notes |
|---|---|---|---|---|
| STEP 7 dialog PLC → Module Information → Memory → Compress | Engineering station | RUN or STOP | ~60–70 % | Blocked if monitoring, forces or VATs are bound |
| SFC 25 “COMPRESS” call in user program | User program (e.g. OB1, OB100, OB35) | RUN | ~60–80 % | Still blocked by active online connections; can be scheduled cyclically |
| STOP + restart of CPU | CPU | STOP → RUN | ~90–95 % | Best compaction, but interrupts process |
| MRES (full reset) + re-download | CPU | STOP, memory cleared | 100 % | Last-resort, requires full project reload |
The CPU 417H hardware supports compression in RUN, but only up to a point. The 16 MB FEPROM card has the smallest free-area margin of the supported card sizes; if load memory is above ~85 % occupied, the compression routine may not be able to create the temporary duplicate layout it needs and the call is rejected with RET_VAL = 80A1 (resource problem) or RET_VAL = 80B1 (insufficient load memory). The Siemens manual for SFC 25 lists these error codes in the standard SFCs reference.
FEPROM vs RAM Memory Card Decision
The card type directly drives the growth pattern. The selection rule for a CPU 417H in heavy online-modification phases is unambiguous:
| Phase | Recommended card | Reason |
|---|---|---|
| Production, validated logic, infrequent change | FEPROM (Flash) | Non-volatile, power-fail safe, no battery dependency |
| Commissioning, hot-fix, FAT/SAT phase | RAM card (battery-backed) | Unlimited write cycles, compression is fully effective, no flash wear |
| Migration / firmware upgrade test | RAM card | Avoid burning flash cycles on a temporary configuration |
The flash write cycle limit on a 16 MB FEPROM card is on the order of 100 000 erasures per sector, which is generally more than enough for a plant’s life cycle, but during a 3-day commissioning window the CPU may receive 20–40 modifications/day, each of which writes a new block. The flash wear is not the failure mode; the failure mode is the load-memory fragmentation that the FEPROM card cannot defragment without a complete read/rewrite. A RAM card lets SFC 25 actually move blocks around in place.
STEP 7 Procedure: Force a Full Compression
- Save the project on the ES.
- Close all monitoring windows in STEP 7 (block view, watch tables, force tables). The CPU will not accept a full compression while ES sessions hold block handles.
- Disconnect any HMI/SCADA tag polling that opens VAT-equivalent handles (WinCC, FactoryTalk, PCS 7 OS — pause the OS server or set the OS to Process mode offline).
- In SIMATIC Manager / TIA Portal, right-click the CPU → Target system → Memory → Compress.
- Confirm the prompt. The CPU will briefly enter a state where online access is paused (typically 5–30 seconds on a CPU 417H, depending on project size and fragmentation).
- After the dialog reports success, open Module Information → Memory and confirm the load-memory free area has increased.
If the dialog returns “Compress not possible” it is almost always because a monitoring connection is still open. Re-check that no ES, no OS server, and no ProTool/ProAgent session holds an active online handle to the CPU.
SFC 25 (COMPRESS) in the User Program
For redundant CPU 417H pairs you can call SFC 25 from a time-of-day or cyclic OB to compress load memory without engineering intervention. Sample structured text:
// OB35, cyclic 1 s, CPU 417H primary
// SFC 25 "COMPRESS" — consolidate user program in load memory
// Trigger window: between 02:00 and 02:05 every Sunday, low-activity time
IF (DTC_HH >= 2) AND (DTC_HH < 3) AND (DTC_WEEKDAY = 0) THEN
// Close monitoring/force sessions before the call is effective
// (engineering must close the ES side)
iRetVal := COMPRESS(); // SFC 25 call, no inputs
IF (iRetVal <> 0) THEN
// RET_VAL <> 0 indicates a problem — push to log DB
iCompressError := iRetVal;
bCompressFailed := TRUE;
ELSE
bCompressOK := TRUE;
END_IF;
END_IF;
Common SFC 25 RET_VAL codes relevant to the CPU 417H:
| RET_VAL (hex) | Meaning | Recovery |
|---|---|---|
| 0000 | Compression completed | — |
| 8090 | No memory card inserted / card removed | Insert the correct card, MRES, re-download |
| 80A1 | User memory (RAM) full | Run compress, then reduce block count |
| 80A4 | CPU type / FW does not support the function | Update firmware or use STEP 7 dialog |
| 80B1 | Load memory insufficient for the temp duplicate | MRES + re-download, or use a larger card |
| 80B4 | FEPROM write protected or write error | Check card type (FEPROM/RAM), replace if defective |
| 80B5 | No compress possible (monitoring/force active) | Close all ES and OS sessions, retry |
The SFC 25 reference page in the STEP 7 V5.x standard SFCs manual gives the full set; the values above are the subset you will hit in this scenario.
Procedure: Replace FEPROM with RAM Card for Commissioning
- Bring the CPU 417H to STOP via the mode switch or PLC → Stop in STEP 7. In an H-system, switch both H-CPUs to STOP; the process is interrupted.
- Remove the FEPROM card from the active CPU. The plug is on the front, behind a small cover.
- Insert a battery-backed RAM card of the same size or larger (16 MB, 32 MB, or 64 MB). Verify the battery LED.
- Power on the CPU; if the program is still on the FEPROM card, copy RAM ← FEPROM via PLC → Copy RAM to ROM in the opposite direction (now RAM card is destination).
- Switch back to RUN.
- Test SFC 25 — it should now fully compact on each call.
Procedure: Online Modification Best Practice
Adopt these rules to keep the load memory from growing between scheduled compressions:
- Batch modifications. Accumulate logic changes for an hour, then download once. Ten small downloads create ten times the residue of one batched download.
- Avoid changing comments and symbols online. Comment and symbol changes still write new block versions. If you must change a comment, do it in the project offline and reschedule the next download window.
- Delete unused blocks. Use Options → Block consistency check to identify blocks with no reference. Delete them in the offline project, then download the entire container.
- Schedule a nightly compress. If the process is hot and cannot tolerate a STOP, call SFC 25 in a low-traffic time-of-day window. The compression is partial but it caps growth.
- Cap the SDB count. Each H-station configuration and each CP generates SDBs. Verify the SDB count with Module Information → Communication after each hardware change. Orphaned SDBs from removed stations are a common hidden load-memory consumer.
- Keep monitoring sessions short. When a commissioning engineer finishes a debug session, fully close the online window. Each open block view holds a memory handle that blocks compression.
Verification: Confirm Load Memory Health
After any intervention, verify the load memory state in PLC → Module Information → Memory:
| Field | Healthy value | Action threshold |
|---|---|---|
| Load memory used | < 50 % | > 80 % → schedule compress |
| Free load memory | > 8 MB on a 16 MB card | < 2 MB → immediate compress or card swap |
| Work memory (Code) used | < 60 % | > 80 % → optimise code, move logic to FBs |
| Work memory (Data) used | < 60 % | > 80 % → review DB sizes, multi-instances |
| Passive blocks (online view) | 0 | > 0 → compress pending |
Run Module Information → Diagnostic Buffer and look for events “Load memory compressed”, “Insufficient load memory”, or “Online: download rejected”. The timestamps of these events let you correlate the growth with a specific change window.
Redundancy Considerations for the S7-400H Pair
On an H-system, both CPUs share the role of master and reserve. The load-memory growth pattern occurs on both because both receive the same online modification through the redundant link. The relevant behaviours:
- Online download to a redundant pair is performed on the master; the reserve CPU is updated through the redundant link automatically.
- SFC 25 must be called on both CPUs to be fully effective, or you can call it only on the master and trigger the reserve to update with SFC 90 (H_CTRL) parameter “reserve role” handling. Most implementations call SFC 25 in OB1 on each CPU independently.
- If the master fills and the reserve has more free space, link-up is not blocked, but a master-failover will not give you extra headroom — the reserve has the same fragmented layout.
- For H-systems, Siemens recommends both CPUs be equipped with the same memory card type and size. Mismatched cards will fail redundancy check during startup.
Troubleshooting Matrix
| Symptom | Likely cause | First action |
|---|---|---|
| Load memory 95 %+ after only 5 modifications | Many small online downloads, no compress | Batch changes, close monitoring, run STEP 7 Compress |
| Compress dialog returns immediately with no effect | ES or OS session holds online handle | Close all monitoring/force/VAT windows, retry |
| SFC 25 returns 80B1 | Load memory too full to create temp duplicate | MRES + full re-download with larger card |
| SFC 25 returns 80B4 | FEPROM card write-protected or defective | Replace card; use RAM card for hot phase |
| CPU is not reachable from ES | Load memory full blocked online services | MRES on CPU (mode switch to MRES for ~3 s), re-download |
| Compression only releases 30 % | Active monitoring during compress | Close sessions, re-run during plant low-load window |
| Growth recurs within hours of compress | Active engineering work, no batch discipline | Implement batch download + nightly SFC 25 schedule |
Preventive Maintenance Schedule
Embed these checks in the plant maintenance plan for any S7-400H fleet:
- Daily: HMI/SCADA panel showing load memory %; alarm at 70 %.
- Weekly: Review Module Information → Diagnostic Buffer on both H-CPUs for “Insufficient load memory” events.
- Monthly: Run a manual compress from STEP 7 in a planned low-load window.
- Quarterly: Verify both CPUs have the same card type and size; verify the battery LED (RAM card) is green.
- Per major project change: After a large online modification (>50 blocks), stop the CPU, swap to a RAM card if the project is not yet signed off, run SFC 25, swap back to FEPROM at project sign-off.
- Annually: Replace the RAM-card backup battery (typical life 2–3 years, replace preventively).
References for Further Engineering Use
Authoritative sources for the procedures and error codes above are the Siemens SIMATIC S7-400H system manual, the CPU 417H device manual, and the STEP 7 V5.x standard SFCs reference. Use the Siemens Industry Online Support portal to retrieve the latest revisions of each document for the firmware version installed in your fleet:
- Siemens Industry Online Support — entry point for SIMATIC S7-400H manuals, FAQs and firmware downloads.
- SIMATIC S7-400H Fault-Tolerant Systems manual (entry 1116940) — covers the H-system startup, link-up, and memory-card handling.
- SIMATIC S7-400 CPU 417H device manual (entry 18652677) — load memory sizes, FEPROM/RAM card ordering data, and battery behaviour.
- SIMATIC S7-400 System Manual (entry 18627128) — load memory, compression routine, and the “Insufficient load memory” diagnostic event.
- STEP 7 V5.x Standard SFCs reference (entry 109751826) — SFC 25 “COMPRESS” interface, RET_VAL codes, and execution preconditions.
Verify the firmware release notes for your specific CPU 417H variant (e.g. 6ES7417-4HT14-0AB0) before relying on a RET_VAL mapping; Siemens occasionally revises error code semantics in major firmware updates (V4.x, V5.x, V6.x lines of the CPU 417H firmware).
Why does the CPU 417H load memory grow by 10–20 % per online modification even when the code barely changes?
Each online modification writes a new version of the modified block (OB, FB, FC, DB, SDB, SFC, SFB) into the load memory and leaves the previous version as a passive block. Work memory holds only the active version, so code size barely changes, but the load-memory card accumulates residue until a Compress operation consolidates the layout.
Why does the STEP 7 Compress dialog only recover about two-thirds of the fragmented space?
The compression routine cannot move blocks while online connections (block monitor, force table, VAT, OS server polling) hold handles to the same area. Closing all ES and OS sessions against the CPU lets compression approach 90–95 % efficiency, but a true 100 % requires a CPU STOP and full restart.
Can SFC 25 “COMPRESS” be called automatically from the user program?
Yes. Call SFC 25 from OB1, OB35 or a time-of-day OB. SFC 25 has no inputs and returns RET_VAL. The call is most effective when scheduled during a low-traffic window and when no ES/OS session is bound to the CPU. The relevant RET_VAL codes are 0000 (success), 80A1, 80B1, 80B4, and 80B5 — see the table in the article for the full mapping.
Is a FEPROM card or a RAM card better during heavy online modification?
Use a battery-backed RAM card during commissioning, hot-fix and SAT phases. The RAM card allows in-place compression, has no write-cycle limit, and recovers more load memory per compression. Switch back to FEPROM for production operation when the logic is frozen, to gain non-volatile retention without battery dependency.
When the CPU 417H is no longer reachable online, is MRES the only recovery?
MRES (memory reset) followed by a full project re-download is the deterministic recovery and is the only way to clear 100 % of the load-memory residue. Before going to MRES, try a CPU STOP + power cycle, then attempt an online Compress; if the ES cannot connect at all, MRES is required. Keep an up-to-date project archive on the engineering station to make the re-load fast.