S7-300 Data Block Download: Initial vs Actual Value Resolution

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 Overview

When an S7-300 CPU is loaded with a backup project, the data blocks (DBs) appear to download successfully, but the controller's actual runtime values do not match the initial values configured in the offline program. Typical symptom: the offline DB shows an initial value such as 3.000000e+001 for a motor gear parameter, but the online DB actual value remains 0 after a download, MRES reset, or block deletion. The PLC and MMC may even have been swapped to rule out hardware faults, yet the mismatch persists across hardware changes.

This article explains the S7-300 memory model that drives the initial-vs-actual-value distinction, identifies the root causes of the mismatch, and provides verified procedures in both STEP 7 Classic (SIMATIC Manager) and TIA Portal to force the initial values into the actual values during a download.

S7-300 Memory Model

The S7-300 CPU maintains two physically distinct memory areas that are routinely confused when troubleshooting data block downloads:

Memory Area Location Contents Persistence
Load memory MMC (Micro Memory Card) or internal flash Compiled blocks (FB, FC, OB, DB) including the initial-value section of every DB Retained without battery; survives MRES and power loss
Work memory Volatile RAM inside the CPU Runtime copies of blocks currently used by the CPU; the actual values of all DBs Lost on power loss; cleared by full MRES
Retentive memory Subset of work memory Selected tags configured as retentive (M bits, DB portions) Backed up by battery or MMC; survives warm restart

When STEP 7 or TIA Portal downloads a DB, the engineering software writes the block into load memory and triggers the CPU's block-update logic. The CPU then transfers the block into work memory so the user program can read and write it. The crucial behavior is what happens to the actual values of existing DBs during this transfer.

Initial Value vs Actual Value Semantics

A Siemens data block has three value categories that are routinely confused. The distinction is mandatory background for every DB download procedure:

Term Source Editable Offline? Editable Online? Used at Startup?
Initial value (declaration view) Declaration section of the DB in the project Yes No Applied on cold restart when no actual value exists
Initial value (load memory) Compiled snapshot stored on the MMC No (compiled from declaration) No Applied on cold restart and on DB re-download when configured
Actual value Current contents of the DB in work memory Not applicable Yes (Monitor/Modify) Used by the running program

The startup cycle is:

  1. Cold restart (OB100) or first-ever startup of a freshly loaded DB: actual values are overwritten by the initial values.
  2. Warm restart (OB101): retentive actual values are preserved.
  3. Hot restart (OB102): not supported on S7-300 (S7-400 feature only).
  4. Runtime: the user program reads and writes actual values; these overwrite the initial values.

When the symptom "DB initial value = 3.000000e+001 but actual value = 0" appears after a download, the runtime is using a stale actual value because the user program has written 0 into that DB tag since the last cold restart. Re-downloading the DB in RUN does not automatically push the offline initial value back into the running work memory unless the download is explicitly configured to do so.

Root Causes of DB Actual Value Mismatch

Six causes account for nearly every "initial value not visible as actual value" report on S7-300 CPUs:

  1. Download in RUN without the "Initialize actual values" option. The default for incremental downloads from STEP 7 or TIA Portal to S7-300 CPUs is to overwrite only the load-memory copy; running actual values in work memory are preserved.
  2. User program is overwriting the value on first scan. An OB1 segment initializes the gear tag from a recipe block or function call. After the cold restart the value briefly becomes 3.0e+001 and is then immediately overwritten.
  3. Retentive bit is set on the DB tag. The tag is configured as retentive, so the previous actual value is preserved across warm restarts and re-downloads.
  4. DB was generated from an instance or derived FB. Multi-instance DBs and instance DBs (assigned to FBs) get their structure regenerated from the FB; renaming or restructuring the FB can leave orphan tags that show an initial value but are never instantiated.
  5. MMC and offline project are out of sync. The backup project was archived from an earlier CPU version. After the MMC swap the CPU signature does not match the project signature, and STEP 7 silently skips the DB update.
  6. CPU is in a non-standard operating state (HOLD, ERROR, DEFECT, LINK-UP). In these states, DB updates from the engineering station are blocked or queued.

Resolution Procedure - STEP 7 Classic (SIMATIC Manager)

Prerequisites

  • STEP 7 V5.5 or V5.6 with the matching CPU HSP installed.
  • Online connection established via PROFIBUS DP, MPI, or Ethernet (CP 343-1) using the PG/PC interface.
  • Write access to the CPU unlocked (no password or password known).
  • Backup project opened in SIMATIC Manager with the correct CPU target selected.

