Siemens Industry Online Support
Siemens AG
Entry type: FAQ Entry ID: 67655611, Entry date: 03/23/2016

What types of access are available in STEP 7 (TIA Portal) to access data values in blocks and what should you watch out for with the differences between the types?

  • Entry
  • Associated product(s)
Using optimized data storage in STEP 7 (TIA Portal) you can run your programs on the S7-1200/1500 at optimum performance.

There are different ways of accessing data values in blocks. This entry describes the procedures for STEP 7 V5.x and STEP 7 (TIA Portal).

Procedure for STEP 7 V5.x
You can address all declarations in function blocks absolutely with known addresses in compliance with the SIMATIC rules. This data is displayed by the system and is also stored in the CPU's memory in the SIMATIC format.

Procedure for STEP 7 (TIA Portal)
STEP 7 (TIA Portal) provides blocks with different access options:

  • Blocks with standard access:(S7-300 / S7-400 and S7-1200 / S7-1500)
    The blocks with standard access have a fixed structure. The data elements receive a symbolic name in the declaration and a fixed address in the block.
  • Blocks with optimized access: (S7-1200 / S7-1500)
    The blocks with optimized access do not have a specifically defined structure. The data elements receive only one symbolic name in the declaration and no fixed address in the block.

The tables below explain the differences between standard and optimized block access:

Standard block accessOptimized block access
CPU modulesS7-1200/1500, compatible with S7-300/400Only for the S7-1200/1500
Data storageYou can structure a storage-optimized or any type of data structure according to the declaration.Managed and optimized by the system. You can set up any type of structure without forfeiting memory.
PerformanceHigh-performance access to the S7-1200/1500 depends on the declaration of the data.Access is always as fast as possible because the data storage is optimized by the system and is independent of the declaration.
Susceptibility to errorsAbsolute access (from HMI or indirect addressing, for example) can lead to inconsistencies when changing the declaration.None, because access is generally symbolic. Declaration changes do not lead to access errors, because HMI access, for example, is symbolic.
RetainBlock - granularVariables - granular

Table 01

Standard blocks are more flexible in their access mechanisms but are also more susceptible to errors. Optimized blocks permit only type-safe access and provide extremely good performance. We recommend you avoid mixing standard and optimized blocks as far as possible. The system automatically implements the data models upon access between the blocks, but that costs resources. The conversion of data between source format and destination format required for this needs storage as well as a long processing time.

Access type Standard block access Optimized block access 
Indexed (fields)YesYes
Slice accessYesYes
AT instructionYesNo
Indirect (ANY)YesNo
Indirect (pointer version)YesOnly with symbolic notation
Download without reinitializationNoYes (for S7-1200 with firmware V4.0 and higher)

Table 02

Change block access type
The block access is set automatically when a block is created. Newly created blocks on CPUs of the series

  • S7-1200/S7-1500 are preset by default to "Optimized access".
  • S7-300/S7-400 are preset by default to "Standard access" and cannot be changed.

The block access is not changed automatically if you copy or migrate a block from a CPU of the series S7-300/S7-400 to a CPU of the series S7-1200/S7-1500. You have to change the block access manually for each block after migration.

For example, to change the block access from "Standard" to "Optimized" you proceed as follows:

  1. Open the "Program Blocks" folder in the project navigation.
  2. Right-click the block the access type of which you want to change.
  3. Select the "Properties..." item in the pop-up menu.
  4. In the "Attributes" tab you enable the "Optimized block access" function.

    Fig. 1

  5. Confirm with "OK" the "Change block access" message that follows.

    Fig. 2

  6. Close the "Properties" dialog with "OK".
  7. Save and compile the changes before loading the program into the CPU.

In this way you have now set the temporary variables to optimized access. The formal parameters (Input, Output, InOut) and the static variables are then displayed in the "Retain" column with the setting "Non-retain".

Fig. 3
Retain setting
The Retain setting depends on the type of access of the block.
  • In blocks with Standard access, the Retain setting is possible only for all the variables of the block. No variable can be excluded.
  • In blocks with "Optimized" access, the Retain setting Variables - granular is possible.

If after changing the block access the variables are still set to "Set in IDB" in the "Retain" column, change this via the drop-down list box for each variable separately and compile the program.

Fig. 4

If an error message is issued, check for the following causes:

  • The instance DBs of the processed block are being accessed with absolute addressing.
  • The BLKMOV instruction is accessing data in the block or in its instance DB.

Otherwise you must reset these variables to "Set in IDB" in the declaration.

This procedure is not possible for declarations with the keyword "AT". More information about this is available in Entry ID: 57132240.

Creation Environment
The screens in this FAQ response were created with STEP 7 (TIA Portal) V13.

Further Information
More information on the topic of "Block Access" is available in the system manual "STEP 7 Professional V13 SP1", under:

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit