S7-400 Memory Reset: Preserving Online-Modified DB Values

David Krause14 min read
S7-400SiemensTutorial / How-to
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

Overview: S7-400 Memory Reset and Online Data Preservation

A SIMATIC S7-400 CPU holds two parallel views of every data block: the initial values compiled into the offline STEP 7 project on the programming device (PG), and the actual values held in the CPU's load and work memory at runtime. Operators and commissioning engineers routinely overwrite the actual values through the Data View (Monitor/Modify) or through variable tables (VAT) without saving the changes back to the offline project. When a memory reset (MRES) is then executed and the user program is reloaded from the offline source, those unsaved online edits are overwritten by the initial values in the offline DB. The data is not lost on the CPU side - it is lost from the project. This article documents the engineering procedure required to round-trip the actual values from the running CPU, through the offline project, and back into the CPU after a planned MRES plus program reload.

The procedure applies to all S7-400 CPUs programmed with SIMATIC Manager STEP 7 V5.x or, for the newer S7-400 V6 CPUs, with TIA Portal. The exact behavior of MRES differs depending on whether the load memory is backed by RAM (with battery) or by a Flash EPROM submodule / Micro Memory Card (MMC); both variants are covered.

Safety notice: Memory reset of a running plant PLC will stop the user program execution. Schedule MRES during a documented plant shutdown. Confirm all safety interlocks, emergency-stop circuits, and process interlocks are in a defined safe state before clearing work memory. Always perform a full STEP 7 project backup (Archive) before any reset operation on a production system.

S7-400 Memory Architecture

An S7-400 CPU separates memory into three logical regions. Understanding where DB values physically reside determines whether MRES erases them.

Memory Region Location Volatility Contents
Load memory RAM + Flash submodule (older CPUs), or MMC (newer CPUs) Non-volatile when on Flash / MMC; battery-backed when in RAM only Program code, configuration, DB initial values
Work memory RAM on the CPU module Volatile (cleared by MRES) Runtime copy of code and current DB actual values
System memory RAM on the CPU module Volatile Process image, bit memory, timers, counters
Retentive memory Subset of work memory and system memory Battery-backed, retained across power cycle and warm restart Flag bytes M, timer/counter, DB data marked as retentive in STEP 7

DB values are stored in load memory as the initial value set compiled by STEP 7. When the CPU starts up, the initial values are copied into work memory and become the actual values. Any online modification performed through the Data View or a VAT writes to the actual values in work memory; in many CPU variants the change is also written back to load memory (RAM area) so that it survives a power cycle when the load memory is RAM and the battery is healthy. With Flash / MMC load memory, an online change still updates the RAM copy; it is not automatically mirrored to the Flash submodule or MMC without an explicit "copy RAM to ROM" action.

MRES (memory reset) wipes work memory and, depending on the mode and CPU, parts of the load memory. A subsequent download from STEP 7 always writes the offline initial values into load memory. The retention bit on a DB only protects the value during power-off and warm restart - it does not protect against MRES followed by a download.

Where Online-Modified DB Values Actually Live

When you open a DB online, right-click a cell, and choose "Modify value", STEP 7 sends a write request to the CPU. The CPU writes the value into:

  1. The active actual value in work memory (always).
  2. The load memory RAM image of the DB (when the DB is loaded into the RAM area of load memory - the default for S7-400 with Flash submodule / MMC).

If the CPU then executes a RAM-to-ROM (copy RAM to ROM), the value also propagates to the Flash submodule / MMC. Without RAM-to-ROM, an MRES that erases load memory RAM will discard the change even though the user "wrote it online". This is the most common cause of the question "I modified the value online - why is it gone after MRES?"

