S7 Data Block Initial Values Not Updating: STEP 7 Troubleshooting

David Krause12 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

Problem Description

An engineer downloads a STEP 7 v5.x project containing a shared data block (DB) with a STRUCT of ten INT values used as process time parameters. The engineer edits the initial values in the data block declaration, performs a CPU memory reset on the S7-300/S7-400 (or in PLCSIM), and re-downloads only the DB block. In the online view of the DB, the actual values still display the previous (old) parameter set, even though the offline declaration now contains the new initial values. The user has confirmed that no other logic in the program overwrites the DB variables, and the issue reproduces consistently on every download cycle.

This symptom is a classic STEP 7 v5.x misunderstanding. The root cause is not a defect in the controller, PLCSIM, the project, or the download. It is a normal behavior of how SIMATIC Manager separates initial values from actual values for instance data blocks. The fix requires a single additional action — re-initializing the data block — that is easy to miss because it is not part of the standard download flow.

Symptoms Checklist

  • Initial values were edited in the DB declaration table (offline).
  • Project was saved, compiled, and downloaded to the CPU or to PLCSIM.
  • A CPU memory reset (MRES) was performed to clear retain/non-retain data.
  • In online view, the DB still shows the previous (pre-edit) values.
  • Cross-reference search confirms the DB is not being overwritten by user logic in OB1, OB35, FB, or FC blocks.
  • Issue reproduces after deleting the DB from the S7 program and re-downloading only the DB.

Root Cause: Initial Values vs. Actual Values

STEP 7 v5.x data blocks carry two separate value tables for every declared variable:

Value Type Defined In When It Is Loaded Visibility
Initial value (Startwert) DB declaration table in the offline project Only when the block is re-initialized (e.g., on a cold restart, after a download with initialization, or when the engineer explicitly chooses "Initialize Data Block") Visible in offline declaration and in the Data View column "Initial Value"
Actual value (Aktualwert) Runtime memory (load memory / work memory image of the DB in the CPU) Persists from the previous startup or download. The current value is what the program reads at runtime. Visible in online view "Monitor/Modify" and in the Data View column "Actual Value"

When the user changes the initial values in the declaration table and performs a normal block download, STEP 7 updates the offline image and the load image on the CPU, but it does not push the new initial values into the work-memory actual values. The actual values from the previous run remain in place. This is by design, because the runtime system cannot assume that an online modification to a declaration is meant to wipe the current process state. Per the Siemens Support entry 837001 — "What is the significance of the initial and actual values of a data block in STEP 7 v5.x?":

The initial value is only configured once for a data block or for a newly declared variable data block. If the variable already exists, the actual value is retained after a download until an explicit initialization of the data block is performed.

Consequently, the DB on the CPU continues to expose the previous actual values to user logic, while the new initial values sit unused in the load image waiting for the next initialization event.

Important: A CPU memory reset (MRES) clears the work memory and retain area, but it does not re-read the initial values from the load image into the work memory by itself. You must trigger a download-with-initialization or use the SIMATIC Manager "Initialize Data Block" function to copy the initial values into the actual values.

Affected Versions and Platforms

The issue applies to the classic STEP 7 v5.x line and is independent of the CPU family or PLCSIM version:

Component Affected Versions Notes
STEP 7 v5.0 through v5.7 (all service packs) Behavior is consistent across the entire v5.x line; addressed in the official Siemens FAQ 837001
S7-300 CPUs All CPU types (312, 314, 315, 317, 319) Includes F-CPUs in standard DB handling
S7-400 CPUs All CPU types (412, 414, 416, 417, 410) Same behavior in central and distributed I/O configurations
S7-200 (legacy) Not applicable (uses V-memory model) Different programming paradigm
PLCSIM v5.x v5.3 through v5.4 SP8 Reproduces identical behavior; PLCSIM is not the source of the problem
TIA Portal (S7-1200/S7-1500) Different model — uses "Start values" with optimized/standard access; see TIA Portal help Not covered by this article

Solution: Re-Initialize the Data Block

There are three supported methods to push the new initial values into the actual values. Pick the one that fits your workflow.

Method 1 — "Initialize Data Block" from SIMATIC Manager (Recommended)

  1. Open the offline project in SIMATIC Manager.
  2. Open the S7 program and expand the "Blocks" container.
  3. Right-click the affected DB (e.g., DB100).
  4. Select Edit > Initialize Data Block (German UI: Bearbeiten > Datenbaustein initialisieren).
  5. SIMATIC Manager prompts: "Do you want to initialize the data block?" — confirm with Yes.
  6. The actual values of the DB are now overwritten with the initial values from the offline declaration.
  7. Download the (now initialized) DB to the CPU or to PLCSIM using PLC > Download or by dragging the block onto the online target.

