meta data for this page
  •  

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
automation:db [2026/01/06 16:59] vamsanautomation:db [2026/01/06 23:18] (current) vamsan
Line 1: Line 1:
 ==== Data block (DB) ==== ==== Data block (DB) ====
 {{anchor:db}} {{anchor:db}}
-“DB” is an abbreviation for DATA_BLOCK or the German "Datenbaustein" and is used to denote a data area. A DB can contain any set of data types allowed and defined on the given PLC. A DB can have a maximum size of 64 kByte. The size of the PLC data area limits the total space occupied by all DBsIt is important to note that the PLC is not optimized for storing large amounts of data; therefore, we do not store images, music, files, or even large text files in a DB. The TIA-Portal uses the small blue barrel symbol ({{:automation:db_0.png|DB symbol}}) to denote DBs.+“DB” stands for DATA_BLOCK or the German term "Datenbaustein', indicating a data area. It can contain various data types permitted and defined by the specific PLC. The total size of all DBs is limited by the PLC'data capacitySince the PLC isn'optimized for storing large data, we do not save images, music, files, or extensive text files within a DB. In the TIA-Portal, DBs are marked with a small blue barrel icon ({{:automation:db_0.png|DB symbol}}).
 The image below shows the contents of a DB, along with some settings: The image below shows the contents of a DB, along with some settings:
  
Line 19: Line 19:
 |**Setpoint**|This allows you to initialize values ​​in a data block (DB) online while the CPU is in RUN mode.| |**Setpoint**|This allows you to initialize values ​​in a data block (DB) online while the CPU is in RUN mode.|
 |**Comment**|Description of the function of the field.| |**Comment**|Description of the function of the field.|
 +
 +=== DB Limits ===
 +
 +  * You can define up to 252 structures within a single data block for S7-1200/S7-1500, regardless of the data types used in the structures.
 +  * Maximum DB Number: The total number of data blocks is generally capped at 65,535, due to the common use of a 16-bit address range. 
 +  * Maximum DB Size (Standard - not optimized - Access): For older PLC models like S7-300/400 and for standard access DBs in newer models, each DB's size typically does not exceed 64 KB (65,534 bytes). 
 +  * Maximum DB Size (Optimized Access): In contrast, S7-1200/S7-1500 CPUs that utilize optimized access have a much larger size limit, which varies based on the CPU's total working memory and can reach from 1 MB up to 10 MB or more per DB.
 +
 +=== Instant vs global DB ===
 +
 +A **global DB** is a data block that programmers can freely create and populate with variables. These variables may include default Simatic types (INT, REAL, etc.), structures, arrays, or UDTs.
 +
 +**Instant DB**s are implicitly created when FBs are called for the first time. This call is primarily through the instant DB. When an FB is deleted, the TIA Portal also issues a separate warning about removing the instant DB. The contents of the instant DB automatically update with changes to the FB's variable list. It can include default Simatic variables like INT, REAL, structures, arrays, and UDTs. If the FB calls other embedded FBs (e.g., TON, TOF), their instant DBs are also stored here, resulting in a **multi-instant DB**. 
 +
  
 === DB Properties === === DB Properties ===