Problem Definition: Software (all) Download Erases Retentive Memory
When an engineer selects Online > Download to device > Software (all) in the Siemens TIA Portal, the entire user program — all blocks, PLC data types, PLC tags, hardware configuration, and runtime data — is overwritten on the target S7-1200 or S7-1500 CPU. Critically, this action resets every runtime value to its initial value, including all retentive variables. This behavior is identical to a power-on with memory reset and is not what most users expect from a routine program update.
The root cause is functional, not a defect: the "Software (all)" option is defined in the TIA Portal documentation as the most complete form of download, intended to bring the device to the same state as a freshly configured CPU. The CPU enters STOP, the entire Load memory is replaced, the Work memory is cleared, and the Retentive memory partition is rebuilt from the project's initial values.
SET_RETAIN or contained in a DB marked as retentive will all be zeroed. Plan maintenance windows accordingly and always perform a backup before this download.Affected TIA Portal Versions and Documentation
| TIA Portal Version | Documentation Coverage | Manual Reference |
|---|---|---|
| V13 / V13 SP1 | Mentions "all values reset" without explicit retentive callout | STEP 7 Professional / Basic manual set |
| V14 / V14 SP1 | Implicit in "Download to device" chapter; not always surfaced in tooltips | STEP 7 Professional manual |
| V15 | Behavior present, but the retentive-data warning is hard to locate or omitted | STEP 7 Professional V15 manual |
| V15.1 and later | Explicit warning added: "Be aware that this also applies to retentive values." | STEP 7 Basic/Professional V15.1 and WinCC V15.1 system manual |
| V16, V17, V18, V19 | Warning retained and expanded with snapshot guidance | TIA Portal Help > Loading projects to the target system |
The canonical Siemens phrasing from V15.1 onward reads:
Software (all): The PLC program including all blocks, PLC data types and PLC tags is downloaded to the target and all values are reset to their initial values. Be aware that this also applies to retentive values.
This passage appears in the TIA Portal help under General information on loading. For the current Siemens documentation portal, the equivalent reference is the TIA Portal online help at the official Siemens Industry Online Support portal, where searching for "Download to device — Software (all)" returns the relevant system manual chapter.
Why Software (all) Behaves This Way
Internally, "Software (all)" executes the following sequence on the CPU:
- Issues a STOP request to the CPU.
- Performs a memory reset (MRES) equivalent on the load and work memory.
- Re-flashes the entire user program from the engineering project.
- Initializes all data blocks from their declared initial values (the value columns in the DB editor).
- Rebuilds the retentive memory map using only the values declared as
RETAINorRETAIN_PERSISTENTin the project source.
Because the runtime values held in the retentive memory partition come from the live process — not from the project source — they are not part of the download payload and are lost. The download brings the CPU into the state defined by the offline project, not into the state the CPU was in at the moment of the request.
Comparison of TIA Portal Download Options
| Download Option | Program Code | Hardware Config | Non-Retentive Data | Retentive Data | Use Case |
|---|---|---|---|---|---|
| Software (all) | Replaced | Replaced | Reset to initial | Reset to initial | Full re-flash after major change |
| Software (changes) | Updated where changed | Updated where changed | Preserved unless new block | Preserved | Incremental edits during commissioning |
| Hardware configuration only | Not modified | Updated | Preserved | Preserved | Adding/removing modules |
| Block (single) | Selected block only | Not modified | Depends on block | Preserved (untouched tags) | Single FB/FC/DB correction |
For most live systems, the safe choice is Software (changes), which performs a delta download and leaves retentive memory intact provided that no retentive tag's data type, name, or address has been changed.
Solution: Use the DB Snapshot Workflow
The recommended Siemens-supported recovery path before a "Software (all)" download is the DB Snapshot feature introduced in TIA Portal V14. A snapshot captures the current retentive values of one or more DBs into a binary file inside the project tree. Engineers can then restore those values after the download.
Prerequisites
- TIA Portal V14 or later with the online connection active.
- The PLC must be online and in
RUNorSTOPfor snapshot capture. - The DB structure in the offline project must match the runtime DB (same tag names, types, and retentive attributes). Renaming, retyping, or reordering tags invalidates the snapshot.
- Only DBs whose retentive attribute is
Set in IDBor whose tags carryRETAIN/RETAIN_PERSISTENTneed snapshots. Non-retentive DBs do not need backup.
Step-by-Step: Capture, Download, Restore
- In the project tree, expand Program blocks > System blocks > Program resources or the specific DB you wish to back up.
- Right-click the target DB and select Snapshot > Create snapshot of the data block.
- Confirm the snapshot file is stored under the DB element in the project tree (file icon changes).
- Optional: repeat for every retentive DB. Group them logically (e.g., recipe DBs, production DBs, counter DBs).
- Inspect the snapshot values to confirm they match expectations before continuing.
- Initiate the full download: right-click the CPU or the Program blocks folder > Download to device > Software (all).
-
Do not start the PLC. Leave it in
STOPto allow safe restoration. - Right-click each backed-up DB and select Snapshot > Load snapshot of data block to target device.
- If a DB contains a mix of retentive and non-retentive tags, the snapshot will overwrite both. Verify tag-level attributes before restore or split the DB into two with explicit retentive flags.
- Confirm the restored values in the Monitor & force table.
- Switch the CPU to
RUNand verify process state.
Verification Checklist After Restore
- Open the online DB and compare tag-by-tag against pre-download values.
- Check that counters, timers (IEC_TP, IEC_TON), and recipe pointers are at expected values.
- Confirm the CPU diagnostic buffer shows no snapshot inconsistency errors.
- If using
RETAIN_PERSISTENT, the values survive a power cycle; verify by disconnecting power briefly (only on commissioning bench, not on a live process).
Alternative Recovery Without Snapshot
If a snapshot was not captured before the destructive download, recovery options are limited but still possible:
| Method | Coverage | Limitation |
|---|---|---|
| Online backup via SIMATIC Automation Tool | Full project + retentive memory | Requires the backup to have been taken before the download |
| SD card / SIMATIC Memory Card offline update | Transfers entire PLC image including retentive partition when used as transfer card | Only available on S7-1500; S7-1200 cards are program-only |
| Reading the SD card on a stopped CPU | Retentive values written to card on S7-1500 via WRIT_DBL in program |
Application must be programmed to do this explicitly |
| Recipe DBs persisted via HMI / OPC UA | External retention | Requires the application architecture to push values out before download |
For S7-1500 systems, the most robust preventive measure is to enable automatic backup to SIMATIC memory card in the CPU properties under Card Operation / Backup. The card stores the entire project image and the retentive memory partition, allowing a clean restore if a destructive download occurs.
Configuration: Enabling Retentive Behavior on S7-1200/1500
Retentivity is configured per tag, per DB, and per memory area. Misconfiguration is a frequent cause of "unexpected" data loss even on incremental downloads.
For Instance DBs
- Open the DB in the TIA Portal editor.
- In the tag table, click the Retain column for each tag that should survive restart.
- Choose
Non-retain,Retain, orRetain persistent(S7-1500 only). - Persistent values additionally survive a memory reset (MRES), a "Reset to factory settings", and a card-based restore operation.
For Global Memory Bits, Counters, and Timers
ol>For System Clock and Operating Hours
The S7-1500 operating-hours counter and the system clock are inherently retentive and persist across STOP/RUN and across power cycle if the CPU has a battery or supercapacitor backed memory. They are, however, lost on "Software (all)" with subsequent cold restart, because the retentive memory map is rebuilt from project-declared values.
Troubleshooting Matrix: Download Behavior Symptoms
| Symptom | Likely Cause | Remediation |
|---|---|---|
| All values reset to zero after download | "Software (all)" was used instead of "Software (changes)" | Restore via snapshot or external backup; switch to "Software (changes)" for next iteration |
| Only some tags reset | Tags declared non-retentive in DB or new DB instance has not yet acquired retentive attribute | Verify retain column; recompile and download again |
| Snapshot file is missing or grayed out | Offline/online DB structures differ (compiler adds optimization padding) | Recompile both sides consistently; avoid tag renames between snapshot and restore |
| Restored values are immediately overwritten by program | Application logic initializes the DB on first scan / OB100 | Add run-first-scan flag or remove startup OB100 initializers |
| Persistent values still missing after restore | CPU did not perform a cold restart — STOP/RUN alone does not re-read retentive partition | Power cycle or trigger explicit MRES-equivalent path |
| Download fails with "Target CPU is in RUN" | CPU not stopped before download | Manually STOP the CPU or configure auto-STOP in download dialog |
Preventive Engineering Practices
Engineers running TIA Portal on production or near-production machines should treat "Software (all)" as a destructive maintenance action and wrap it in the following routine:
- Capture DB snapshots for every retentive DB.
- Trigger an external backup via SIMATIC Automation Tool or WinCC archive.
- Stop the process in a controlled manner; engage safety circuits.
- Document the pre-download state of critical tags in a CSV exported from the online DB.
- Perform the download with the CPU in STOP.
- Restore snapshots before transitioning to RUN.
- Verify the live process state tag-by-tag before resuming production.
For projects that change often, prefer Software (changes) exclusively and only escalate to Software (all) when major structural changes (renaming tags, changing retentive attribute, switching CPU firmware) require a full re-flash. This single habit eliminates most real-world retentive-data-loss incidents.
Compatibility Notes by Firmware
| CPU Family | Firmware Range | Snapshot Support | RETAIN_PERSISTENT Support |
|---|---|---|---|
| S7-1200 (CPU 1211..1215) | V4.0 and later | Yes (via TIA V14+) | No |
| S7-1200 (CPU 1217) | V4.2 and later | Yes | No |
| S7-1500 (CPU 1511..1518) | V1.5 and later | Yes | Yes |
| S7-1500 (CPU 1516 PRO, ET200SP CPU) | V2.0 and later | Yes | Yes (with supercapacitor/backup) |
| S7-1500R/H redundant | V2.6 and later | Yes | Yes |
Earlier S7-1200 firmware (V3.x) does not support DB snapshots and requires manual read/write of retentive tags via the online watch table before and after the download.
Frequently Asked Questions
Does "Software (all)" reset M-bits and IEC timers/counters?
Yes. All M, MB, MW, MD bytes declared retentive in the PLC properties are reset to zero, along with IEC counters and timers. Only non-volatile tags declared in the offline project survive, and only at their declared initial values.
Can I download "Software (all)" without losing retentive values on S7-1500?
No. "Software (all)" always rebuilds the retentive memory from the project's initial values. The only mitigation is to restore values afterward via DB Snapshot, an SD-card backup, or external persistence. The retentive attribute on tags determines what is preserved in the new map, not what is preserved across this download.
Where is the retentive-data warning documented for TIA Portal?
From V15.1 onward, the warning appears in the TIA Portal online help chapter "General information on loading" and in the SIMATIC STEP 7 Basic/Professional V15.1 system manual. The exact text is: "Software (all): The PLC program including all blocks, PLC data types and PLC tags is downloaded to the target and all values are reset to their initial values. Be aware that this also applies to retentive values."
Is "Software (changes)" always safer than "Software (all)"?
For retentive data, yes — provided that no retentive tag has changed its name, data type, address, or retain attribute. If those structural attributes change, "Software (changes)" can still cause retentive loss or generate a consistency error that forces a full reload.
What is the difference between RETAIN and RETAIN_PERSISTENT?
RETAIN values survive STOP/RUN transitions and power cycles on a configured CPU. RETAIN_PERSISTENT values additionally survive a memory reset (MRES), "Reset to factory settings", and a SIMATIC memory card transfer. RETAIN_PERSISTENT is supported only on S7-1500 CPUs with sufficient backup energy.
Why does TIA Portal V15 not show the retentive warning?
The retentive-specific warning was added to the documentation in V15.1. V15 manuals describe the general "values reset" behavior but do not call out retentive data specifically. The behavior itself is identical from V13 onward — only the documentation clarity improved.