This is the workflow called out in the Siemens support entry. It is the simplest method when the change is a deliberate one-time reset, and it is safe because the offline initial values are already the new values you typed in.

Method 2 — Download the Entire S7 Program with Initialization

  1. In SIMATIC Manager, select the S7 program or the entire Station.
  2. Choose PLC > Download.
  3. When prompted "Do you want to initialize the data blocks?", select Yes.
  4. STEP 7 will copy all DB initial values into the actual values during the download.

This is useful when the change to the DB is part of a broader software revision (e.g., version bump) and you want every DB re-initialized consistently.

Method 3 — CPU Memory Reset (MRES) Followed by a Cold Restart

  1. Place the CPU in STOP mode.
  2. Perform a memory reset (MRES) using the mode selector: turn to MRES, hold until the "STOP" LED flashes, return to MRES, release.
  3. Switch the CPU back to RUN/PROG and perform a cold restart (OB102). On a cold restart, all DBs are re-initialized from the load image.
Warning: A memory reset alone is not sufficient. The CPU must perform a cold restart (not a warm restart) so that the OB102 path executes the DB initialization. If the project has no OB102, the CPU performs a warm restart, which can leave persistent actual values intact. Always verify which startup OB is configured in the CPU properties ("Startup" tab).

Method 4 — Use the "Initialize on Download" Option (Per-DB Persistent Setting)

For projects that routinely re-initialize a specific DB on every download, STEP 7 v5.x exposes a per-block attribute:

  1. Right-click the DB in the Blocks container.
  2. Choose Object Properties > Download tab (German: Eigenschaften > Download).
  3. Check the option "Initialize data block on download" (German: Datenbaustein bei Download initialisieren).
  4. Confirm with OK and save the project.

From this point on, every download of the DB to the CPU will overwrite the actual values with the initial values. This is convenient for commissioning but dangerous for production, because an engineer who edits an initial value by accident and downloads will lose the running process state. Best practice is to enable this attribute only for commissioning blocks and to disable it before handing the project over to operations.

Verification

After applying any of the four methods, verify that the new values are now active in the running CPU or PLCSIM instance.

Verification Procedure

  1. Open the DB in online view: right-click the DB > Open Online (or Monitor/Modify).
  2. Switch to the Data View tab (German: Datenansicht).
  3. Confirm that the Actual Value column now matches the Initial Value column for every variable in the STRUCT.
  4. Cross-check the S7 program with Options > Reference Data > Display and search for any cross-reference that writes to the DB. If logic is intentionally writing to the DB at runtime (e.g., operator setpoints, recipe load), the DB will only reflect the new initial values for one cycle before the program overrides them — that is expected.
  5. Trigger the production sequence and confirm that the process times now match the new values.

Diagnostic Table

Step Expected Result Possible Failure
Right-click DB > Open Online Online DB opens without error Communication error: check PG/PC interface and online partner
Data View > Actual vs. Initial All rows identical Actual still old: re-run Method 1; check for active writes via cross-reference
Force/Modify a value in the DB Online value updates immediately CPU in STOP or the DB is read-only: check DB attributes in declaration
Stop CPU > download updated DB > start Initial values appear in actual column DB attribute "unlinked" (only stored in load memory, no instance DB generated) — check DB generation rule in S7 program

Edge Cases and Field-Proven Caveats

1. DBs Generated by an FB (Instance DBs)

An instance DB generated from an FB (Function Block) does not have its own independent initial-value table. The initial values are inherited from the FB's declaration (the STAT section). Re-initializing the instance DB pushes the FB declaration defaults into the actual values. If the FB contains code that pre-processes the STATs in its startup section, the pre-processed values will overwrite the defaults after the first cycle.

2. UDT-Based Data Blocks

Data blocks built from a UDT (User-Defined Data Type) inherit their initial values from the UDT source. If the UDT is edited centrally, every DB based on that UDT shows the new initial values after a project-wide recompile, but — as before — only after a download-with-initialization does the CPU work memory pick them up. The UDT must be compiled and downloaded before the dependent DB, otherwise the DB retains the old UDT structure.

3. DBs with the "Unlinked" Attribute

A DB marked as unlinked in its object properties exists only in load memory and is never copied to work memory. The "Initialize Data Block" function is meaningless for an unlinked DB because the work-memory image is not generated. To use an unlinked DB at runtime, you must change the attribute to non-unlinked and re-download.

4. Retain Behavior

