IMDHMIControls LibraryShop main store

How-to

Preserve actual values in S7-1200 and S7-1500 data blocks

PLC programming Published 6 min read

Short answer

Reinitialization copies start values into actual values, so a reinitializing download erases the machine parameters stored in a data block. Additions fit the DB's memory reserve and go through a download without reinitialization, which leaves actual and start values untouched. Edits to existing structures or PLC-data-type variables cannot use the reserve: snapshot the actual values, then restore them after the reinitializing download or promote them to start values before it.

On this page
  1. What reinitialization replaces
  2. Pick the route from the edit
  3. Memory-reserve route: download without reinitialization
  4. Snapshot route: edited structures and PLC data types
  5. Worked example: budgeting the reserve
  6. Prove the values survived
  7. Questions asked

When you change the structure of a data block in an S7-1200 or S7-1500, the download dialog decides what happens to the values the CPU is holding: approve reinitialization and every start value is copied over the actual values, taking your stored machine parameters with it. Decide from the edit itself. Adding new variables or structures fits the block's memory reserve, and a download without reinitialization leaves actual values and start values untouched. Changing an existing structure, or a variable typed with a PLC data type, cannot use that reserve: record the actual values with a snapshot first, then restore them after the reinitializing download or promote them to start values before it. The sections below give the decision table, a byte budget you can verify, and both procedures step by step.

What reinitialization replaces #

Four terms carry this job. The actual value is what the CPU holds now, and it changes while the program runs, which is why machine parameters, recipes and trimmed setpoints live here. The start value is what the offline project wants the variable to hold, and a reinitializing download copies each start value into its actual value: that copy is the loss you are avoiding. The default value comes from the PLC data type or the function block interface behind the variable, not from the DB. A snapshot is a recorded copy of the actual values that the online DB view keeps in its own column.

The memory reserve is a byte area you set in the DB's properties under "Download without reinitialization"; entering 0 bytes disables it. It exists for optimized data blocks only, and a standard-access DB reinitializes on every structural download, whatever its properties say. Additions have to fit inside the reserve for the download to skip reinitialization.

Pick the route from the edit #

Classify each changed member before you open the dialog: the reserve covers additions only, never a change to something the block already contains. Work from the original engineering project; rebuilding a project from the CPU is an upload with its own limits, described in what an S7-1200 upload recovers and what the IO devices need.

Edit Reserve usable? Route
Add new variables or structures, plain or PLC-data-type based Yes Download without reinitialization
Change type, order or meaning of an existing variable or structure No Snapshot route
Edit a PLC data type that existing DB variables already use No Snapshot route
Addition larger than the reserve No Snapshot route
Reserve disabled (0 bytes) or standard-access DB No Snapshot route

The same start-value discipline applies when tuned control settings move between controllers; migrating a Standard PID Control PID_CP block to an S7-1500 walks through that case.

Memory-reserve route: download without reinitialization #

  1. Open the DB and read the memory reserve from its properties under "Download without reinitialization", together with the block's current size. A reserve of 0 bytes means this route is closed for the block.
  2. Check the budget before editing: current size plus reserve must cover every byte you add. The worked example below shows the arithmetic.
  3. Append the new variables and give each one a start value; new members arrive in the CPU holding those start values.
  4. Compile and start the download. With the addition inside the reserve, the dialog offers the download without reinitialization, and the CPU stays in RUN.
  5. Verify online: the existing actual values are unchanged and the new variables hold their start values.

Snapshot route: edited structures and PLC data types #

The reserve cannot follow an edit to something the block already contains, so the actual values have to leave the CPU on purpose before the download takes them. Go online with the DB and run the Snapshot function: the online view gains a Snapshot column that holds the recorded values. Compare the captured machine parameters against the online values while the original structure is still live, and re-snapshot if the machine has written anything since.

One safety note: a structural download stops the CPU and restarts it with every actual value equal to its start value until you restore, so run the reinitializing step only in a defined machine state in which those start values cannot move anything.

Route A: keep the original start values #

  1. Snapshot the original DB online and confirm the captured parameters.
  2. Edit the structure in the project and give new members defined start values.
  3. Download and accept reinitialization. Existing members now hold their start values instead of your settings; that interval is the price of this route.
  4. Copy the snapshot values into the actual-value column of the online DB. The captured settings are back.
  5. Check the start values of the existing members: this route leaves the original start-value baseline in place.

