Resolving Siemens S7-300 CPU 315 Error 0xFFDF_0117 Memory

David Krause20 min read
S7-300SiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Resolving Siemens S7-300 CPU 315-2EH14-0AB0 Error 0xFFDF_0117: Work Memory Overflow During Block Download

1. Problem Overview

A Siemens SIMATIC S7-300 CPU 315-2 PN/DP (order number 6ES7315-2EH14-0AB0) refuses to accept additional user program code with the diagnostic event E: 0xFFDF_0117: [S7DOS] The block/op. sys. update is too large. even though STEP 7 / SIMATIC Manager online diagnostics report 180 KB of unused work memory. The CPU is rated for 384 KB of integrated work memory and the offline program currently consumes approximately 212,962 bytes (208 KB). When a few additional kilobytes of logic are appended and the program is downloaded, the S7DOS subsystem raises the 0xFFDF_0117 event and the download is rejected. The error occurs only on download; once the program is already in work memory, execution is normal.

The fault is rooted in the S7-300 memory model, the way STEP 7 and the S7DOS downloader temporarily replicate the block set, and the static reservation of 128 KB of the 384 KB work memory for the retentive data area. Engineers encounter this on CPUs that have grown organically over many project revisions, where the block directory and the runtime footprint of CFC charts and SCL blocks together approach the partition ceiling of the work-memory pool reserved for non-retentive code and system data.

Operational impact. The CPU remains in RUN, and existing logic continues to execute. The failure is confined to the online download of a new or modified block, and the diagnostic buffer will record the S7DOS event immediately after the download attempt is started from STEP 7.

2. Affected Hardware and Firmware

The event is observed on the 6ES7315-2EH14-0AB0 module, which is the CPU 315-2 PN/DP with PROFINET and PROFIBUS-DP interfaces. The relevant S7-300 memory specifications for this catalog number are summarized below.

Table 1. CPU 315-2EH14-0AB0 key memory and block parameters
Parameter Value Source / Notes
Work memory, integrated 384 KB STEP 7 module properties
Load memory, integrated (RAM) 1 MB CPU datasheet
Load memory expansion SIMATIC Micro Memory Card (MMC), up to 8 MB FEPROM, non-volatile
Retentive memory, max (configurable) 128 KB Default reservation for S7-300 CPUs of this class
Maximum number of FCs 2,048 (number range 0–2047) Per CPU manual; some firmware revisions advertise 0–65,535 but CPU enforces CPU-specific maximum
Maximum number of FBs 2,048 (number range 0–2047) Per CPU manual
Maximum number of DBs 1,024 (number range 1–1023) + 1 diagnostic DB Per CPU manual; DB 0 is reserved
Maximum SFB / SFC count CPU-internal, fixed set Not user-extensible
Maximum block size (MC7 code + interface) 64 KB per block on S7-300 Smaller for some early CPUs; verify with the device manual
Number of inputs / outputs, digital 16,384 / 16,384 (bit-addressable) Process image limited to 128 bytes DI / 128 bytes DO by default
Number of inputs / outputs, analog 1,024 / 1,024 Per CPU datasheet
Always cross-check the values used here against the device manual that ships with the firmware version installed on the affected CPU. S7-300 catalog numbers ending in -0AB0 are the original release, while -0AB0 bundles in the SIMATIC Manager PLC selection correspond to a specific firmware state.

3. S7-300 Memory Architecture Fundamentals

The S7-300 family uses a three-tier memory concept. Engineers must internalize this model before the 0xFFDF_0117 event makes sense.

3.1 Load memory

Load memory is the non-volatile or battery-backed store where the complete project, including all blocks, comments, symbols and SDB configuration, is held. On the CPU 315-2 PN/DP the load memory is split between the integrated RAM and an optional SIMATIC MMC (FEPROM). The MMC is the only non-volatile component; the integrated RAM is volatile and is repopulated from the MMC on power-up. A download from STEP 7 typically writes the new blocks to both RAM and MMC. If a download is large, the integrated RAM fill level plus the MMC fill level are both relevant to the success of the operation.

3.2 Work memory

Work memory is the RAM the CPU uses at runtime to execute the user program. It holds MC7 code (the compiled output of LAD, FBD, STL, SCL, CFC, GRAPH), block interfaces, instance DB bodies, and the non-retentive portion of the data. The CPU copies a block from load memory to work memory the first time the block is needed, and on cold restart the work memory is reloaded from load memory. The 384 KB figure on the CPU 315-2EH14-0AB0 is the total work memory pool.

