09 FC FB
09 FC FB
09 FC FB
Program
execution
CALL FC 10
On_1 :=
On_2 :=
Off
:=
I 0.1
I 0.2
Q8.0
FB 5
Function FC10
in
in
out
...
...
A
A
=
...
SIMATIC S7
On_1
On_2
Off
Drive
DB 5
0.0
0.1
2.0
4.0
Start
Stop
Motor_on
Speed
BOOL
BOOL
BOOL
INT
in
Start
BOOL
in
Stop
BOOL
out Motor_On BOOL
out Speed
INT
stat ...
Temp...
BOOL
BOOL
BOOL
#On_1
#On_2
#Off
...
A
AN
=
...
Date:
File:
04/20/15
PRO1_12E.1
#Start
#Stop
#Motor_on
Objectives
Upon completion of this chapter the participant will ...
SIMATIC S7
...
...
...
...
...
...
Date:
File:
04/20/15
PRO1_12E.2
Variables - Overview
PII / PIQ
Temporary Variables
M/T/C
DB areas
I / O Peripherals
absolute
symbolic
Access
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.3
Temporary Variables
Declaration
Use
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.4
FC 17
OB 1
2
with temp.
variables
Result
FC 20
with temp.
variables
FC 30
with temp.
variables
FC20
256 Bytes
Usage of
the L stack
FC30
SIMATIC S7
OB1
OB1
OB1
OB1
Date:
File:
OB1
04/20/15
PRO1_12E.5
OB1
SITRAIN Training for
Automation and Drives
Fault_Signal
Acknowledge
Stored_Fault
Display
Solution Suggestion
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.6
Parameter-assignable Blocks
Solution with nonparameterassignable block
Call of FC 20 (e.g. in OB 1)
FC 20
1.1
A #Fault_Signal
FP
M 17.2
FP #Edge_Memory
M 17.1
I 1.1
Fault_
Signal
S #Stored_Fault
I 1.0
Acknowledge Display
A #Acknowledge
M 10.3
Flash_Freq.
M 17.1
R #Stored_Fault
M 17.1
M 17.1
A #Stored_Fault
Stored_
Fault
M 17.2
M 10.3
A #Flash_Freq.
Edge_
Memory
1.0
Q 5.1
AN
M 17.1
AN #Stored_Fault
A #Fault_Signal
Formal parameters
Q 5.1
Actual parameters
1.1
SIMATIC S7
#Display
Date:
File:
04/20/15
PRO1_12E.7
SIMATIC S7
Declaration
in
out
In_out
Use
Read only
Write only
Read / Write
Date:
File:
04/20/15
PRO1_12E.8
Graphic Display
To the left of the block box
To the right of the block box
To the left of the block box
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.9
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.10
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.11
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.12
Declaration Table
of the
Function Block
Call of
Function Block
such as in OB1
DB 2
FB 20
EN
Fault_Signal
Acknowledge
Flash_Freq.
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.13
Display
ENO
Declaration Table
of the
Function Block
Instance
Data block
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.14
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.15
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.16
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.17
Sa
ve
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.18
Block inconsistency
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.19
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.20
I 0.1
I 0.2
Q8.0
Function FC10
...
A
A
=
...
SIMATIC S7
On_1
On_2
Off
in
Start
in
Stop
out Motor_on
out Speed
stat ...
Temp...
BOOL
BOOL
BOOL
#On_1
#On_2
#Off
...
A
AN
=
...
Date:
File:
04/20/15
PRO1_12E.21
DB 5
0.0
0.1
2.0
4.0
FB 5
in
in
out
...
Drive
Start
Stop
Motor_on
Speed
BOOL
BOOL
BOOL
INT
BOOL
BOOL
BOOL
INT
#Start
#Stop
#Motor_on
Statement
L
L
T
L
T
T
Global
Local
Absolute
Symbolic
Static
Parameter
#Number_1
#Number_2
#Maximum_value
"Number_1"
MW 40
MW 40
#Number_2
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.22
STL
FC 1
Unconditional call
Conditional call
...
EN
ENO
Q5.0
FC 1
EN
ENO
I 0.1
=
_001:
Example
ADD_I
...
SIMATIC S7
EN
MUL_I
ENO
EN
Date:
File:
ENO
04/20/15
PRO1_12E.23
CALL
NOP 0
FC
A
JNB
CALL
A
=
I
_001
FC
BR
Q
0.1
DIV_I
EN
ENO
1
5.0
Q 5.1
=
STL
FB
without parameters
with parameters
CALL FC1
UC FC1
CC FC1
CALL FC2
Par1: ...
Par2: ...
Par3: ...
UC FB1
CC FB1
FC1
( CALL )
LAD
FC2
FC1
EN
ENO
EN
not available
ENO
Par1
Par2
DB3
FB2
EN
Par1
Par3
Par2
FC1
CALL
FBD
EN
EN
Par3
DB3
FC2
FC1
ENO
FB2
Par3
not available
Par1
Par2
EN
Par1
Par2
ENO
Par3
ENO
ENO
SIMATIC S7
Date:
File:
04/20/15
PRO1_12E.24