Académique Documents
Professionnel Documents
Culture Documents
TRAINING MATERIAL
FOR SIEMENS S7
2012
2012
Wrtsil Finland Oy
2012
Contents
01. General............................................................................................................ 4
02. Revision history............................................................................................... 4
03. Training equipment.......................................................................................... 5
04. Simatic Manager............................................................................................. 7
05. Starting of Simatic Manager............................................................................. 8
05.1 First view....................................................................................................... 9
05.2 Storage location for projects and multiprojects............................................ 10
05.3 Set PG/PC interface Communication with Simatic S7 PC adapter USB.... 11
05.4 Starting a new S7 project............................................................................ 15
05.5 Inserting S7 program................................................................................... 19
06. Hardware configuration.................................................................................. 17
06.1 Inserting Simatic 300 Station....................................................................... 18
06.2 Starting HW Config...................................................................................... 18
07. Making HW Config for our project.................................................................. 20
08. Set PG/PC interface Communication with ethernet..................................... 32
09. Some CPU settings....................................................................................... 36
10. Symbol table................................................................................................. 38
11. Variable table................................................................................................. 39
12. Exercise 1: FB1 Jogging................................................................................ 44
13. Solution 1: FB1 Jogging................................................................................ 45
14. Exercise 2: FB2 Truncated cone.................................................................... 51
15. Solution 2: FB2 Truncated cone..................................................................... 52
16. Exercise 3: FB3 Using timer functions............................................................ 59
17. Solution 3: FB3 Using timer functions............................................................ 60
18. Exercise 4: Tourist BUS................................................................................. 63
19. Solution 4: Tourist BUS.................................................................................. 65
20. Check Block Consistency.............................................................................. 84
21. Exercise 5: Machine tool................................................................................ 88
22. Solution 5: Machine tool................................................................................ 89
23. Exercise 6: MyPID....................................................................................... 111
24. Solution 6: MyPID........................................................................................ 112
25. Exercise 7: ModbusTCP.............................................................................. 127
26. Solution 7: ModbusTCP............................................................................... 130
27. Reference Data............................................................................................ 143
28. Archive........................................................................................................ 148
Wrtsil Finland Oy
2012
01. General
zzThis document is made for training purposes only. This document is property of Wrtsil and the
distribution of this document outside Wrtsil is strictly prohibited.
zzInstructions and settings in this document are only valid when using Simatic S7 training equipment
in Turku, Finland.
zzThis document gives you an introduction how to use Simatic Manager with practical examples.
Revision
Date
Author
Reference
Description
8.9.2011
esa
First draft
27.12.2011
esa
Until exercise 5
6.1.2012
esa
First release
1.6.2012
esa
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
2012
10
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
11
2012
12
Wrtsil Finland Oy
2012
zzSelect PC Adapter(MPI)
zzPress OK
Wrtsil Finland Oy
13
2012
14
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
15
2012
Simatic Manager automatically names the new S7 Program as S7 Program(1). We can rename it
to S7 Program.
16
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
17
2012
Simatic Manager automatically names the new station as Simatic300(1). We can rename it to
Simatic300.
zzPress F2 or mouse right-click and Rename
18
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
19
2012
20
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
21
2012
22
Wrtsil Finland Oy
2012
5. Do the same for the remaining modules. Result should look like this:
Wrtsil Finland Oy
23
2012
24
Wrtsil Finland Oy
2012
9. Double-click Operating Modes and put the settings as follows. Press OK.
Wrtsil Finland Oy
25
2012
10. Double-click Outputs and put the settings for DO1/DO2 as follows. Press OK.
26
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
27
2012
28
Wrtsil Finland Oy
2012
8. Press OK.
Wrtsil Finland Oy
29
2012
9. Press OK.
30
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
31
2012
32
Wrtsil Finland Oy
2012
3. Press OK
Wrtsil Finland Oy
33
2012
34
Wrtsil Finland Oy
2012
6. Select correct interface from Interface Parameter Assignment Used and press OK
(Note! First disconnect your USB adapter from CPU)
Wrtsil Finland Oy
35
2012
If PLC cycle time exceeds 150ms, CPU will go to STOP mode. If OB80 Cycle time fault is
programmed, the scan cycle time is multiplied by 2. If PLC cycle time is still exceeded after that,
CPU will go to STOP mode.
36
Wrtsil Finland Oy
2012
Clock Memory:
M10.7
M10.6
M10.5
M10.4
M10.3
M10.2
M10.1
M10.0
Frequency [HZ]
0.5
0.62
1.25
2.5
10
Duration [s]
1.6
0.8
0.5
0.4
0.2
0.1
zzPress OK
zzSave and Compile
zzDownload to module
Wrtsil Finland Oy
37
2012
zzPress Save
38
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
39
2012
zzGive Symbolic Name and Symbol Comment to your Variable table and press OK
zzWrite the following inputs and outputs to your Variable table and press Save (if you want to use the
Variable table later on)
40
Wrtsil Finland Oy
zzPress
2012
Wrtsil Finland Oy
41
2012
42
Wrtsil Finland Oy
2012
After this you can check that there are now more forced values active by pressing Alt+F2
Wrtsil Finland Oy
43
2012
44
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
45
2012
46
Wrtsil Finland Oy
2012
Network 2
Wrtsil Finland Oy
47
2012
Network 3
6. Press Save
7. Press Download
48
Wrtsil Finland Oy
2012
9. Write DB50 to ??? and press Enter (We will use DB1 at a later stage)
Wrtsil Finland Oy
49
2012
12. Select now OB1, FB1 and DB50 and download them to PLC
50
Wrtsil Finland Oy
2012
zzWhere h = 5
R=3
r=1
Wrtsil Finland Oy
51
2012
52
Wrtsil Finland Oy
2012
Networks 1 and 2
Wrtsil Finland Oy
53
2012
Network 3
2. Press Save
3. Press Download
4. Test your project
54
Wrtsil Finland Oy
Wrtsil Finland Oy
2012
55
2012
7. Press Save
56
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
57
2012
11. Write new values to h, R_big and R_small. Write DB200.DBD0 to Final_result
13. Select now OB1, FB2, DB2 and DB200 and download them to PLC
14. Test your project
58
Wrtsil Finland Oy
2012
HMI.
If Stop button is pressed for 10
seconds, the yellow indication
should activate for 8 seconds
and text Stop pulse on should
blink with 10 Hz frequency during
this period.
Wrtsil Finland Oy
59
2012
60
Wrtsil Finland Oy
2012
2. Then Open Multible instances and place TON1 to network 1 and TP1 to network 2
Wrtsil Finland Oy
61
2012
3. Networks 1, 2 and 3
62
Wrtsil Finland Oy
2012
A sightseeing bus travels around 3 stops. The bus does 5 trips daily, so that
zzFirst 2 rounds it stops at every location and stays there for 5 seconds
zzThe remaining 3 rounds it only stops at Stop2, if Stop button is pressed before bus reaches Stop2
zzSightseeing trips begins and ends at Stop 1. Trip is started with Start button.
zzBus speed is tuned from PIW288.
zzBus speed is limited to 40% of the maximum speed.
Stop 3
Stop 2
Stop 1
Wrtsil Finland Oy
63
M500.0
64
2012
M500.1
M500.2
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
65
2012
66
Wrtsil Finland Oy
2012
Networks 1-3
Wrtsil Finland Oy
67
2012
Networks 4-6
68
Wrtsil Finland Oy
2012
Networks 7-8
Wrtsil Finland Oy
69
2012
Networks 9-10
70
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
71
2012
72
Wrtsil Finland Oy
2012
FB4 Sightseeing
5. FB4 Sightseeing is done with GRAPH
Wrtsil Finland Oy
73
2012
6. Insert new Function Block FB4 Sightseeing (GRAPH) and press OK.
74
Wrtsil Finland Oy
2012
7. Insert Drag-and-Drop
Wrtsil Finland Oy
75
2012
9. Like this!
76
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
77
2012
78
Wrtsil Finland Oy
2012
15. Write R to ?
Wrtsil Finland Oy
79
2012
M59.2
M59.1
I0.0
M51.0
M59.3
I0.6
NEG!
M59.3
I0.6
M56.0
M51.1
M52.0
M56.0
I0.7
M52.1
NEG!
M59.6
M59.5
80
Wrtsil Finland Oy
I1.0
2012
M53.0
M53.1
M54.0
I0.7
M54.1
M59.6
NEG!
M59.5
M59.0
M59.2
NEG!
M59.0
Wrtsil Finland Oy
81
2012
82
Wrtsil Finland Oy
Wrtsil Finland Oy
2012
83
2012
84
Wrtsil Finland Oy
2012
2. Compile all
Wrtsil Finland Oy
85
2012
86
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
87
2012
88
Wrtsil Finland Oy
2012
Note! If you want to change Initial values afterwards, remember to Initialize Data Block.
View Data View
Edit Initialize Data Block
Wrtsil Finland Oy
89
2012
Copy all other blocks than OB1 from the sample project to your own project
90
Wrtsil Finland Oy
2012
FB13 Positioner
1. Insert new SCL Source
Wrtsil Finland Oy
91
2012
92
Wrtsil Finland Oy
Wrtsil Finland Oy
2012
93
2012
6. Press Save
7. File Compile
8. If everything ok (i.e. no errors), it should look like this:
94
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
95
2012
96
Wrtsil Finland Oy
2012
12. Network 3
Wrtsil Finland Oy
97
2012
FB7 Ramp
13. Variables for FB7
98
Wrtsil Finland Oy
2012
14. Copy Wrtsil standard block FB128 CURVEXY into your project. We will use it for the
deceleration.
Wrtsil Finland Oy
99
2012
16. Network 1
16. Network 1
100
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
101
2012
18. Network 4
102
Wrtsil Finland Oy
2012
19. Network 5
Wrtsil Finland Oy
103
2012
104
Wrtsil Finland Oy
2012
OB1
21. Finally open your OB1 and update it to as follows:
Networks 1-2
Wrtsil Finland Oy
105
2012
Networks 3-4
106
Wrtsil Finland Oy
2012
Network 5-6
Wrtsil Finland Oy
107
2012
108
Wrtsil Finland Oy
2012
Network 7
Wrtsil Finland Oy
109
2012
Networks 8-9
110
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
111
2012
112
Wrtsil Finland Oy
2012
FB14 Astia
1. Sources Insert New Object SCL Source
2. Rename it to Astia
Wrtsil Finland Oy
113
2012
114
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
115
2012
116
Wrtsil Finland Oy
2012
7. Press Save
8. File Compile
9. If everything ok (i.e. no errors), it should look like this:
Wrtsil Finland Oy
117
2012
FB8 MyPID
11. Variables for FB8
118
Wrtsil Finland Oy
2012
12. Network 1
Wrtsil Finland Oy
119
2012
120
Wrtsil Finland Oy
2012
14. Network 4
Wrtsil Finland Oy
121
2012
15. Network 5
( Libraries Standard Library PID Control Blocks)
122
Wrtsil Finland Oy
Wrtsil Finland Oy
2012
123
2012
124
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
125
2012
18. Network 10
OB1
19. Network 10
126
Wrtsil Finland Oy
2012
Whats your
name?
Im CPU
315-PN/DP.
???
Wrtsil Finland Oy
Hello.
Im VAMP 210.
Whats yours?
OK,
whatever
You have to do
me first
Configure a standardised
MODBUS/TCP
communication prototol
for me.
127
2012
thefifinal
exercise well
ModbusTCP
connection
for VAMP
210 Generator
Protection
InInthe
nal exercise
wellconfigure
configurea a
ModbusTCP
connection
for VAMP
210 Generator
Protection
Relay.
Relay.
Protocols are
are used
data
between
heterogeneous
communication
partners.
In this In this
Protocols
usedwhen
whenexchanging
exchanging
data
between
heterogeneous
communication
partners.
exercise we
we are
are using
protocol.
TheThe
controller,
generator
protection
relay and
operator
exercise
usingModbusTCP
ModbusTCP
protocol.
controller,
generator
protection
relay
and operator
panel
are
located
in
the
same
IP
subnet.
Therefore
a
gateway
is
not
needed.
panel are located in the same IP subnet. Therefore a gateway is not needed.
CPU 315-2PN/DP
IP Address:
192.168.0.1
S7 Connection
128
VAMP 210
IP Address:
192.168.0.17
Wrtsil Finland Oy
2012
From VAMP 210 protocol mappings we can see that Alive indicator is written in to Modbus address
402001.
From VAMP 210 protocol mappings we can see that Alive indicator is written in to Modbus
address 402001.
Nowwe
wewant
wantananillustration
illustration
Alive
indicator
value
VAMP
210our
into
ourscreen.
HMI screen.
Now
of of
thethe
Alive
indicator
value
fromfrom
VAMP
210 into
HMI
DB121.DBW32
Wrtsil Finland Oy
129
2012
2. Then open project mbtcp_te and copy all the other blocks than OB1 and the SFB(s) and SFC(s) into
your project
130
Wrtsil Finland Oy
2012
Network 1
Wrtsil Finland Oy
131
2012
Network 2
112
9 = 121
DB121
Modbus start address of DB defined on
DB_HOLD
(0x163)+(7x162)+(12x161)+(1x160)
= 0
+ 1792
192
+ 1 = 1985
Thus,
(1991 1985) * 2 = 12
DB address:
DB121.DBW32
132
Wrtsil Finland Oy
2012
Networks 3 & 4
Wrtsil Finland Oy
133
2012
DB22
DDR_DB
where value
valuefor
forstring
stringvariable
variable
is set.
do the following
4.4. Open
Open
DB22
DDR_DBand
andlocate
locate row
row where
IP3IP3
is set.
ThenThen
do the
modifications
following modifications
(3xxxx)
(4xxxx)
Note!
changingInitial
Initialvalues,
values,
remember
to Initialize
Data
Block.
Note! When
When changing
remember
to Initialize
Data
Block.
Data View
View
View
View
Data
InitializeData
DataBlock
Block
Edit
Edit
Initialize
134
Wrtsil Finland Oy
2012
5. OB1
Network 11
Wrtsil Finland Oy
135
2012
Note! If you want to change the Address of Alive indicator from DB121.DBW20 to DB121.DBW32
Note! If you want to change the Address of Alive indicator from DB121.DBW20 to DB121.DBW32
you have to use DB_HOLD_ADD in FB170 MBTCP_READ_WRITE. This is how it works
you have to use DB_HOLD_ADD in FB170 MBTCP_READ_WRITE. This is how it works
Lets first use same values in START_ADDRESS and DB_HOLD_ADD (16#07C7 1991).
Lets first use same values in START_ADDRESS and DB_HOLD_ADD (16#07C7 1991).
136
Wrtsil Finland Oy
2012
When now opening DB121 we see that the Alive indicator is written to DB121.DBW20.
When now opening DB121 we see that the Alive indicator is written to DB121.DBW20.
Now
whenwe
wewant
wanttotochange
change
address
of Alive
indicator
from DB121.DBW20
to DB121.DBW32, we
Now when
thethe
address
of Alive
indicator
from DB121.DBW20
to DB121.DBW32,
have
to change
the
16#07C1
(1985).
we have
to change
thevalue
valueofofDB_HOLD_ADD
DB_HOLD_ADD toto16#07C1
(1985).
Wrtsil Finland Oy
137
2012
When opening
DB121
we DB121
see that
thethat
Alive
is then
written
totoDB121.DBW32.
When
opening
we see
theindicator
Alive indicator
is then
written
DB121.DBW32.
Remember,that
thatwe
wearent
arent
now
actually
reading
addresses
401987
401990,
we have set
Remember,
now
actually
reading
addresses
401987
401990,
because because
we have set
START_ADDR
1991
in DB22.
START_ADDR
to to
1991
in DB22.
138
Wrtsil Finland Oy
2012
139
2012
9. Now you can monitor FB17 and DB121 in Online. It should look like this:
140
Wrtsil Finland Oy
Wrtsil Finland Oy
2012
141
2012
142
Wrtsil Finland Oy
2012
Wrtsil Finland Oy
143
2012
2. Press Yes
144
Wrtsil Finland Oy
2012
3. OK
4. Press Filter
Wrtsil Finland Oy
145
2012
146
Wrtsil Finland Oy
A:
Q:
Where is DB200.DBD10 (Current position) written? Which blocks are reading it?
A:
It is written in
It is read in
Wrtsil Finland Oy
2012
147
2012
28. Archive
Now you are ready to finish your exercise.
1. File Archive
2. Select the project you want to archive and press OK
148
Wrtsil Finland Oy
2012
4. Press OK
Wrtsil Finland Oy
149
2012
150
Wrtsil Finland Oy
2012
8. Press OK
9. Done!
Wrtsil Finland Oy
151