3.3 System memory and retentive partition

The system memory contains the process image of the inputs and outputs, bit memory (M), timers (T) and counters (C). A portion of the work memory can be configured as retentive so that DB contents, bit memory, timers and counters survive power-down. On the CPU 315-2 PN/DP the maximum retentive area is 128 KB. This reservation is static at the firmware level even if the project only uses a few kilobytes of retentive data — the remainder of the 128 KB pool is reserved for the maximum configured retentive footprint and is not available for the user program.

3.4 Memory model visualised

S7-300 Work Memory (CPU 315-2EH14, 384 KB total) Retentive partition (configurable, max 128 KB) — RESERVED for DB / M / T / C retentive User program (MC7) + DB non-retentive instances — 256 KB available Currently occupied by project (≈ 208 KB) — 100% of program pool Reported "free" 180 KB (online diag) System memory (process image, bit memory, timers, counters, runtime stack) S7DOS download staging buffer (transient, used to validate the new block set) Note: the 0xFFDF_0117 event is raised when the new block set — even if smaller than the residual 256 KB — cannot be staged because the runtime footprint plus staging buffer exceeds the available pool.

4. Root Cause Analysis of Error 0xFFDF_0117

The diagnostic event 0xFFDF_0117 with the tag [S7DOS] is generated by the S7DOS downloader component of the S7-300 firmware. The S7DOS subsystem is responsible for receiving blocks from STEP 7 over MPI / PROFIBUS / PROFINET, staging them in work memory, integrity-checking the staged image against the operating-system constraints, and then committing the staged image back to the active runtime pool. The text "The block/op. sys. update is too large" indicates that the new image size exceeds a CPU-internal ceiling computed by S7DOS based on:

  1. The remaining free work memory after the running image is subtracted.
  2. The fixed reservation for the retentive partition (here 128 KB).
  3. The maximum block count and maximum single-block size for the CPU class.
  4. The maximum size of the S7-300 operating system extension area still available for user blocks.

The 180 KB "free" figure displayed in the Module information > Memory dialog in STEP 7 is the raw remaining pool. S7DOS must reserve a staging area and a safety margin that are not included in this figure, and it also applies the retentive partition deduction. Once the new program is converted from its offline size on disk (S7DOS accounts for MC7 in a different packing factor than the offline display) and the staging buffer is added, the residual pool is smaller than the value STEP 7 reports, and the 0xFFDF_0117 event is raised before the commit phase.

Concretely, with a 384 KB work memory and a 128 KB retentive ceiling, the maximum addressable user-program pool is:

User program pool = 384 KB − 128 KB (retentive reservation) − system memory overhead = 256 KB (theoretical max)

The reported 212,962-byte project therefore consumes 81% of the theoretical 256 KB program pool. Adding even a few kilobytes of new code can push the in-memory representation over the 256 KB ceiling once S7DOS staging, block alignment padding, and runtime stack reservations are accounted for. The error is therefore not a contradiction in STEP 7's "free memory" display — it is a more conservative check performed by the firmware's S7DOS loader.

4.1 Why the error only appears during download

When a single block is downloaded, STEP 7 first sends the new block to load memory. S7DOS then performs a two-phase commit: it stages the new image, verifies that the operating-system and user-data structures can be re-instantiated within the available work memory, and only then writes the active runtime blocks. If the staged image cannot be fitted, S7DOS aborts before the commit, leaves the running program intact, and emits 0xFFDF_0117. The CPU therefore never sees a partially-updated program — the failure is by design to keep the runtime consistent.

4.2 Why incremental downloads are safer than full downloads

STEP 7 normally offers "Download" (entire block set) and "Download selected blocks" (single block). With a full download, every block is staged and re-committed, including blocks that have not changed; the work-memory peak during the commit is therefore the size of the entire project. With an incremental single-block download, the peak is the size of the new or modified block plus its dependent interface DB. The single-block path can therefore succeed where the full download path fails, because the work-memory peak is smaller.

4.3 CFC and SCL specific behaviour

Programs that combine CFC charts with custom SCL blocks generate a high number of instance DBs (one per chart run, one per multi-instance). On the CPU 315-2EH14-0AB0 the maximum DB count is 1,024 + 1, and a CFC-heavy program with dozens of charts and hundreds of block instances can approach that count before it runs out of work memory. Each instance DB consumes DB-header plus DB-body bytes in work memory, and the DB-header cost is non-trivial when scaled across hundreds of instances. If the project is close to the DB-count ceiling, S7DOS may reject an addition that would push the count over 1,024 even if there is still work memory free.

