Professional Documents
Culture Documents
The SIMATIC S7 System Family
The SIMATIC S7 System Family
SIMATIC
PCS 7
SIMATIC
SIMATIC NET
Software
SIMATIC
HMI
SIMATIC SIMATIC
PC
SIMATIC
WinCC
SIMATIC
DP
SIMATIC
Controller
Positioning of the Modular S7 Controllers
Advanced SIMATIC
S7-400
SIMATIC S7-400
SIMATIC SIMATIC
S7-1500 S7-1500
Basic
SIMATIC
SIMATIC S7-200 S7-1200
SIMATIC S7-1200
TIA Portal
S7-300: Modules
Interface Parameter
CP5611 Assignment Used:
CP5611 (MPI)
CPU
"Accessible Nodes": ONLINE View (project-
independent)
Erasing a Memory Card (Memory or MMC
Card)Memory card is inserted in the CPU:
right
Memory card is inserted in the PG: mouse button
Exercise 1: Setting the PG Interface to MPI
SIMATIC Manager
Options
Exercise 2: Performing a CPU Memory Reset
and a Warm Restart
Until Oct. 2002 After Oct. 2002
RUN-P
RUN
RUN 1. Set the mode selector switch to STOP
STOP
MRES
STOP
MRES
RUN-P
2. Hold (Press) the mode selector switch in the MRES
RUN
RUN position until the STOP LED has flashed twice slowly.
STOP
Release the mode selector switch so that it returns to
MRES
STOP the STOP position.
MRES
within 1 sec
RUN-P
3. Turn (press) the mode selector switch to the MRES posi-
RUN RUN
-tion once more until the STOP LED begins to flash quickly. STOP
Release the mode selector switch so that it returns to MRES
STOP
the STOP position.
MRES
RUN-P
RUN RUN
4. Set the mode selector switch to the RUN-P (RUN)
STOP
position. (A warm restart is carried out in the transition
STOP MRES
from STOP to RUN/RUN-P)
MRES
Inserting a Station
Starting the Hardware Configuration Editor
Generating a Hardware Setpoint
Configuration
DI/DA Addressing in Multi-Tier
Configurations
PS IM 96.0 100.0 104.0 108.0 112.0 116.0 120.0 124.0
Rack (Receive)
3 to to to to to to to to
99.7 103.7 107.7 111.7 115.7 119.7 123.7 127.7
2x
Saving the Setpoint Configuration and
Downloading it in Modules
Download
(only when CPU is
in STOP mode)
Absolute and Symbolic Addressing
Absolute Representation Symbolic Representation
A I0.0 A "SYSTEM_ON"
= Q8.0 = "LED_ON"
A I0.4 A "M_FORW"
= Q20.5 = "MOTOR_FOR"
Call FC18 Call "COUNT"
Cycle
Time OB
FC FB SFC
Organization
Process Blocks
Error FB FC SFB
Recipe A
Pump
OB 1 OB 1 Recipe B OB 1
Mixer
Outlet
Outlet
All instructions are The instructions for the individual Reusable functions are loaded into
found in one block (usually functions are found in individual individual blocks. OB 1 (or other
in Organization Block OB blocks. OB 1 calls the individual blocks blocks) call these blocks and pass on
1) one after the other. the pertinent data.
Process Images
S1 K1
I 2.0 Q 4.3
PII PIQ
User
Byte 0 Byte 0
Program
Byte 1 1 Byte 1
Byte 2 1 Byte 2
: : :
: : : 1
: A I 2.0 :
1 = Q 4.3
:
:
2 A I 6.4
= Q 4.3
CPU Memory Area : CPU Memory Area
Cyclic Program Execution
• Startup program: Call and execution of OB 100
(once, after Power ON, for example)
• Transfer PIQ to the digital output modules
I 0.2 Q 8.2
I 0.2 >=1 Q 8.2 O I 0.2
= O I 0.3
I 0.3
I 0.3 = Q 8.2
Binary Logic Operations: Exclusive OR (XOR)
LAD FBD STL
Q 8.0 X I 0.4
I 0.4 XOR
= X I 0.5
I 0.5 = Q8.0
Problem 1: Sensors and Symbols
Task: In all three examples, the light should be on when S1 is activated and S2 is not activated!
Hardware
S1 S2 S1 S2 S1 S2
E 1.0
I1.0 EI1.1
1.1 EI1.0
1.0 E 1.1
I1.1 EI1.0
1.0 E I1.1
1.1
Programmable controller Programmable controller Programmable controller
Q 4.0 Q 4.0 Q 4.0
Software
I 1.0 I 1.1 Q 4.0 I 1.0 I 1.1 Q 4.0 I 1.0 I 1.1 Q 4.0
LAD
FBD
I 1.1 Q 4.0 I 1.1 Q 4.0 I 1.1 Q 4.0
I 1.2 I 1.3
Q 8.1 I 1.2 A I 1.2
& Q 8.1
Set (S ) A I 1.3
I 1.3 S S Q 8.1
I 1.4 Q 8.1
(R ) I 1.4 O I 1.4
>=1 Q 8.1 O I 1.5
Reset I 1.5 R
I 1.5 R Q 8.1
Setting and Resetting a Flip Flop
LAD FBD STL
M 5.7 M 5.7
I1.2 Q 9.3 A I 1.2
SR
Dominant S Q I1.2 S SR S M 5.7
A I 1.3
Reset Q9.3
I1.3 R M 5.7
I1.3 R Q = A M 5.7
R
= Q 9.3
M 5.7 M 5.7
I1.3 Q 9.3 A I 1.3
RS
Dominant R Q I1.3 R RS R M 5.7
Set Q9.3 A I 1.2
I1.2 S M 5.7
I1.2 Q = A M 5.7
S S
= Q 9.3
Exercise 5: Programming the Operating
Mode Section (FC 15)
DI DO
I 0.0 T_System_ON
I 0.1 T_System_OFF L_SYSTEM Q 4.1
I 0.2 T_Jog_RIGHT L_MAN Q 4.2
I 0.3 T_Jog_LEFT L_AUTO Q 4.3 V
I 0.4 S_M/A_ModeSelect
I 0.5 T_M/A_Accept
-15V...+15V AI2 AO1
-15V...+15V
AI1 AO2
AI1 AI2
V
OFF-Condition R Q
OFF-Conditions R Q
OFF-Conditions R Q
Exercise 7: Conveyor in AUTO Mode
(Expanding FC 16)
Conv. Start Transport Phase Conv. Stop
Prox.Sens.Bay 1
I 8.5
Mom.Cont.Bay 1
I 8.1
Prox.Sens.Bay 2
I 8.6
Mom.Cont.Bay 2
I 8.2
Light Barrier
I 8.0
Run Conveyor
RIGHT
Q8.5
Exercise 8: "FC_ConvMotor" (FC 16), Solution
Hints
Network x Jog RIGHT in MANUAL mode
M 16.4
Conditions for
Memory bit for
Run Conveyor RIGHT S
Run Conveyor RIGHT
in AUTO mode R in AUTO mode
M 16.2 >=1
Run Conveyor RIGHT
Q 8.5
M 16.4 =
Signal – Edge Detection
LAD FBD STL
I 1.0 A I 1.0
I 1.0 I 1.1 &
M8.0 I 1.1 A (
POS
Q POS M8.0 A I 1.1
M1.0 M_BIT = FP
M1.0 M_BIT
M1.0
)
I 1.0 I 1.1 I 1.0 =
M8.1 I 1.1 &
M8.0
NEG
Q NEG M8.1 A I 1.0
M1.1 M_BIT M1.1 M_BIT = A (
A I 1.1
FN
M1.1
I 1.0 )
=
I 1.1 M8.1
M8.0
OB1 Cycle
M8.1
OB1 Cycle
Exercise 9: Integrating the Edge Detection in
FC 16
Part at
Light barrier
Start condition
in AUTO mode
Light Barrier
(I 8.0)
Run Conveyor
RIGHT
(Q8.5)
Exercise 10: Controlling Indicator Lights +
Horn (FC 14) in MANUAL mode:
2Hz pulsed honking
while conveyor jogging
"BAY1" "BAY2"
(I 8.5) (I 8.6)
"Horn"
(Q 8.7)
"L_Bay1" "L_Bay2"
(Q 8.1) (Q 8.2)
in AUTO mode:
- Constant light at both bays when a new part can be placed (both bays empty)
- 1Hz flashing light at the bay where the part is placed and the conveyor has not yet been started
- 2Hz flashing light at both bays during conveyor movement
Digital Operations
F1
Acquiring, Processing and Outputting Data
Operating 0248
Thumbwheel
+ monitoring V buttons,
processes Potentiometer,
0 8 1 5 7-segment
display
Operator Panel
DI/ AI/
DO AO
such as PROFIBUS
Display Formats:
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Display Formats:
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Sign
positive
numbers
HEX: DW#16# 0 0 0 8 4 0 8 9
(without sign)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
Sign
negative
numbers
Representation as HEX: DW#16# F F F 7 B F 7 7
Twos complement
(without sign)
REAL (Floating-point Number, 32 Bit) Data
Type
Value range -3.402823•10+38 to -1.175495•10-38 , 0.0, +1.175495•10-38 to +3.402823•10+38
Example: 0.75
Sign of
Real no. e = Exponent (8 Bit) f = Mantissa (23 Bit)
31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
0 0 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
27 26 25 24 23 22 21 20 2-1 2-2 2-3 2-4 ..... 2-23
0 2 9 6
16 Bit: BIN.: 2# 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0
Sign (+) 2 9 6
HEX: W#16# 0 2 9 6 DEC: + 662
Sign (+) 0 0 0 0 2 9 6
32 Bit: BIN.: 2# 0 x x x 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1 0 1 1 0
(ACCU 1)
12345678 A1B2C3D4
S5 Counter Functions
LAD FBD STL
A I 0.4
C5 C5
CU C5
I 0.4
S_CUD Q 8.3
S_CUD A I 0.5
CU Q
Q I 0.4 CU CD C5
I 0.5 A I 0.3
CD CV MW 4 I 0.5 CD L C#5
S C5
I 0.3
S CV_BCD QW 12 I 0.3 S CV MW 4 A I 0.7
R C5
C#5 PV C#5 PV CV_BCD QW 12 L C5
Q 8.3 T MW4
I 0.7
LC C5
R I 0.7 R Q
Q =
T QW12
A C5
= Q8.3
Counters: Function Diagram
CU
CD
5
4
3
Count
2
1
0
Q
Exercise 11: Counting the Transported
Parts (FC 18, C 18)
DI DO
I 0.0 T_System_ON Act Quantity
I 0.1 T_System_OFF L_SYSTEM Q 4.1
I 0.2 T_Jog_RIGHT L_MAN Q 4.2
I 0.3 T_Jog_LEFT L_AUTO Q 4.3 V
I 0.4 S_M/A_ModeSelect
I 0.5 T_M/A_Accept "QW_DigDisp" (QW 6)
-15V...+15V AI2 AO1
-15V...+15V
AI1 AO2
AI1 AI2
V
T44 T44
S_PULSE S_PEXT
MW0 MW0
I 0.7 S B I 0.7 S B
S5T#35s QW12 S5T#35s QW12
TV I
BCD M8.5 TV I
BCD M8.5
I 0.5 R Q = I 0.5 R Q =
ON Delay (SD)
T44
S_ODT
MW0
I 0.7 S B
S5T#35s QW12
TV I
BCD M8.5
I 0.5 R Q =
Stored ON Delay (SS) OFF Delay (SF)
T44 T44
S_ODTS S_OFFDT
MW0 MW0
I 0.7 S BI I 0.7 S B
S5T#35s QW12 S5T#35s QW12
TV BCD M8.5 TV I
BCD M8.5
I 0.5 R Q = I 0.5 R Q =
Timers: ON Delay (SD)
LAD FBD STL
T4 T4
I 0.7 S_ODT S_EVERZ A I 0.7
Q8.5
S Q S B MW0 L S5T#35s
I 0.7
S5T#35s B SD T4
TV MW0 S5T#35s TV I
BCD QW12
I 0.5 Q8.5 A I 0.5
I
R BCD QW12 I 0.5 R Q = R T4
L T4
T MW0
RLO at S LC T4
RLO at R T QW12
A T4
Time = Q8.5
operation
Example
I 0.0 T_System_ON
I 0.1 T_System_OFF L_SYSTEM Q 4.1
I 0.2 T_Jog_RIGHT L_MAN Q 4.2
I 0.3 T_Jog_LEFT L_AUTO Q 4.3
I 0.4 S_M/A_ModeSelect
I 0.5 T_M/A_Accept
T_Ackn L_Conv
I 1.0 Q 5.0
_Fault _Fault
Comparison Operations
LAD FBD STL
ACT=SET Acknowledgement
"L_Bay-LB" (Q 8.4) "T_Bay-LB" (I 8.4)
Exercise: Counting the Transported Parts (FC
19), Solution Hints
NW 1: Set "Counter" to 0
MOVE
Condition
for resetting EN OUT MW 20
0 IN ENO
ADD_I
Rising edge of
counting event EN
MW 20 IN1 OUT MW 20
1 IN2 ENO
Convert ACT quantity (MW 20) from Integer to BCD -> Result on BCD digital display (QW 6)
Convert value from thumbwheel button (IW 2) from BCD to Integer -> Store SETP quantity (Integer) in MW 22
Compare ACT (MW 20) to SETP (MW 22) -> Place comparison result on indicator light