Route B: captured settings become start values #

  1. Snapshot as above, then overwrite the start values with the snapshot values.
  2. Download. Only start values have changed, so no reinitialization follows and the actual values stay untouched.
  3. Edit the structure and download again. This download reinitializes, and the existing members come back holding the captured settings instead of their old start values.
  4. Optionally reset the start values to their defaults and download once more; that download carries start values only, so no reinitialization follows. The baseline returns while the actual values keep the captured settings.

Build DB structures from PLC data types from the start: defaults then live in one place, and the DB editor can show the default-value column beside start and actual values when you reconcile a migration.

Worked example: budgeting the reserve #

Example numbers, chosen so you can check every step against your own block. A parameter DB for a mixing skid reads 240 bytes in its properties, and its reserve reads 100 bytes, so the ceiling for the reserve route is 240 + 100 = 340 bytes. You append three variables: Recipe_No of type DINT, Recipe_Speed of type REAL and Recipe_Tol of type REAL. DINT and REAL are IEC 61131-3 elementary types, 4 bytes each in STEP 7, so the addition is 3 × 4 = 12 bytes and the block grows to 240 + 12 = 252 bytes. That is inside the 340-byte ceiling: the dialog offers the download without reinitialization, and the 240 bytes of existing values never move. The remaining reserve afterwards is 100 - 12 = 88 bytes, which is the budget for the next addition.

The same block rejects a different addition: Temp_Curve of type ARRAY[1..40] of REAL adds 40 × 4 = 160 bytes, and 240 + 160 = 400 bytes is past the 340-byte ceiling, so that download reinitializes and the block goes through the snapshot route instead.

Prove the values survived #

Close every route the same way. Go online, pick the parameters you were protecting — a trimmed speed setpoint, a recipe number an operator entered — and compare them against your pre-download record; the Snapshot column is that record for the snapshot route. After the reserve route, confirm that one value you know the running program has changed since the last full download still reads the changed value: if it does, the block was not reinitialized.

The decision, per case: additions go through the memory reserve and a download without reinitialization; any change to an existing structure, or to variables typed with a PLC data type, goes through a snapshot taken before the download and restored around it, with the reinitializing download run only in a safe machine state.

Questions asked

How large is the memory reserve for a new data block?

TIA Portal gives a newly created data block a 100-byte memory reserve, and the global default for new blocks is set in the TIA Portal settings dialog. Check the value in an existing block's properties under Download without reinitialization before you budget an addition against it.

Does the reserve cover a change to a PLC data type definition?

No. It covers newly added structures and variables, including new variables based on a PLC data type, but not changes to structures or PLC-data-type variables the block already contains. Editing the type's definition therefore reinitializes every data block using it, and each of those blocks needs the snapshot route.

How do I write start values into actual values on purpose?

Open the data block online and use the "Load start values as actual values" function; its "Only setpoints" variant restricts the write to setpoint-type variables. The same documentation section covers reinitializing the actual values of several blocks in one step.

Which TIA Portal version do I need for download without reinitialization?

The function is documented for S7-1200 and S7-1500 from TIA Portal V12 on, and the project must be saved in V12 format or higher. An older project format reinitializes on a structural download even with a reserve configured, so convert the project before the edit.

Where do default values come from when start values are reset?

From the PLC data type or the function block interface the variable is based on, not from the data block itself. Change defaults there, and show the default-value column in the DB editor to compare while you reconcile. Resetting start values to those defaults is a start-values-only download, so no reinitialization follows.

Keep reading

  • Troubleshooting

    TIA Portal v14 cannot go online with an S7-1500

    Only a complete power cycle restores engineering access: a STOP-to-RUN transition or a port change leaves the failed download service in place. Power down under your site's procedure, confirm recovery with a read-only online session before any download, then capture CPU firmware, TIA Portal version and download details so the next occurrence can be classified as project-triggered or a software defect.

    PLC programming

  • Troubleshooting

    Why an S7-1200 download in run demands a STOP transition

    Download in Run on the S7-1200 works only when the physical CPU runs firmware 2.2, the CPU in the project's hardware configuration is also set to 2.2, and TIA Portal is V11 SP2 or higher. The usual culprit is the configured firmware: the project still describes an earlier CPU, so the preview demands STOP even for a small FC edit. Set it to 2.2, recompile, and the edit loads with the run light green.

    PLC programming

  • Explainer

    Why TIA Portal cannot migrate a project to an S7-1200

    No TIA Portal version migrates a project onto an S7-1200. Migration brings a STEP 7 V5.x project in with its S7-300/400 CPU unchanged, and the only controller family it converts that program to is the S7-1500. Moving to an S7-1200 is a reprogramming job with a rebuilt hardware configuration and a full re-test, not an import.

    PLC programming