Preserving SIMOTION D435 HMI RETAIN Tags After TIA Proxy Update

David Krause13 min read
HMI / SCADASiemensTroubleshooting
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 a SIMOTION D435-2 controller is integrated into a TIA Portal V14 SP1 project as a device proxy for HMI visualization with WinCC Advanced V14 SP1, every addition or modification of an HMI variable in the SIMOTION project forces two downloads: an update of the device proxy in the TIA Portal project, and a new HMI download to the touch panel. Engineers consistently observe that after this sequence, every HMI tag on the panel — including variables declared as VAR_GLOBAL RETAIN in the SIMOTION source — reverts to its initialization value. This article documents the root cause, the official Save/Restore Variables workflow from SIMOTION Scout, and the precise procedure for preventing tag-value loss without losing production state.

Affected Hardware and Software

Item Catalog / Version Role
SIMOTION D435-2 DP/PN 6AU1435-2AD00-0AA0 Modular motion controller; PROFINET and PROFIBUS
SIMOTION firmware V4.4 / V4.5 / V5.x Per type plate; Scout must match
SIMOTION Scout TIA V4.4 SPx / V5.x Engineering, online diagnostics, Save/Restore Variables
TIA Portal V14 SP1 (also V14 / V15 / V16 / V17) Holds the device proxy and the HMI configuration
WinCC Advanced V14 SP1 (or Comfort/Advanced runtime) Touch panel HMI

The D435-2 product family is documented on the official SIMOTION D435-2 DP/PN Support page.

Root Cause: Interface Section Reinitialization

The data loss is not a WinCC bug, an HMI connection issue, or a property loss. It is the binary matching behavior of the SIMOTION runtime against the program source loaded by Scout.

When you go online with a SIMOTION project, Scout compares the source code on the controller to the source code in your offline project. The comparison is performed on the INTERFACE section of each POU (Program Organization Unit). The decision is binary:

  • If the INTERFACE section is byte-identical to the runtime image → the runtime keeps all variable values.
  • If the INTERFACE section differs in any way (new variable, removed variable, changed datatype, changed initial value, reordered declaration) → Scout marks the POU as not matching, and the runtime reinitializes every variable in that POU to its default value. This applies to VAR_GLOBAL, VAR_GLOBAL RETAIN, and VAR_GLOBAL PERSISTENT.

When the device proxy is refreshed in TIA Portal and the HMI project is downloaded, the HMI tags are re-tagged against the new interface. The values the panel had been displaying fall back to the SIMOTION initial values. WinCC Advanced performs no semantic diff: it does not try to match tag name, address, and datatype to discover what actually changed. It is a strict matches / does-not-match decision at the unit level.

Key implications

  • Adding a single new HMI tag inside an existing POU forces a full reinitialization of every variable in that POU's INTERFACE.
  • Renaming a variable, changing its data type, or moving it between POUs has the same effect.
  • Modifying only the IMPLEMENTATION section (logic body) does not trigger reinitialization, because the interface signature is unchanged.
  • VAR_GLOBAL RETAIN still works for the normal controller power cycle case, but not for the interface change + download case.

Architecture: SIMOTION Device Proxy in TIA Portal

A device proxy is a placeholder device inserted into the TIA Portal device tree that represents the SIMOTION controller. Because SIMOTION is programmed in Scout and not in TIA Portal, the proxy acts as the HMI-side view of the controller's data interface. WinCC Advanced and the Comfort/Advanced panels read the variable list from this proxy and expose them as HMI tags.

SIMOTION D435-2runtime + retain dataSIMOTION Scoutoffline + online projectDevice ProxyTIA Portal treeWinCC AdvancedHMI projectHMI Tag Databasepanel runtime

The proxy must be re-initialized whenever the SIMOTION variable set changes. The procedure for V14 and newer is essentially the same; the canonical reference is the Create a device proxy and initialize via a project file entry, and the update path is in Updating a device proxy via a project file.

Prerequisites

  • Online connection from Scout to the D435-2 (PROFINET, PROFIBUS, or Ethernet service access).
  • The current offline Scout project that matches the controller's running program (PROGRAMS tree shows a green check).
  • A target directory on the engineering station to store variable snapshots (XML files).
  • Credentials with rights to STOP/RUN the controller and perform downloads.
  • The TIA Portal project that contains the device proxy and the HMI tag list.

Standard Save/Restore Variables Procedure

