Instances; Multi-Instances - Siemens S7-1200 Programming Manualline

Step 7 tia portal, background and system description
Hide thumbs Also See for S7-1200:
Table of Contents

Advertisement

3 General Programming
3.2 Program blocks
3.2.4

Instances

The call of a function block is called instance. The data with which the instance is
working is saved in an instance DB.
Instance DBs are always created according to the specifications in the FB interface
and can therefore not be changed in the instance DB.
Figure 3-8: Structure of the interfaces of an FB
The instance DB consists of a permanent memory with the interfaces input, output,
InOut and static. In a volatile memory (L stack) temporary tags are stored. The
L stack is always only valid for one cycle. I.e. temporary tags have to be initialized
in each cycle.
Properties
Instance DBs are always assigned to a FB.
Instance DBs do not have to be created manually in the TIA Portal and are
created automatically when calling an FB.
The structure of the instance DB is specified in the appropriate FB and can
only be changed there.
Recommendation
Program it in a way so that the data of the instance DB can only be changed by
the appropriate FB. This is how you can guarantee that the block can be used
universally in all kinds of projects.
For further information, please refer to chapter 3.4 Block interfaces as data
exchange.
3.2.5

Multi-instances

With multi-instances called function blocks can store their data in the instance data
block of the called function block. I.e. if another function block is called in a function
block, it saves its data in the instance DB of the higher-level FBs. The functionality
of the called block is thus maintained even if it is transferred.
The following figure shows an FB that uses another FB ("IEC Timer"). All data is
saved in a multi instance DB. It is thus possible to create a block with an
independent time behavior, for example, a clock generator.
Programming Guideline for S7-1200/1500
V1.2, Entry ID: 81318674
Instance
Input
Output
InOut
Static
33

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

S7-1500

Table of Contents