Step-by-Step

  1. Connect to the target CPU: PLC > Accessible Nodes, select the target CPU, then PLC > Upload Station to PG to bring the current online blocks into the offline project. This guarantees the offline signature matches the online state before any block changes are pushed.
  2. In the offline project open the affected DB in Declaration View and verify the initial-value column shows the expected value (e.g., 3.000000e+001).
  3. Right-click the Blocks folder and select Download to Target System > All, or right-click the DB individually and select Download.
  4. When the Download to Target System dialog appears, enable "Initialize actual values" (labeled "Overwrite actual values with initial values" on some STEP 7 service packs). Confirm with OK.
  5. Confirm the operator dialog asking whether the CPU should switch to STOP. For S7-300, full initialization requires STOP. Partial initialization in RUN is supported on newer S7-300 CPUs but is limited to a small number of blocks per session.
  6. If the CPU enters STOP with the new DB, manually switch back to RUN-P after the download completes.

MRES Reset - When Full Reinitialization Is Required

Use the MRES sequence when the DB structure is corrupted or when multiple tag values must be reset simultaneously:

  1. Set the mode selector to STOP (the "STOP" LED is lit).
  2. Turn the selector to MRES and hold for at least 3 seconds; the "STOP" LED blinks slowly, then quickly.
  3. Within 3 seconds, return the selector to MRES. The CPU performs a memory reset; all DBs are deleted from work memory and load memory.
  4. The CPU automatically enters STOP with an empty Blocks folder.
  5. Download the full program from STEP 7: PLC > Download > All Blocks.
  6. Switch to RUN-P. On first scan, OB100 (if present) runs, then OB1 initializes the DBs from the load-memory initial values.
Important: A successful MRES leaves the CPU in STOP with no blocks in work memory; a full download is then mandatory. Repeating the selector toggles does not change behavior beyond a single successful MRES.

Resolution Procedure - TIA Portal (V16 or later)

The TIA Portal procedure for the same symptom follows the documented "Downloading blocks in the 'RUN' operating state" flow for S7-300/400 targets.

Step-by-Step

  1. Open the project in TIA Portal and switch to the project view.
  2. Select the target device in the project tree and click Go online. Confirm that the connection is established and the CPU's operating state is reported correctly.
  3. Open the Program blocks folder. Right-click the affected DB and choose Download to device > Software (all blocks); to limit the action to the single DB, right-click the DB and select Download to device > Selected block.
  4. In the Download preview dialog, locate the line for the affected DB. The default action for S7-300 targets is "Replace with download". To force initial values into actual values, change the action to "Replace and initialize". The drop-down is enabled only when the CPU supports online initialization in the current operating state.
  5. If the CPU is in RUN-P, TIA Portal requests a temporary STOP-RUN transition for blocks where the download cannot be performed in RUN. Confirm the dialog.
  6. After the download completes, open the DB in Monitor & Modify and verify the actual value matches the configured initial value.

The TIA Portal behavior is documented in Downloading blocks in the 'RUN' operating state to the device (S7-300, S7-400). The reference page covers the "Consistent download" requirement, the operating-mode transition rules, and the maximum number of blocks that can be initialized in RUN per session.

For per-block downloads from the program editor, the alternate workflow described in Downloading blocks in the program editor to device (S7-300, S7-400) applies: right-click in the instruction window of the program editor and select Download to device from the shortcut menu. Use this path when a single modified DB must be pushed while leaving the rest of the running program untouched.

Operating-Mode Selection Rules

Action Allowed in STOP Allowed in RUN Notes
Download DB with "Initialize actual values" Yes Yes (limited, CPU-dependent) S7-300 supports RUN downloads for a small number of blocks per session; STOP is the safer choice for full reinitialization
Full program download Yes No Requires STOP
MRES memory reset Yes (selector must be in STOP first) No Erases work memory
Format MMC Yes No Performed from STEP 7 / TIA Portal; erases load memory
Modify online actual value (Monitor/Modify) Yes Yes Useful for one-time correction without re-downloading