5. Diagnostic Procedure

Before applying any of the resolution methods in section 6, the engineer should capture a complete diagnostic snapshot. The sequence below is the recommended order.

  1. Open the SIMATIC Manager and connect online to the CPU with the Accessible Nodes or Online > Node Address function.
  2. Select the CPU in the project view and choose PLC > Module Information. Switch to the Memory tab and record the work-memory used, free and load-memory used values, the retentive area used, and the operating-mode changes counter.
  3. Switch to the Diagnostic Buffer tab and scroll to the latest 0xFFDF_0117 entry. Note the timestamp and the block referenced in the Block column. The S7DOS event usually references the block that was being downloaded at the time of the rejection.
  4. Switch to the Performance tab or open PLC > Diagnostics/Settings > Resource Allocation and record the maximum cycle time, the number of OB1 / OB35 / OB40 / OB82 / OB100 / OB101 / OB102 calls, and the OB1 execution time.
  5. In the offline project, choose Options > Cross References on the CPU and verify that every DB in the project is actually called by the program. Unused instance DBs from removed CFC charts are a common source of phantom memory consumption.
  6. Open the offline CPU Properties > Protection and CPU Properties > Retentive Memory tabs and record the exact retentive configuration. The default 128 KB reservation may not match what the project actually needs, and a smaller retentive ceiling can free up code space.
  7. From the offline project, open PLC > Save/Compile and check the Compile output window for warnings about block size, interface size, or DB count. STEP 7 reports blocks whose compiled size is close to the CPU maximum here.
  8. Optionally, attach a PG cable and read the MMC contents with PLC > MMC Card > Read MMC (or use the S7 Tool S7Backup for newer STEP 7 versions) to inspect the load-memory layout on the card.

6. Resolution Methods

The following procedures are ordered from least invasive to most invasive. Apply them in sequence; typically the first two are sufficient to clear 0xFFDF_0117 on a CPU 315-2EH14-0AB0.

6.1 Method 1: Reduce the retentive reservation

Open CPU Properties > Retentive Memory in the offline project and reduce the retentive bits, timers, counters and DBs to the actual values used. On the 315-2 PN/DP the maximum retentive ceiling is 128 KB, but the default is often set to the maximum even though the project only uses a few hundred bytes. S7DOS applies the configured retentive ceiling to its work-memory budgeting. If the retentive ceiling is reduced from 128 KB to 16 KB, the user-program pool grows from 256 KB to 368 KB, which is enough to absorb the additional code in the reported case.

Caution. Reducing the retentive area makes the corresponding DBs, M bits, timers and counters volatile. Any process state that the operator expects to survive a power cycle must be re-engineered to a smaller retentive partition, or moved to the non-retentive area and re-initialised on startup.

6.2 Method 2: Reorganise the CFC charts and SCL custom blocks

CFC charts generate a static instance DB per chart run and a dynamic instance DB per block type instance inside the chart. If the project contains charts that have been split, copied, and partially deleted, the project may hold instance DBs that are no longer referenced. Perform the following cleanup:

  1. Open Options > Chart Check > Consistency Check on the CFC chart folder and follow the prompts to remove orphan instances.
  2. Compile the S7 program with PLC > Save/Compile and review the Compile output for warnings.
  3. Use Options > Cross References to identify any DB whose only reference is in a deleted chart. Such DBs can be deleted from the offline project and re-downloaded to the online program.
  4. Where possible, consolidate multiple small SCL blocks into a single multi-instance SCL block with several methods. The MC7 overhead per block is significant; reducing the FC / FB count by half can recover tens of kilobytes of work memory.

6.3 Method 3: Delete obsolete blocks online

From the online view, right-click on the Blocks container and choose Online > Delete. This frees the work memory held by the deleted block and the corresponding MC7 code. Only delete blocks that are not referenced by the running program; deleting a referenced block causes the CPU to enter STOP with a missing-block error.

6.4 Method 4: Perform a memory reset and selective reload

If the work-memory fragmentation has caused the S7DOS staging buffer to be unable to find a contiguous region, a full memory reset followed by a selective reload can recover the lost space.

  1. Stop the CPU and perform PLC > Diagnostics/Settings > Clear/Reset to clear work memory and the integrated RAM portion of load memory.
  2. Verify that the project is backed up, including the offline project and the contents of the MMC if one is installed.
  3. Re-insert the MMC if it was removed, then perform PLC > Download on the system data and the hardware configuration first, then the user blocks.
  4. After the reload, re-check the Memory tab in Module information. The free work memory should now show the expected residual.
Procedure-time warning. A memory reset erases the entire PLC runtime state, including retentive data, process outputs, and any OPC connections. Schedule this on a maintenance window and confirm that the controlled process can be taken offline safely.

6.5 Method 5: Switch load-memory destination

In STEP 7, choose Options > Customize > Load Memory Card and select Load to memory card only. This bypasses the integrated load-memory RAM and writes directly to the MMC. On the 315-2 PN/DP with the integrated 1 MB RAM full, switching to MMC only can free the integrated load memory and give S7DOS more room to stage the new image. The trade-off is a slower first-call latency for blocks that are not in work memory yet, because the CPU must now read them from the FEPROM rather than the RAM cache.

6.6 Method 6: Upgrade the CPU

If the project is intrinsically close to the 384 KB ceiling and further growth is expected, the sustainable solution is to upgrade the CPU to a higher-tier S7-300 part. The compatible upgrade paths for the 6ES7315-2EH14-0AB0 are:

Table 2. CPU 315-2EH14-0AB0 compatible upgrade targets
Catalog number CPU model Work memory Retentive max Max DBs
6ES7317-2EK14-0AB0 CPU 317-2 PN/DP 1 MB 256 KB 2,047
6ES7317-2AK14-0AB0 CPU 317-2 DP 1 MB 256 KB 2,047
6ES7318-3EL01-0AB0 CPU 319-3 PN/DP 2 MB 700 KB 4,095

The 317-2 PN/DP doubles the work memory to 1 MB and raises the DB ceiling to 2,047. For CFC-heavy projects with hundreds of instance DBs, this is the recommended upgrade. The 319-3 PN/DP quadruples the work memory and supports the full GRAPH instruction set, which is useful if the SCL custom blocks include GRAPH sequencers.

CPU upgrade considerations include (a) increased current draw — verify the PS 305/307 can deliver the extra load, (b) mechanical mounting — the S7-300 backplane slot is identical but the module depth differs, and (c) the firmware file for the new CPU must be installed in the SIMATIC Manager component catalog before the project can be downloaded.

7. Step-by-Step Resolution for the Reported Symptom

Applying the methods to the reported case (6ES7315-2EH14-0AB0, 384 KB work memory, 128 KB retentive ceiling, program 212,962 bytes, 0xFFDF_0117 on download):

  1. Open CPU Properties > Retentive Memory. Identify the actual retentive footprint using Module information > Performance or by reading the DB with the largest retentive declaration. In the reported case, the project uses less than 1 KB of retentive data, but the ceiling is 128 KB.
  2. Reduce the retentive ceiling from 128 KB to 8 KB (or the actual value plus a small safety margin). Recompile and download the system data only. This frees roughly 120 KB of work memory for the user program.
  3. If additional capacity is still required, run Options > Chart Check > Consistency Check on the CFC chart folder and remove orphan instances.
  4. Re-try the download of the modified block. The 0xFFDF_0117 event should not appear.
  5. If the event persists, perform a memory reset and a selective reload (Method 4) and re-try.
  6. If the event still persists, upgrade the CPU to a 317-2 PN/DP (6ES7317-2EK14-0AB0).

8. Verification

After each of the methods above, the engineer should perform the following verification to confirm the fix and rule out secondary issues.

  1. Re-attempt the download of the previously rejected block. Confirm in the Diagnostic Buffer that no new 0xFFDF_0117 event is recorded.
  2. Open Module information > Memory and confirm that the work-memory used is below the post-fix ceiling and that the free value matches the expected residual after the retentive reservation.
  3. Monitor the CPU via PLC > Monitor/Modify on a sample of input, output, DB, and M bit addresses and confirm that the logic still executes correctly.
  4. Trigger a controlled power cycle (process in safe state) and confirm that the retained DB, M, T, C values survive, in line with the new retentive configuration.
  5. Run the System diagnostics > Check function and confirm that the S7-300 reports no further inconsistencies.

9. Preventive Engineering Practices

