Technical data

Basics of Designing a Program Structure
4.2 Blocks in the User Program
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 93
4.2.3.4 Instance Data Blocks
An instance data block is assigned to every function block call that transfers parameters. The
actual parameters and the static data of the FB are saved in the instance DB. The variables
declared in the FB determine the structure of the instance data block. Instance means a function
block call. If, for example, a function block is called five times in the S7 user program, there are five
instances of this block.
Creating an Instance DB
Before you create an instance data block, the corresponding FB must already exist. You specify
the number of the FB when you create the instance data block.
One Instance DB for Each Separate Instance
If you assign several instance data blocks to a function block (FB) that controls a motor, you can
use this FB to control different motors.
The data for each specific motor (for example, speed, run-up time, total operating time) are saved
in different data blocks. The DB associated with the FB when it is called determines which motor is
controlled. With this technique, only one function block is necessary for several motors (see the
following figure).