Verification

  1. After the download, open the DB in Monitor & Modify. The "Actual" column should match the initial-value column for every tag in the DB.
  2. Trigger a warm restart (STOP > RUN-P with selector) and observe whether the value persists. If it does, the tag is non-retentive; if not, the tag is retentive and the user program is reapplying the value on first scan.
  3. To prove that the issue is the user program overwriting the value rather than the download, insert a cross-reference (STEP 7: Options > Cross-Reference; TIA Portal: Show usage) and search for the gear tag's symbolic name. Look for writes from OB1, OB100, FB instances, or recipe functions.
  4. Open the CPU diagnostic buffer (STEP 7: PLC > Diagnostic/Setting > Diagnostic Buffer; TIA Portal: Online & Diagnostics > Diagnostic Buffer) and confirm the download event was logged with the correct block count and timestamp.
  5. If the gear value still reverts, attach a watch table with the gear tag and break the program execution at the offending write. The watch table updates confirm the write is happening exactly where cross-reference reports.

Troubleshooting Matrix

Symptom Likely Cause First Check Fix
Initial value correct offline, actual value 0 online Download in RUN without initialization Check the download dialog for "Initialize actual values" option Re-download in STOP with "Initialize actual values" enabled
Value resets to 0 after every restart User program initializes the tag in OB1 Cross-reference the tag symbol Remove the redundant write or move it behind a first-scan flag
Value persists across restarts but not after re-download Tag is retentive DB declaration: "Retain" column Clear "Retain" or set to "Non-retain" if startup default is desired
Multiple tags show 0 after MMC swap CPU signature mismatch; STEP 7 skips block update Compare online/offline CPU name and firmware Upload station to PG, recompile, then re-download with initialization
Download fails with "Block exists with different interface" FB interface changed; dependent DB needs regeneration Compare FB source online vs offline Delete the dependent DB and re-download the FB so the DB is recreated automatically
DB loads but the tag is not listed in Monitor/Modify Tag added offline but DB was not recompiled Right-click DB > Properties > Last modified Recompile the DB (Project > Compile All) and re-download
"Initialize actual values" greyed out CPU firmware does not support online initialization Check CPU firmware version against TIA Portal release notes Perform download in STOP, or upgrade CPU firmware to a release that supports the feature

Safety and Best Practices

  • Always perform the download to a STOP-mode CPU when the goal is to reset actual values to the initial values. RUN-mode initialization is limited and CPU-specific.
  • Before issuing an MRES, archive the current online project with Upload Station to PG. MRES erases work memory, and any block not present in the offline project will be lost.
  • Configure retentivity deliberately. A DB tag marked "Retain" prevents the load-memory initial value from ever being applied after a warm restart, regardless of how many times the DB is re-downloaded.
  • When modifying DB initial values in a running plant, use Monitor/Modify for one-time corrections and reserve DB re-downloads for offline engineering changes only.
  • Verify the CPU firmware supports the TIA Portal version used. Mismatched firmware/TIA combinations can silently drop "Replace and initialize" actions on older S7-300 CPUs (e.g., CPU 31x with firmware older than V2.6 may not initialize in RUN).
  • After any DB re-download, archive the project again so the offline backup reflects the controller's current state.

FAQ

Why does the S7-300 DB initial value not appear as the actual value after a download?

The download writes the DB to load memory and, by default, only replaces the work-memory block structure; the existing actual values are preserved. To force the offline initial values into the running DB, re-download in STOP mode and enable "Initialize actual values" (STEP 7) or "Replace and initialize" (TIA Portal).

What is the difference between initial value (declaration view) and initial value (load memory)?

The initial value in the declaration view is the editable source-of-truth in the project. STEP 7 / TIA Portal compile this declaration into a snapshot that becomes the initial value in load memory on the MMC. The declaration view is editable; the load-memory initial value is regenerated every time the DB is recompiled.

Does MRES reset DB actual values to initial values?

Yes. A successful MRES erases the work-memory copies of all blocks. After MRES the CPU is in STOP with an empty Blocks folder. When you download the program back, OB100 (if present) runs on the next RUN transition and applies the load-memory initial values to every DB tag.

Can I download a single DB without stopping the entire CPU?

Yes for newer S7-300 CPUs. In TIA Portal, right-click the DB and choose "Download to device > Selected block" with the "Replace and initialize" action; in STEP 7 Classic, right-click the DB and select "Download" with "Initialize actual values" enabled. The CPU briefly transitions to STOP for the affected block, then resumes RUN-P.

Why does my DB tag revert to 0 even after I re-download with initialization?

Most often the user program is writing the tag on the first scan of OB1. Use cross-reference (STEP 7) or "Show usage" (TIA Portal) to locate every write to the tag and either remove the redundant write or guard it with a first-scan flag.

Back to blog