Professional Documents
Culture Documents
TRAINING MATERIAL
FOR SIEMENS S7
2012
Homer J. Simpson
2 Wrtsil Finland Oy
Training material for Siemens S7 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 3
Training material for Siemens S7 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.
4 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 5
Training material for Siemens S7 2012
6 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 7
Training material for Siemens S7 2012
8 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 9
Training material for Siemens S7 2012
10 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 11
Training material for Siemens S7 2012
12 Wrtsil Finland Oy
Training material for Siemens S7 2012
zzSelect PC Adapter(MPI)
zzPress OK
Wrtsil Finland Oy 13
Training material for Siemens S7 2012
zzOpen Blocks
zzDelete all the other blocks than System function blocks (SFB, SFC) from CPU Online memory
14 Wrtsil Finland Oy
Training material for Siemens S7 2012
zzPress OK
Wrtsil Finland Oy 15
Training material for Siemens S7 2012
Simatic Manager automatically names the new S7 Program as S7 Program(1). We can rename it
to S7 Program.
16 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 17
Training material for Siemens S7 2012
Simatic Manager automatically names the new station as Simatic300(1). We can rename it to
Simatic300.
18 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 19
Training material for Siemens S7 2012
20 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 21
Training material for Siemens S7 2012
22 Wrtsil Finland Oy
Training material for Siemens S7 2012
5. Do the same for the remaining modules. Result should look like this:
Wrtsil Finland Oy 23
Training material for Siemens S7 2012
24 Wrtsil Finland Oy
Training material for Siemens S7 2012
9. Double-click Operating Modes and put the settings as follows. Press OK.
Wrtsil Finland Oy 25
Training material for Siemens S7 2012
10. Double-click Outputs and put the settings for DO1/DO2 as follows. Press OK.
26 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 27
Training material for Siemens S7 2012
28 Wrtsil Finland Oy
Training material for Siemens S7 2012
8. Press OK.
Wrtsil Finland Oy 29
Training material for Siemens S7 2012
9. Press OK.
30 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 31
Training material for Siemens S7 2012
32 Wrtsil Finland Oy
Training material for Siemens S7 2012
3. Press OK
Wrtsil Finland Oy 33
Training material for Siemens S7 2012
34 Wrtsil Finland Oy
Training material for Siemens S7 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
Training material for Siemens S7 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
Training material for Siemens S7 2012
Clock Memory:
zzPress OK
zzDownload to module
Wrtsil Finland Oy 37
Training material for Siemens S7 2012
zzPress Enter
zzWrite these inputs/outputs to Symbols. (Note! Remember to update your Symbol table, when
adding additional symbols to your project).
zzPress Save
38 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 39
Training material for Siemens S7 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
Training material for Siemens S7 2012
Wrtsil Finland Oy 41
Training material for Siemens S7 2012
zzWrite 1 to Modify value of the output you want to force active and press Enter
42 Wrtsil Finland Oy
Training material for Siemens S7 2012
zzTo disable forced values, first disable monitor variables , then write 0 to Modify value of the
output you want to disable forcing and press Enter
After this you can check that there are now more forced values active by pressing Alt+F2
Wrtsil Finland Oy 43
Training material for Siemens S7 2012
44 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 45
Training material for Siemens S7 2012
46 Wrtsil Finland Oy
Training material for Siemens S7 2012
Network 1
Network 2
Wrtsil Finland Oy 47
Training material for Siemens S7 2012
Network 3
6. Press Save
7. Press Download
48 Wrtsil Finland Oy
Training material for Siemens S7 2012
9. Write DB50 to ??? and press Enter (We will use DB1 at a later stage)
Wrtsil Finland Oy 49
Training material for Siemens S7 2012
12. Select now OB1, FB1 and DB50 and download them to PLC
50 Wrtsil Finland Oy
Training material for Siemens S7 2012
zzWhere h = 5
R=3
r=1
Wrtsil Finland Oy 51
Training material for Siemens S7 2012
52 Wrtsil Finland Oy
Training material for Siemens S7 2012
Networks 1 and 2
Wrtsil Finland Oy 53
Training material for Siemens S7 2012
Network 3
2. Press Save
3. Press Download
54 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 55
Training material for Siemens S7 2012
56 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 57
Training material for Siemens S7 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
58 Wrtsil Finland Oy
Training material for Siemens S7 2012
zzPulse timer TP
HMI.
Wrtsil Finland Oy 59
Training material for Siemens S7 2012
60 Wrtsil Finland Oy
Training material for Siemens S7 2012
2. Then Open Multible instances and place TON1 to network 1 and TP1 to network 2
Wrtsil Finland Oy 61
Training material for Siemens S7 2012
3. Networks 1, 2 and 3
M30.0
M30.1
M30.2
62 Wrtsil Finland Oy
Training material for Siemens S7 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.
Stop 3
Stop 2
Stop 1
Wrtsil Finland Oy 63
Training material for Siemens S7 2012
64 Wrtsil Finland Oy
Training material for Siemens S7 2012
zzWe will also use the following Wrtsil Standard blocks in this exercise:
FB110 M_SCIRHHLL
FC79 AO_SCALE
Wrtsil Finland Oy 65
Training material for Siemens S7 2012
66 Wrtsil Finland Oy
Training material for Siemens S7 2012
Networks 1-3
Wrtsil Finland Oy 67
Training material for Siemens S7 2012
Networks 4-6
68 Wrtsil Finland Oy
Training material for Siemens S7 2012
Networks 7-8
Wrtsil Finland Oy 69
Training material for Siemens S7 2012
Networks 9-10
70 Wrtsil Finland Oy
Training material for Siemens S7 2012
2. Next we will do FB19 Analog I/O. Copy Wrtsil standard blocks FB110 M_SCIRHHLL and
FC79 AO_SCALE into your project.
Wrtsil Finland Oy 71
Training material for Siemens S7 2012
72 Wrtsil Finland Oy
Training material for Siemens S7 2012
FB4 Sightseeing
Wrtsil Finland Oy 73
Training material for Siemens S7 2012
6. Insert new Function Block FB4 Sightseeing (GRAPH) and press OK.
74 Wrtsil Finland Oy
Training material for Siemens S7 2012
7. Insert Drag-and-Drop
Wrtsil Finland Oy 75
Training material for Siemens S7 2012
9. Like this!
76 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 77
Training material for Siemens S7 2012
78 Wrtsil Finland Oy
Training material for Siemens S7 2012
15. Write R to ?
Wrtsil Finland Oy 79
Training material for Siemens S7 2012
M59.2
I0.0 M59.1
M51.0
M59.3
I0.6
NEG!
M59.3
I0.6
M56.0
M51.1
M52.0
I0.7
M56.0
M52.1
NEG!
M59.6
M59.5
80 Wrtsil Finland Oy
Training material for Siemens S7 2012
I1.0 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
Training material for Siemens S7 2012
82 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 83
Training material for Siemens S7 2012
84 Wrtsil Finland Oy
Training material for Siemens S7 2012
2. Compile all
Wrtsil Finland Oy 85
Training material for Siemens S7 2012
86 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 87
Training material for Siemens S7 2012
88 Wrtsil Finland Oy
Training material for Siemens S7 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
Training material for Siemens S7 2012
(Note! In order to use this Sample project, you first need to install the FM350-1 driver from CD)
Copy all other blocks than OB1 from the sample project to your own project
90 Wrtsil Finland Oy
Training material for Siemens S7 2012
FB13 Positioner
Wrtsil Finland Oy 91
Training material for Siemens S7 2012
92 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 93
Training material for Siemens S7 2012
6. Press Save
7. File Compile
94 Wrtsil Finland Oy
Training material for Siemens S7 2012
Wrtsil Finland Oy 95
Training material for Siemens S7 2012
96 Wrtsil Finland Oy
Training material for Siemens S7 2012
12. Network 3
Wrtsil Finland Oy 97
Training material for Siemens S7 2012
FB7 Ramp
98 Wrtsil Finland Oy
Training material for Siemens S7 2012
14. Copy Wrtsil standard block FB128 CURVEXY into your project. We will use it for the
deceleration.
Values in green are confugurable for user. X-values are position difference from the desired position.
With CURVEXY you can decide how slow or fast is the deceleration of the rail.
Wrtsil Finland Oy 99
Training material for Siemens S7 2012
16. Network 1
16. Network 1
18. Network 4
19. Network 5
OB1
Networks 1-2
Networks 3-4
Network 5-6
Network 7
Networks 8-9
zzTank specification:
zzGain (P), Reset time (I) and Tank level SP [0-100%] are user inputs.
FB14 Astia
2. Rename it to Astia
Copy
7. Press Save
8. File Compile
FB8 MyPID
12. Network 1
14. Network 4
15. Network 5
18. Network 10
OB1
19. Network 10
Im CPU
OK,
315-PN/DP.
whatever
Configure a standardised
??? MODBUS/TCP
communication prototol
for me.
InInthe
thefifinal exercise well
nal exercise wellconfigure
configurea a
ModbusTCP connection
ModbusTCP for VAMP
connection 210 Generator
for VAMP Protection
210 Generator Protection
Relay.
Relay.
Protocols are
Protocols are used
usedwhen
whenexchanging
exchangingdata between
data heterogeneous
between heterogeneouscommunication partners.
communication In this In this
partners.
exercise we
exercise we are
are using
usingModbusTCP
ModbusTCP protocol. TheThe
protocol. controller, generator
controller, protection
generator relay and
protection operator
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.
Modbus
Ethernet
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
Now wewant
wantananillustration
illustration
of of
thethe Alive
Alive indicator
indicator value
value fromfrom
VAMPVAMP 210our
210 into into ourscreen.
HMI HMI screen.
DB121.DBW32
2. Then open project mbtcp_te and copy all the other blocks than OB1 and the SFB(s) and SFC(s) into
your project
Network 1
Network 2
(0x163)+(0x162)+(7x161)+(9x160)
= 0 + 0 + 112 + 9 = 121
DB121
(0x163)+(7x162)+(12x161)+(1x160)
Thus,
(1991 1985) * 2 = 12
DB address:
DB121.DBW32
Networks 3 & 4
Note!
Note! When changingInitial
When changing Initialvalues,
values, remember
remember to Initialize
to Initialize Data
Data Block.
Block.
View
View Data View
Data View
Edit
Edit InitializeData
Initialize DataBlock
Block
5. OB1
Network 11
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).
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
Now when wewant
wanttotochange
change thethe address
address of Alive
of Alive indicator
indicator from DB121.DBW20
from DB121.DBW20 to DB121.DBW32, we
to DB121.DBW32,
have to change
we have the
to change thevalue
valueofofDB_HOLD_ADD
DB_HOLD_ADD toto16#07C1
16#07C1 (1985).
(1985).
Remember,that
Remember, thatwewearent
arent now
now actually
actually reading
reading addresses
addresses 401987
401987 401990,
401990, because because we have set
we have set
START_ADDR
START_ADDR to to 1991
1991 in DB22.
in DB22.
9. Now you can monitor FB17 and DB121 in Online. It should look like this:
Q: Where is DB200.DBD10 (Current position) written? Which blocks are reading it?
2. Press Yes
3. OK
4. Press Filter
Q: Where is DB200.DBD10 (Current position) written? Which blocks are reading it?
A: It is written in
It is read in
28. Archive
Now you are ready to finish your exercise.
1. File Archive
4. Press OK
PLC_YYMMDD_PROJECTN.ZIP
8. Press OK
9. Done!