If a DB is declared as retain in the CPU's retentivity configuration, the actual values survive a warm restart and a power cycle. In that case, neither MRES nor a warm restart will bring the new initial values into play. You must either remove the retain attribute for the affected DB, perform a full memory reset (which wipes retain), or use Method 1 or 4 to push the new initial values into the retain area explicitly.

5. PLCSIM-Specific Behavior

PLCSIM v5.x mirrors the S7-300/400 CPU behavior, including the initial-vs.-actual value separation. When using PLCSIM for unit tests of a DB-heavy function (e.g., a recipe loader that reads ten process times from a STRUCT), the test harness must explicitly initialize the DB before exercising the FB. The Runmode S7 DB Initializer utility automates this for batch test rigs: it copies the offline initial values into the PLCSIM actual values at the start of every test case, eliminating the side effect.

6. Block Consistency After Edit

If the DB's STRUCT signature has changed (e.g., a new field was added, a type was changed from INT to REAL), STEP 7 may refuse to download the block as a simple download and instead demand a block-consistency download or a full program download. In that case, the download dialog will offer the initialization option automatically.

Cross-Reference Diagnostics: Confirm Logic Does Not Overwrite the DB

Before assuming the cause is the download mechanism, always check the user program. A common reason that "initial values do not take effect" is that an OB, FC, or FB is copying values into the DB at every cycle or at startup.

Procedure

  1. In SIMATIC Manager, choose Options > Reference Data > Display.
  2. When prompted, generate fresh reference data (this requires a successful compile).
  3. Open the Cross-Reference view and filter by the DB number (e.g., DB100).
  4. Inspect every Write access: the source block, the network, and the operand. Any of the following constructs will overwrite the actual value:
          L     500              // 500 ms new process time
          T     DB100.DBD0       // overwrites DB100.processing_time_1
    
  5. If a write is found, decide whether the write is intended (recipe load, setpoint from HMI, etc.) or accidental. If it is intended, the DB will only hold the new initial value for one scan before the program re-writes it — that is normal and not a bug.

Best Practices for Commissioning and Operations

Practice Why
Always initialize a DB after editing initial values in commissioning Guarantees the running process reflects the new parameters immediately
Disable "Initialize data block on download" before site handover Prevents accidental loss of operator-entered setpoints
Document the retain area in the project notes Operators know which DBs survive a power cycle and which do not
Use UDTs for repeating parameter sets Single point of change; one recompile updates all dependent DBs
Use cross-reference before editing any DB Avoids surprises when user logic overwrites the same memory range
Use PLCSIM for offline unit tests of DB-handling FBs Catches initialization issues before they reach the plant
Back up the project (Archive) before any mass re-initialization Rollback path if a wrong DB is pushed to a live CPU

Frequently Asked Questions

Why are my new S7 data block initial values not appearing online after a download?

STEP 7 v5.x separates initial values (offline declaration) from actual values (runtime memory). A normal block download updates only the load image; the work-memory actual values persist. To push the new initial values into the actual values, right-click the DB in SIMATIC Manager and choose Edit > Initialize Data Block, then re-download. See the official Siemens FAQ 837001 for details.

Does a CPU memory reset (MRES) re-initialize data blocks in STEP 7 v5.x?

No, not by itself. MRES clears work memory and retain, but the CPU must then perform a cold restart (OB102) to copy DB initial values from load memory into work memory. If the project has no OB102, only a warm restart runs and the actual values from the previous session can be retained. Use Edit > Initialize Data Block for a deterministic reset.

What is the difference between an instance DB and a shared DB for initial values?

An instance DB inherits its initial values from the STAT section of its parent FB; it has no independent initial-value table. A shared DB (declared as a global container, e.g., DB100) has its own declaration with its own initial values. Re-initializing either DB pushes the current declaration defaults into the actual values. If your FB pre-processes STATs in its startup code, the pre-processed values will overwrite the defaults after the first cycle.

Can I make STEP 7 re-initialize a specific DB on every download automatically?

Yes. Open the DB's Object Properties > Download tab and enable "Initialize data block on download". From then on, every download of that DB will overwrite the actual values with the initial values. Enable this only for commissioning blocks; disable it for production to avoid losing operator-entered setpoints.

Does PLCSIM behave the same as a real S7-300/S7-400 CPU for DB initialization?

Yes. PLCSIM v5.x mirrors the S7-300/400 runtime, including the initial-vs.-actual-value separation. The same fix applies: Edit > Initialize Data Block in SIMATIC Manager followed by a download to the PLCSIM instance. The Runmode S7 DB Initializer automates this in batch test setups.

Back to blog