Data Block (Db) - Siemens S7-1200 System Manual

Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

Programming concepts
6.3 Using blocks to structure your program
Using a single FB with DBs
The following figure shows an OB that calls one FB three times, using a different data block
for each call. This structure allows one generic FB to control several similar devices, such as
motors, by assigning a different instance data block for each call for the different devices.
Each instance DB stores the data (such as speed, ramp-up time, and total operating time)
for an individual device.
In this example, FB 22 controls three separate devices, with DB 201 storing the operational
data for the first device, DB 202 storing the operational data for the second device, and DB
203 storing the operational data for the third device.
6.3.4

Data block (DB)

You create data blocks (DB) in your user program to store data for the code blocks. All of the
program blocks in the user program can access the data in a global DB, but an instance DB
stores data for a specific function block (FB).
The data stored in a DB is not deleted when the execution of the associated code block
comes to an end. There are two types of DBs:
● A global DB stores data for the code blocks in your program. Any OB, FB, or FC can
access the data in a global DB.
● An instance DB stores the data for a specific FB. The structure of the data in an instance
DB reflects the parameters (Input, Output, and InOut) and the static data for the FB. (The
Temp memory for the FB is not stored in the instance DB.)
Note
Although the instance DB reflects the data for a specific FB, any code block can access
the data in an instance DB.
You can also modify and download data blocks in RUN mode (Page 808).
176
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG

Advertisement

Table of Contents
loading

Table of Contents