
3-10
Ladder Logic (LAD) for S7-300 and S7-400
C79000-G7076-C504-02
3.5 Declaring Multiple Instances
A multiple instance results from declaring a static variable of the same data
type as a function block (FB). In the code section, the instance is called as a
Ladder element.
For more detailed information about multiple instances, refer to the
Programming Manual /234/. Part 2 of this manual explains the syntax for
calling a multiple instance.
Keep to the following rules when declaring multiple instances:
S Declaring multiple instances is only possible in function blocks
S Function blocks within which a multiple instance has been declared must
also have an associated instance DB.
S A multiple instance can only be declared as a static variable (declaration
type “stat”).
To declare a multiple instance, you enter the variable name in the “Symbol”
column after the declaration type “stat”. Under data type, you enter the
function block. This can be done either by entering the absolute name of the
FB or a symbolic name. You can also add an optional comment.
TRAFFIC\...\FB60-<Offline>
varin
varout
varinout
tempo
BYTE
BYTE
BYTE
REAL
B#16#0
B#16#0
B#16#0
in
out
in_out
stat
temp
0.0
2.0
4.0
0.0
locinst
local instance
FB6
Decl. Symbol Data TypeInitial Value CommentAddress
Figure 3-5 Declaration of Multiple Instances (Example)
Multiple Instances
Rules
Inputting Multiple
Instances
Creating Logic Blocks
Comentarios a estos manuales