terça-feira, 24 de junho de 2025

PROGRAMMING A PLC SIEMENS / BASICS OF BLOCK ACCESS

Basics of block access 

Introduction 


STEP 7 offers data blocks with different access options: 


Data blocks with optimized access (S7-1200/S7-1500)


Data blocks with standard access (S7-300 / S7-400 / S7-1200 / S7-1500)


Within one program you can combine the two types of blocks. 


Data blocks with optimized access


Data blocks with optimized access have no fixed defined structure. In the declaration, the data elements are assigned only a symbolic name and no fixed address within the block. The elements are saved automatically in the available memory area of the block so that there are no gaps in the memory. This makes for optimal use of the memory capacity. 


Tags are identified by their symbolic names in these data blocks. To address the tag, enter its symbolic name. For example, you access the "Fill Level" tag in the "Data" DB as follows: 


"Data".Fill Level


Blocks with optimized access offers the following advantages:


You can create data blocks with any structure without paying attention to the physical arrangement of the individual data elements.


Quick access to the optimized data is always available because the data storage is optimized and managed by the system.


Access errors, as with indirect addressing or from the HMI, for example, are not possible. 


You can define specific individual tags as retentive.


Optimized blocks are equipped with a memory reserve by default which lets you expand the interfaces of function blocks or data blocks during operation. You can download the modified blocks without setting the CPU to STOP and without affecting the values of already loaded tags. 


Note 


The "Optimized block access" attribute is always enabled for the following blocks and cannot be deselected.


GRAPH blocks


CEM blocks


ARRAY data blocks

 



Data blocks with standard access


Data blocks with standard access have a fixed structure. In the declaration, the data elements are assigned both a symbolic name and a fixed address within the block. The address is shown in the "Offset" column.


Tags in these data blocks can be addressed in both symbolic and absolute form. 


"Data".Fill Level


DB1.DBW2


Setting Retentivity for Optimized Access or Standard Access


If you define data as retentive, its values are retained even after a power failure or a network off. A retentive tag is not initialized after the hot restart but retains the value it had prior to the power failure. If a DB tag is defined as retentive, it is stored in the retentive memory area of the data block. 


The options for setting the retentivity depend on the access type of the block.


In data blocks with standard access, you cannot set the retentive behavior of individual tags. The retentivity setting is valid for all tags of the data block.


In data blocks with optimized access you can define the retentive behavior of individual tags. 


For structured data type tags, the retentivity setting always applies to the entire structure. You cannot make any individual retentivity setting for separate elements within the data type. 


Setting Addressing Options for Optimized Access or Standard Access


Blocks with optimized access permit only "type-safe" access. Type-safe access addresses tags by their symbolic name only. This means even changes to the block or the block interface will not result in inconsistencies in the program or access errors.


The following table shows the permitted addressing options for optimized data:


Fazendo upload: 14095 de 14095 bytes.



Addressing

 Block with standard access

 Block with optimized access

 

Symbolic addressing

 x

 x

 

Indexed addressing of ARRAYs

 -

 x

 

Slice access

 x

 x

 

Overlapping with AT

 x

 -

 

Absolute addressing

 x

 -

 

Indirect addressing via ANY

 x

 -

 

Indirect addressing via POINTER and VARIANT

 x

 with symbolic notation only

 

Indirect addressing via references

 -

 x

 




--------------------------------------------------------------------------------


See also 


Setting up block access 

Addressing variables in data blocks 

Retentive memory areas (S7-1200) 

Creating blocks 

EMERSON EDUARDO RODRIGUES

Nenhum comentário:

Postar um comentário