laitimes

What is the difference between block-optimized block access and non-optimized block access for Siemens Portal

author:A sprouted potato

What is the difference between checking and unchecking the "Optimized Block Access" for a newly created data block in the Siemens Portal software? As shown below:

What is the difference between block-optimized block access and non-optimized block access for Siemens Portal

Basic knowledge of block access

There is no fixed defined structure for optimizing access to datablocks. In a declaration, only a symbolic name is assigned to the data element, not a fixed address in the block. These elements are automatically saved in the free memory area of the block, leaving no storage gaps in memory. In this way, the application rate of memory space can be increased.

In these data-blocks, variables are identified with symbolic names. To address the variable, you need to enter a symbolic name for the variable. For example, the INT1 variable in the Optimization Block block can be accessed in the following way: "Optimization Block". INT1, this data does not correspond to the actual data address. As shown in the figure below:

What is the difference between block-optimized block access and non-optimized block access for Siemens Portal

Optimized access blocks have the following benefits:

1. You can create data blocks using any structure without caring about the physical arrangement of individual data elements.

2. Because the data is stored in an optimized way and managed by the system, the optimized data can be quickly accessed.

3. There will be no access errors such as indirect addressing or HMI access.

4. A single variable can be defined as having persistence.

5. By default, the optimization block has a reserved storage area, which can extend the interface of the function block or data block during operation. You don't need to set the CPU to STOP mode to download a modified block without affecting the value of the loaded variable.

STEP 7 Provide data blocks with different access options:

  • 可优化访问的数据块 (S7-1200/S7-1500)
  • 可标准访问的数据块 (S7-300 / S7-400 / S7-1200 / S7-1500)

And in a program, two different types of blocks can be included.

Standard-access blocks have a fixed structure. The data element is assigned a symbolic name in the declaration and has a fixed address in the block. The address is displayed in the Offset column.

The variables in these blocks can be addressed using both symbolic and absolute addresses, as shown in the following image:

What is the difference between block-optimized block access and non-optimized block access for Siemens Portal

Comparing the data changes twice, we can see that the standard-accessible data block has one more "offset" data with an address character.

Set retention for optimized or standard access

If data is defined to be persistent, the value of that data can also be retained in the event of a power failure or network outage. The hold-up variable is also not initialized after a hot start, but the value before the power supply failure is maintained. If a block variable is defined to be retained, the variable is stored in the block's retentionable memory area.

The options for setting retention depend on the access type of the block:

  • For standard-access data blocks, you cannot define the maintainability of individual variables. The retention setting is valid for all variables in that chunk.
What is the difference between block-optimized block access and non-optimized block access for Siemens Portal
  • For data blocks that are optimally accessed, you can define the persistence of individual variables.
What is the difference between block-optimized block access and non-optimized block access for Siemens Portal

For variables of structured data types, the persistence setting is always applied to the entire structure. It is not possible to set any individual hold properties for individual elements in a data type.