To avoid hitting 0xFFDF_0117 on a CPU 315-2EH14-0AB0, the following practices should be embedded in the project engineering workflow.

  1. Configure the retentive area to the smallest value that still covers the required persistent state. The 128 KB default is rarely justified by the process.
  2. Establish a block-management convention: limit the FC and FB number range to a documented partition (e.g. FC 1–200 for utility blocks, 201–400 for process blocks) so that a forgotten block with a high number is unlikely.
  3. Track the project memory footprint at every save. The PLC > Save/Compile output includes a summary that can be exported and compared across revisions.
  4. Run a quarterly Cross References > Unused audit and remove orphan DBs and unused FBs/FCs.
  5. Size the CPU for the project's end-of-life memory footprint, not its current size. If the project is at 60% of the 384 KB ceiling, plan a CPU upgrade in the next control-cabinet overhaul.
  6. Use the STEP 7 Compare Blocks tool before any online download to verify that only the intended block has changed. A full program download, while simpler, has a higher work-memory peak and is more likely to trigger 0xFFDF_0117.

10. Troubleshooting Matrix

Table 3. Symptom to resolution mapping for 0xFFDF_0117 on CPU 315-2EH14
Symptom Likely cause First action Second action
0xFFDF_0117 on full program download, free memory shown is high Retentive reservation absorbing the free pool Reduce retentive ceiling in CPU properties Selective single-block download
0xFFDF_0117 on a single new FB/FC that is large Block exceeds 64 KB MC7 max for S7-300 Split the block into smaller FBs / FCs Move complexity to an SCL multi-instance FB
0xFFDF_0117 with a CFC-heavy project DB count ceiling (1,024) approaching Consolidate chart instances Upgrade to CPU 317-2 PN/DP
0xFFDF_0117 on a CPU that has been running for years without change Work-memory fragmentation Memory reset + selective reload CPU upgrade if recurring
0xFFDF_0117 immediately after a firmware update New firmware reserve is larger Compare free memory pre/post update Reduce retentive reservation or upgrade CPU
0xFFDF_0117 with the load-memory RAM full MMC fragmented or MMC capacity exceeded Replace MMC with a higher capacity card Use "load to MMC only" path

11. Standards and Reference Reading

Engineers working on the S7-300 memory model should consult the following official references. They are not part of a public standards body but are the manufacturer-published material on the topic.

12. FAQ

What does the error 0xFFDF_0117 [S7DOS] "The block/op. sys. update is too large" mean on a CPU 315-2EH14-0AB0?

The S7DOS downloader on the CPU has detected that the new program image, after staging and adding its internal safety margin, exceeds the work memory available for user code on the CPU 315-2EH14-0AB0. The 384 KB work memory minus the 128 KB retentive reservation leaves a 256 KB code pool, and S7DOS is reporting that the new image cannot be staged inside this pool.

Why does STEP 7 show 180 KB free work memory but the CPU still rejects the download?

The free-memory figure reported in Module information > Memory is the raw remaining work memory. S7DOS additionally subtracts the retentive ceiling, the staging buffer, and the alignment padding needed to commit the new image. The 180 KB free figure is not the same as the 256 KB (or smaller) pool that S7DOS is budgeting against, and the discrepancy causes the apparent contradiction.

Can I keep the retentive area at 128 KB and still fit more code?

Not on a CPU 315-2EH14-0AB0. With 128 KB reserved for retentive data, the user program is limited to roughly 256 KB. If the project already uses 208 KB and additional code is required, either reduce the retentive reservation to a value that matches the actual retentive footprint, or upgrade the CPU to a 317-2 PN/DP (1 MB work memory, 256 KB retentive max) or a 319-3 PN/DP (2 MB work memory, 700 KB retentive max).

Is it safe to delete blocks online to free work memory?

Yes, provided the block is not referenced by the running program. Delete obsolete DBs and unused FBs/FCs via Online > Delete on the blocks container. Deleting a referenced block causes the CPU to enter STOP with a "Block not found" diagnostic event, so always run Cross References first to confirm that the block has no call sites.

Will reducing the retentive memory on a CPU 315-2EH14-0AB0 cause loss of process data?

It will, for any data placed outside the new retentive partition. Specifically, the M bits, T timers, C counters, and DBs that are declared retentive but exceed the new ceiling become volatile, and will be re-initialised on the next power-up. Audit the project's retentive declarations in CPU Properties > Retentive Memory and in the DB property sheets before reducing the ceiling, to ensure that all state which must survive a power cycle is inside the new partition.

Does the MMC size matter for 0xFFDF_0117?

Indirectly, yes. The load memory used during a download is the integrated RAM (1 MB) plus the MMC. If the integrated RAM is full and the MMC is also at or near capacity, S7DOS has less staging room to operate. A higher-capacity MMC (8 MB instead of 4 MB) or switching the load path to "MMC only" can recover staging space and clear the 0xFFDF_0117 event.

Back to blog