Professional Documents
Culture Documents
Temporary Variables
• PII / PIQ Static Variables
• are overwritten with undefined
• I/ O • are retained even after
values after the associated
the block is executed
•M/T/C block is executed
• permanent storage in DBs
• DB areas • temporary storage in L stack
• can only be used in FBs
• useable in OBs / FCs / FBs
absolute symbolic
Access
Declaration
For S7-300:
Execution
Priority class L stack size
rechts
OB 1 FC 17 FC 20
3
2
with with temp.
temp. 4 variables
variables
5 FC 30
7 with temp.
6 variables
Result 1 2 3 4 5 6 7
Usage of
the L stack FC30
FC20
Bytes
256
FC17 FC17 FC17 FC17 FC17
OB1 OB1 OB1 OB1 OB1 OB1 OB1
Replace by the
temporary variable
"Packages"
Task
Fault_Signal
Acknowledge
Stored_Fault
Display
FC 20
A I 1.1 A #Fault_Signal
I 1.1 Fault_
FP M 17.2 FP #Edge_Memory Signal
S M 17.1 S #Stored_Fault I 1.0 Acknowledge Display Q 5.1
A I 1.0 A #Acknowledge M 10.3 Flash_Freq.
R M 17.1 R #Stored_Fault M 17.1 Stored_
Fault
A M 17.1 A #Stored_Fault
M 17.2 Edge_
A M 10.3 A #Flash_Freq. Memory
O O
AN M 17.1 AN #Stored_Fault
A I 1.1 A #Fault_Signal
Formal parameters
= Q 5.1 = #Display
Actual parameters
Output parameter out Write only To the right of the block box
In/Out parameter In_out Read / Write To the left of the block box
FC 1
Unconditional call ?? . ? EN ENO CALL FC 1
NOP 0
FC 1 Q 9.0
A I 0.1
Conditional call I 0.1 EN ENO = JNB _001
CALL FC 1
_001: A BR
= Q 9.0
Example
FC 1 FC 2 FC 3
DB 2
FB 2
EN
Disturb. input
Acknowledge Display
Flash freq. ENO
Declaration table
of the function
block
Instance
data block
OB 1 DB10 OB 1
Block inconsistency
Add
Network 2
&3
Delete
Network 2
: :
: :
FC1
( CALL ) DB3
FC2 FB1 FB2
FC1
LAD EN ENO EN ENO EN ENO
EN ENO
Par1 Par1
Par2 Par3 Par2 Par3
FC1
CALL DB3
FC2 FB1 FB2
FC1 EN Par3 EN EN Par3
FBD EN Par1 Par1
ENO
Par2 ENO Par2
ENO
ENO