Prerequisites Before Performing the Memory Reset

  • STEP 7 V5.5 SPx or TIA Portal V15 or later (matching the project used to commission the CPU).
  • Online connection to the target S7-400 CPU via MPI, PROFIBUS, or Industrial Ethernet / PROFINET.
  • Latest offline project of the plant loaded on the PG. If unsure, archive the live project first: File > Archive (STEP 7 V5) or Project > Archive (TIA Portal).
  • Knowledge of the CPU variant and load memory type: open HW Config and read the order number (MLFB). Common S7-400 CPU order numbers include 6ES7412-1XF04-0AB0, 6ES7414-3EM06-0AB0, 6ES7416-3ER05-0AB0, 6ES7416-3FR05-0AB0. CPUs ending in PN/DP and 41x-3 variants use MMC; older 41x-1 / 41x-2 variants use Flash submodule plus battery-backed RAM.
  • Plant shutdown authorization and process interlocks verified safe.
  • Read access to the DB online - if the DB is "know-how protected" (block know-how protection with a password), obtain the password before attempting to read online actual values.

Procedure 1: Copy Online Actual Values to the Offline DB

This is the simplest method for a single DB that you have been modifying manually through the Data View.

  1. In SIMATIC Manager, open the offline project and navigate to the target DB in the S7 program / Blocks folder. Double-click to open the block in the LAD/FBD/ST editor.
  2. From the menu bar choose View > Data View to switch from the declaration view to the data view.
  3. Connect online: PLC > Connect to Target System > Online.
  4. Open a second instance of the same DB in online mode: select the DB in the project tree and choose PLC > Monitor/Modify, or right-click the offline DB and choose Open in Online View.
  5. Arrange the offline and online windows side by side (tile vertically). STEP 7 also provides Options > Compare Blocks which lets you select the online block and click Go to to position both windows on the same offset.
  6. In the online window, select all rows (Ctrl+A) and copy (Ctrl+C).
  7. Click into the offline Data View window, select all rows, and paste (Ctrl+V). STEP 7 will display a dialog warning that you are overwriting offline values - confirm.
  8. Save and compile the offline DB (Ctrl+S).

The offline DB now contains the actual values as the initial values. When the program is downloaded after MRES, these become the new initial values of the CPU's DB.

Procedure 2: Use a Variable Table (VAT) for Batched Parameters

When the online-edited values are scattered across multiple DBs or you need an auditable parameter record, a VAT is more reliable than the DB Data View copy/paste.

  1. In SIMATIC Manager, open S7 Program > Blocks and double-click VAT (or insert a new VAT: Insert > S7 Block > Variable Table).
  2. Declare one row per online parameter. Use the symbolic name if available, for example:
    "DB_Recipe".Setpoint_Temperature    REAL    85.0
    "DB_Recipe".Setpoint_Pressure    REAL    2.4
    "DB_Motor".Run_Hours    DINT    0
  3. Connect online and click the Monitor (glasses) button. STEP 7 reads the current actual values from the CPU into the "Monitor Value" column.
  4. Right-click the VAT and choose Save Monitor Values to VAT or use Table > Export to a CSV file. CSV export captures the timestamp and is suitable for inclusion in a commissioning report.
  5. Store the CSV alongside the project archive. Do not delete the VAT - it remains the canonical record of the online parameter set.
Engineering practice: Maintain a dedicated VAT named PARAM_BACKUP or SITE_PARAMETERS for every project. Keep one copy on the engineering PG and one in the project archive. VATs are not downloaded to the CPU, so they cannot be lost on the PLC side - they only live in the project.

Procedure 3: Backup the Entire Online Project (S7-400 with MMC)

On S7-400 CPUs that use MMC (all PN/DP V3+ CPUs and 41x-3 series), the full project is mirrored on the card. STEP 7 can read it back to the PG.

  1. Insert the MMC into a USB card reader on the PG, or keep it in the CPU and read online.
  2. From SIMATIC Manager: File > Retrieve (Archive > Retrieve) - not appropriate. Instead use PLC > Upload Station to PG. STEP 7 prompts for the target project and rebuilds the offline image from the CPU.
  3. Save the uploaded project as a new archive (File > Archive) with a date suffix.

The upload captures online-modified actual values when the DB was stored in the RAM region of load memory. For older CPUs with Flash submodule, the online changes are written only to RAM - in that case Upload Station to PG returns the offline initial values, not the online edits. Therefore Procedure 1 or 2 is required for those CPUs.

Performing the Memory Reset

Two reset modes exist on the S7-400. Both are reachable from STEP 7 and from the physical mode selector on the CPU front panel.