The official Scout workflow for preserving runtime values across a program change that touches the INTERFACE section is the Save Variables / Restore Variables pair. Follow the steps in order; do not skip the Save step.

  1. Create a baseline copy of the Scout project. Open the Scout project that currently matches the controller, then use Project → Save As... to create a working copy. The original (matching) project is the one you will use online to read the running values; the new (working) copy is the one you will edit and download.
  2. Go online with the original (matching) project. Connect Scout to the D435-2 with the original project. The PROGRAMS folder in the project tree must show a green check (no mismatches) before you save variables. Do not save variables from a project that is not online-matched; the XML will contain default values, not the running values.
  3. Save variables to XML. In the project tree, right-click on the POU (source file) under PROGRAMS and choose Save Variables.... In the dialog, select the variable class to capture:
    • RETAIN — values that survive a controller restart.
    • NON_RETAIN — values that are normally lost on power cycle.
    • PERSISTENT — values that survive a memory reset.
    Scout uploads the current values and writes them to an XML file (default name matches the POU). Repeat for every POU that contains VAR_GLOBAL data whose values you must preserve.
  4. Edit and rebuild the working copy. Make your HMI variable additions or interface changes in the working copy of the Scout project. Recompile.
  5. Download the new program. Download the modified project to the D435-2. If the variables you are protecting are involved in active handshaking, place the SIMOTION CPU in STOP first. Otherwise RUN is acceptable, but be aware that any variable that changes value during the download window will not be captured by the XML you saved in step 3.
  6. Wait for the controller to reboot. SIMOTION performs a full restart on download; the HMI connection re-establishes once the PROFINET/PROFINET stack comes back up.
  7. Restore variables from XML. With the controller online in Scout, right-click on the POU in the project tree and choose Restore Variables.... Browse to the XML file saved in step 3. Select the same variable class as before. Scout writes the values back to the controller one variable at a time and logs any type mismatches or missing variables.
  8. Return the CPU to RUN if it is in STOP.
  9. Update the device proxy in TIA Portal. In the TIA Portal project tree, right-click the SIMOTION device proxy and select Update device proxy. TIA Portal re-reads the variable list from the Scout project and refreshes the HMI tag database.
  10. Download the HMI to the panel. Compile the WinCC Advanced project and download it to the touch panel. The HMI tags now point at the updated interface and display the restored values.
  11. Fill any gaps manually. Use the Scout Symbol Browser to write any values that failed to restore (typically because a variable was renamed or removed). Even if the variable is declared VAR_GLOBAL RETAIN, the interface change has already triggered a full reinitialization, so the XML-restore workflow is the only path that recovers the values.

Compact HMI-Only Workflow

For the specific case where the only change is an HMI tag addition (no logic change in the IMPLEMENTATION section, no retyping of existing variables), the following shorter sequence is sufficient:

  1. Go online with the matching Scout project.
  2. Right-click the SIMOTION device or POU and choose Save Variables....
  3. Add the new HMI variable to the SIMOTION source.
  4. Download the modified Scout project to the D435-2.
  5. Go online and right-click the SIMOTION device or POU and choose Restore Variables....
  6. In TIA Portal, update the device proxy.
  7. Download the WinCC Advanced project to the panel.

This is the minimum set of operations that keeps the existing HMI tag values alive across the proxy update.

Memory Layout Reference

SIMOTION stores VAR_GLOBAL data in three logical areas, and it is the area, not the keyword, that determines survival across a power cycle:

Keyword Survives power cycle Survives interface change + download Survives memory reset Notes
VAR_GLOBAL No No No Default
VAR_GLOBAL RETAIN Yes No No Backed up on power-down, but reinitialized on interface change
VAR_GLOBAL PERSISTENT Yes No Yes Stored in remanent memory; still reinitialized on interface change

The Save/Restore Variables XML workflow is the only mechanism that survives the interface-change reinitialization in all three cases.

Edge Cases and Pitfalls

  • Comments in the INTERFACE section can trigger a recompile in some Scout versions. Comments are part of the source fingerprint in V4.5+. Treat any edit to the INTERFACE block, even cosmetic, as a reinitialization event.
  • Multiple POUs. If your VAR_GLOBAL data is split across several POU source files, you must save and restore each one. A single XML file is per POU.
  • Structured data types (STRUCT, ARRAY). Scout saves the value of the structured variable as a single block. If the structure definition changes (new field, removed field, reordered fields), the XML restore will log errors for that variable; you must fix the values manually.
  • HMI tag connection broken. If you do not re-tag the WinCC connection to the new device-proxy symbol, the panel may show "no connection" or "address error" after the download, regardless of the SIMOTION state. Verify the HMI tag connections in the WinCC tag list.
  • RUN vs STOP during download. If your retain variables are part of active handshaking (for example, a position-latched index register, a recipe pointer, or a state-machine counter), STOP is strongly recommended. A variable that is overwritten between Save and Restore will end up with the overwritten value.
  • Persistent variables. VAR_GLOBAL PERSISTENT survives a memory reset, but it is still reinitialized when the INTERFACE section changes. Use the same Save/Restore workflow.
  • Multiple engineers editing the same project. Coordinate Save operations immediately before the download. If another engineer has uploaded new logic between your Save and your Download, the XML file may not match the runtime state.
  • Time-stamped variables and runtime buffers. If the variable you save is updated on every scan and the scan period is in the millisecond range, the captured value is a snapshot, not a transient. Restore it before the next machine cycle if the logic depends on continuity.

