Professional Documents
Culture Documents
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.1
Introduction
Temporary Variables are deleted after the associated block is executed temporary storage in L stack useable in OBs / FCs / FBs
Static Variables are retained even after the block is executed permanent storage in DBs can only be used in FBs
absolute Access
symbolic
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.2
Temporary Variables
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.3
1.5 Kbyte
(CPU 313..316)
Execution
Startup (one-time execution) Cyclic execution Time-controlled execution Time-of-Day Interrupt Time-Delay Interrupt
Cyclic Interrupt
Hardware Interrupt Event-driven execution Error handling in startup Error handling in scan cycle
12
16 28 26
256 bytes
256 bytes 256 bytes
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.4
rechts
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.5
OB 1
2
FC 1
with temp. variables
3 4
FC 2
with temp. variables
5 7
FC 3
with temp. variables
4 5 6 7
SIMATIC S7
Siemens AG 1999. All rights reserved.
256 Bytes
Date: File:
01.09.2012 PRO1_11E.6
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.7
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.8
Parameter-Assignable Blocks
Non-parameterassignable block Parameter-assignable block Program Call FC 20
A I
R M A I FP M S M A M A M O ANM A I = Q
1.2
40.0 1.3 40.1 40.0 40.0 10.3
A #Acknowledge
R #Report Memory U #Disturb. input FP #Edge mem. bit S #Report memory A #Report memory A #Flashing freq. O
I 1.3
Disturb. input
I 1.2
M 10.3 M 40.0
M 40.1
A 8.3
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.9
Declaration
in out In_out
Use
Read only Write only Read / write
Graphic Display
To the left of the block
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.10
Here was, e.g., with a non-parameter-assignable FC: with absolute addressing: I1.3 with symbolic addressing: End_left"
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.11
absolute
Addressing
M40.0
Network 4: Second Call A8.1 EN Disturb.input Acknowledge Flash freq. Report memory ENO FC20 Edge mem. bit Display M40.3 Q9.4
symbolic
Symboltable
Global Symbols
Symbols
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.12
STL
?? . ?
EN
ENO
CALL NOP 0
FC
Conditional call
I 0.1
FC 1 EN ENO
Q 9.0 = _001:
A JNB CALL A =
I _001 FC BR Q
0.1
1
9.0
Example
FC 1 ?? . ? EN ENO EN
FC 2 ENO EN
FC 3 ENO =
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.13
Non-parameterassignable block
A I R M A I FP M S M A M A M O AN M A I = Q
1.2 40.0 1.3 40.1 40.0 40.0 10.3 40.0 1.3 9.3(Q5.3)
Parameter-assignable FC 20 block 2.
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.14
FC 20 I 1.4 Parameter-assignment of FC20 in the 2nd. call I 1.2 M 10.3 M 40.2 Disturb. input Edge mem. bit Display Acknowledge M 40.3 Q 9.4 (Q 5.4)
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.15
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.16
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.17
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.18
DB100
Parameters and static variables of the 1st. call of FB20
Call Dist_1 Disturb._Input:= Acknowledge:= Flash_Freq:= Display:= Call Dist_2 Disturb._Input:= Acknowledge:= Flash_Freq:= Display:=
DB12 FB20
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.19
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.20
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.21
2.
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.22
(Q 5.3)
(Q 5.3)
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.23
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.24
: :
: :
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.25
Global Local
Absolute
Symbolic
Temporary
Static
Parameter
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.26
FB
With parameters W/o param., w/o inst. DB With param., with inst.DB
Without parameters
STL
UC FB1 CC FB1
LAD
FC1
EN ENO
FC2
EN Par1 Par2 Par3 ENO EN
FB1
ENO EN Par1 Par2
DB3 FB2
ENO
Par3
FC1 CALL
FC2 FB1
Par3 EN EN
DB3 FB2
Par3 ENO Par1 ENO ENO Par2 EN Par1 Par2
FBD
FC1
EN
ENO
SIMATIC S7
Siemens AG 1999. All rights reserved.
Date: File:
01.09.2012 PRO1_11E.27