Reset Mode Effect on Work Memory Effect on Load Memory When to Use
MRES (Memory Reset) via STEP 7 Wiped RAM area wiped; Flash / MMC area preserved unless "Delete all" is selected Reload after a planned program change
MRES via CPU mode selector (MRES position) Wiped Same as STEP 7 MRES for older CPUs; some variants require additional switch toggles Field service when the PG is unavailable
Factory reset (CPU-specific) Wiped Wiped including Flash / MMC image Decommissioning or moving to another machine

For the planned reload scenario described here, use STEP 7 MRES:

  1. In SIMATIC Manager, with the PG connected online, choose PLC > Clear/Reset.
  2. Select the CPU, confirm the online connection dialog.
  3. STEP 7 displays the options Clear / Reset (MRES) and Delete all. Choose Clear / Reset - this clears work memory only and prepares the CPU for a fresh download.
  4. The CPU stops (RUN indicator off, STOP indicator on). The diagnostic buffer records the reset with operator name and timestamp.

Do not select "Delete all" unless the intent is to wipe the load memory image from Flash / MMC - in that case any RAM-to-ROM state stored on the card is lost, and the project can only be recovered from the offline archive.

Downloading the User Program

With the CPU in STOP and work memory cleared, download the project:

  1. Select the S7 program (or Blocks folder) in the offline project.
  2. PLC > Download or right-click Download to Target System.
  3. STEP 7 prompts whether to overwrite existing blocks - confirm. For System Data (SDB), always overwrite; the new hardware configuration must take effect.
  4. After the download completes, the CPU remains in STOP. Verify with PLC > Monitor/Modify that the initial values now equal the values you captured in Procedure 1 or 2.

Restoring the Online Values After the Reload

If you captured the values to the offline DB (Procedure 1), they are already in the download. No further action is required - the reload itself restores them.

If you captured them only into a VAT (Procedure 2), restore manually after the CPU returns to RUN:

  1. Open the VAT that holds the backup values.
  2. Connect online. The "Monitor Value" column shows the current actual values (which are the initial values from the reloaded project).
  3. Select the column "Modify Value" and paste or type the backup values from the VAT column "Modify Value".
  4. Click the Modify (force) button. STEP 7 transmits the values to the CPU.
  5. Confirm the values were accepted: the "Status" column must display OK or no error.

If the CPU is in RUN, the writes are applied as variable updates without a stop. If the program writes these DB locations cyclically from logic, the change may be overwritten immediately - in that case the design itself must be reviewed so that the parameters can be loaded offline, or the writes must be made from a function that respects the manual entry (e.g. a recipe handling block).

Verification

After reload and parameter restore, perform these checks:

  • Open the DB online and confirm each modified offset matches the backup value.
  • Check the CPU diagnostic buffer for warnings or errors: PLC > Diagnostics/Settings > Module Information. Verify the most recent events list a clean STOP-RUN transition with no SDB download errors.
  • From the VAT, monitor the parameter row for at least one full program scan and confirm the value does not get overwritten by cyclic logic.
  • If the CPU has a backup battery, measure the BATF indicator - a battery low condition will silently revert RAM load memory contents on next power loss.

Troubleshooting Matrix

Symptom Root Cause Remediation
Online values lost after MRES + download Offline DB initial values replaced the online actual values Re-capture online values using Procedure 1 before MRES, or restore via VAT after reload
DB online shows values, but Upload Station to PG returns different values CPU uses Flash submodule; online edits are in RAM only and not mirrored to Flash without RAM-to-ROM Use Procedure 1 (Data View copy) or Procedure 2 (VAT) explicitly
"The block is know-how protected" message on online DB open DB has know-how protection with password Remove protection on offline DB with the password, recompile, or use VAT to read individual tags
Modify request rejected, status shows "Access error" DB opened without write privilege, or operator password level insufficient Connect with the correct authorization; check PLC > Access Rights or PLC > Set Password configuration
Values restored, then immediately overwritten by user program Cyclic program logic writes the same offsets Update offline initial values instead of using online modify; or change the write logic to read once on startup
CPU does not enter RUN after download SDB error, missing hardware, or non-retentive initialization fault Read diagnostic buffer; check for OB102 / OB121 missing OBs, address errors, or rack configuration mismatch
MRES via CPU mode selector does not clear project Mode selector sequence wrong on CPU variant Refer to the CPU-specific manual; some S7-400 CPUs require MRES-STOP-MRES sequence within 3 seconds
Battery-backed RAM loses values on power cycle Battery low or missing Replace backup battery (order numbers depend on CPU, e.g. 6ES7971-0BA00 for some PS modules); check BATF LED