Backup Project Strategy

The Save/Restore Variables workflow assumes you have a Scout project that exactly matches the controller at the moment of capture. To guarantee that:

  • Maintain a golden project (read-only, version-controlled) that reflects the last downloaded-and-verified program.
  • Use Project → Save As... to create the working copy; do not edit the golden project in place.
  • After every successful download, archive both the new project and the Save/Restore XML files. This is the only way to roll back a controller to a known state.
  • Consider version-stamping the project filename (e.g. MachineLine3_Scout_V17.d435) so the on-disk project you go online with is unambiguous.

Alternative: Manual Restoration via Symbol Browser

For a small number of variables, you can skip the XML workflow and use the Scout Symbol Browser to write values back manually. The procedure is:

  1. Open the Symbol Browser in Scout (Project → Symbol Browser).
  2. Connect to the controller online.
  3. Filter the variable list to the POU you just changed.
  4. Right-click the variable and choose Modify value....
  5. Enter the desired value and confirm.

This is practical for a handful of tags, but it does not scale. For more than ~10 variables, the XML workflow is faster and less error-prone.

Migration to WinCC Unified

If you are on a long-term refresh path, Siemens provides guidance for migrating from a SIMOTION device proxy in WinCC Advanced to an OPC UA-based connection in WinCC Unified. The official migration entry point is the SIMOTION D435-2 DP/PN Support page, which links to migration manuals and application examples. In the Unified world the connection is established via OPC UA, the tag list is re-imported on demand, and the value-retention problem is solved by keeping the OPC UA server running through the program download. The semantics differ and are not covered by this article.

Verification

After completing the Save/Restore cycle and downloading the HMI:

  1. Open the Scout Symbol Browser, connect online, and read the actual runtime value of each variable you intended to preserve. Compare against the value you saw before the download.
  2. On the touch panel, navigate to a screen that displays the HMI tag in question. Confirm the displayed value matches the Symbol Browser reading.
  3. Cycle power on the SIMOTION D435-2 and recheck. RETAIN values should now match.
  4. Save the project, close Scout and TIA Portal, reopen both, and re-go-online. The PROGRAMS folder should show all green; any red items indicate a structural mismatch that will require another Save/Restore cycle.

Troubleshooting Matrix

Symptom Likely Cause Corrective Action
All HMI tags show 0 after HMI download Proxy was updated but Save/Restore was not performed Save values from matching project, re-download, Restore values, re-update proxy
HMI tag shows "no connection" WinCC tag not re-bound to new proxy symbol Open the WinCC tag list, re-assign the connection to the new device proxy symbol
Some HMI tags restored, others not Variable renamed or restructured in the new project Use Symbol Browser to manually write the missing values
Restore logs "type mismatch" for a variable Variable data type changed in the interface Decide whether to revert the type change or manually re-enter the value
Same value lost after a second download Save was performed against the wrong (new) project, not the matching one Reopen the original matching project, Save Variables, repeat the cycle
Controller in RUN, but machine faults when restore finishes Restored values conflict with active logic (e.g. position counters, handshakes) Put CPU in STOP before Restore, then return to RUN
XML file contains default values, not running values Save Variables was executed while offline, or on a non-matching project Go online with the matching project first, then Save Variables

Why do VAR_GLOBAL RETAIN values disappear after a Scout download that only adds a new HMI tag?

Scout performs a binary check on the INTERFACE section of each POU. Any change — including adding a new variable — marks the unit as not matching, and the SIMOTION runtime reinitializes every variable in that POU to its default value, regardless of RETAIN or PERSISTENT attributes. The RETAIN attribute only protects values across a normal restart; it does not protect them across an interface change.

Is there a way to update the device proxy without losing HMI tag values?

No. Any update of the device proxy in TIA Portal requires a new HMI download, and any change to the SIMOTION INTERFACE section requires a Scout download that resets the values. The official workaround is to Save Variables in the matching project, perform both downloads, then Restore Variables, and only then re-update the proxy and re-download the HMI.

Can I avoid the Save/Restore workflow by never editing the INTERFACE section?

Only if you can pre-declare every HMI variable you will ever need before the first download. In practice this is not realistic, so the Save/Restore workflow is the standard approach for any production machine that has live retain data.

Does this affect SINAMICS drives or other SIMOTION platforms (D425, D445, P320)?

Yes. The interface-matching behavior is a property of the SIMOTION runtime and Scout, not of a specific D4xx variant. The same procedure applies to D425, D435, D445, and the SIMOTION P320 PC-based controller.

Where can I find the official Siemens documentation for the Save/Restore Variables command?

The command is part of SIMOTION Scout TIA. The closest official reference is the SIMOTION Scout TIA device-proxy documentation set, which describes the proxy update flow used in conjunction with the Save/Restore Variables workflow: Updating a device proxy via a project file.

Back to blog