meta data for this page
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| automation:db [2026/01/06 20:52] – vamsan | automation:db [2026/01/06 23:18] (current) – vamsan | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ==== Data block (DB) ==== | ==== Data block (DB) ==== | ||
| {{anchor: | {{anchor: | ||
| - | “DB” | + | “DB” |
| 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/ | ||
| + | * 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/ | ||
| === Instant vs global 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. | 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. | ||
| - | |||
| - | Each database can have a maximum size of 64 kB. | ||
| **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**. | **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**. | ||