CPU-Variant Considerations

CPU Family Order Number Example Load Memory MRES Behavior
S7-400 CPU 412-1 (early) 6ES7412-1XF03-0AB0 RAM + Flash submodule MRES clears work memory; Flash image preserved
S7-400 CPU 414-2 DP 6ES7414-2XK04-0AB0 RAM + Flash submodule Same as above
S7-400 CPU 416-2 6ES7416-2XK02-0AB0 RAM + Flash submodule Same as above
S7-400 CPU 412-2 PN 6ES7412-2EK06-0AB0 MMC (Flash) MRES clears work memory; MMC image preserved unless "Delete all"
S7-400 CPU 416-3 PN/DP 6ES7416-3ER05-0AB0 MMC (Flash) Same as PN series
S7-410 (new generation) 6ES7410-5HM08-0AB0 MMC + SSD option Refer to TIA Portal V16+ documentation; MRES options differ

For MMC-equipped CPUs, you can also physically remove the MMC and archive its contents using a card reader, ensuring the entire project including online-edited values (if RAM-to-ROM was executed previously) is captured outside the PG.

Commissioning Notes and Field-Proven Caveats

  • Always document the VAT contents at the moment of MRES. The timestamp and the operator's signature in the diagnostic buffer is the only audit trail.
  • Avoid "online modify" for parameters that are part of the recipe or machine setpoint flow. Bake them into the offline initial values so that MRES + reload is idempotent.
  • If the plant has a redundant S7-400H pair, the procedure applies to the standby CPU first. Online-edit the standby, MRES the standby, download, observe, then switch over before repeating on the other side.
  • For S7-400 CPUs that support write-protection of the MMC (password on the card), the password is required for any download. Note it before MRES - clearing the password requires a card erase.
  • The diagnostic buffer is retentive only on CPUs with a healthy backup battery. After replacing a dead battery, the diagnostic buffer is cleared and historical context is lost.

FAQ

Will MRES and program reload delete the values I edited online in a global DB?

Yes, if the values are not captured before the reload. MRES clears work memory, and the subsequent download writes the offline initial values into the DB. To preserve them, copy the online actual values into the offline DB (Procedure 1) or capture them in a VAT (Procedure 2) before executing MRES.

What is the difference between "Clear/Reset" and "Delete all" in STEP 7 for an S7-400 CPU?

Clear/Reset (MRES) wipes work memory and the RAM area of load memory; the Flash submodule or MMC is preserved. Delete all additionally wipes the Flash / MMC image so the CPU has no project at all and requires a full download. Use Clear/Reset for routine reloads.

Can I retrieve the online-edited values from the CPU without going to the plant?

Yes, when the CPU is connected via MPI / PROFIBUS / PROFINET and the PG is online. Use PLC > Upload Station to PG for MMC-based CPUs, or open the DB online in Data View and copy the actual values to a VAT. For older RAM + Flash CPUs, only the Data View or VAT capture round-trips the actual values reliably.

Does setting a DB as "retentive" protect it from MRES?

No. Retentivity protects values during power-off and warm restart, not during MRES followed by a download. Use the procedures in this article to back up retentive or non-retentive DBs before MRES.

Where do I find the S7-400 system and CPU manuals?

Siemens publishes the SIMATIC S7-400 Automation System manual and per-CPU manuals on Siemens Industry Online Support at SIMATIC S7-400 System Manual. For TIA Portal programming of newer S7-400 V6 CPUs, refer to the TIA Portal help and the S7-400 CPU-specific manual on the same portal.

Back to blog