SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 1
For internal use only / © Siemens AG 2009. All Rights Reserved.
S7-1200
and
STEP7 Basic V10.5
Chapter 7:
Communication
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 2
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Overview: Communication interfaces
CPU onboard: Ethernet (PROFINET)
PG/OP Communication
Open User Communication (T-Blocks)
8 connections
TCP native (up to 8kB)
ISO-on-TCP (up to 8kB)
UDP (in preparation)
S7-Communication
S7-1200 as Server
Client: PUT/GET (in preparation)
PROFINET I/O (in preparation)
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 3
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Overview: Communication interfaces
Communication Module (CM)
Point-to-Point communication over RS232 and RS485
ASCII – Protocol (Freeport serial communication)
USS – Drive protocol
Modbus – Protocol
RTU Master-Protocol
RTU Slave-Protocol
3rd Party
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 4
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Open user communication – Overview
Blocks without connection management
„TCON „ make an Ethernet connection
„TDISCON“ break an Ethernet connection
„TSEND“ send data
„TRCV“ receive data
Blocks with connection management
„TSEND_C“ make an Ethernet connection and send data
„TRCV_C“ make an Ethernet connection and receive data
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 5
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Without connection management
CPU 1 (active)
Connect
Connection
data
IP Address
ConnectionID
TSAP/PORT
IE Port
TSEND
SFB
TCON
SFB
TDISCON
SFB
TRCV
SFB
CPU 2 (passive)
Connection
data
IP Address
ConnectionID
TSAP/PORT
IE Port
TRCV
SFB
TCON
SFB
TDISCON
SFB
TSEND
SFB
Disconnect
Data
Data
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 6
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
With connection management
CPU 1 (active)
Connect
Connection
data
IP Address
ConnectionID
TSAP/PORT
IE Port
TSEND_C
SFB
TRCV_C
SFB
CPU 2 (passive)
Connection
data
IP Address
ConnectionID
TSAP/PORT
IE Port
TRCV_C
SFB
TSEND_C
SFB
Data
Disconnect
Connect
Data
Disconnect
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 7
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Protocol: TCP and UDP
TCP
IP: 192.168.2.1
Ethernet
UDP
Port
21
Port
80
Port
102
Port
67
Port
123
Port
161
FTP File Transfer Protocol
http
Hyper Text Transfer Protocol
ISO on TCP
Bootp
assign I
P
Add
r
ess
NTP Net
w
ork Time Protoco
l
SNMP
Si
m
ple Network M
a
nag. Pro
t
ocol
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 8
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Protocol: ISO-on-TCP
IP: 192.168.2.1
Ethernet
UDP
Port
21
Port
80
Port
67
Port
123
Port
161
FTP File Transfer Protocol
http
Hyper Text Transfer Protocol
ISO on TCP
Bootp
assign I
P
Add
r
ess
NTP Net
w
ork Time Protoco
l
SNMP
Si
m
ple Network M
a
nag. Pro
t
ocol
Port
102
TCP
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 9
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Protocol: TSAP at ISO-on-TCP
IP: 192.168.2.1
Ethernet
UDP
Port
21
Port
80
Port
67
Port
123
Port
161
Port
102
TCP
TSAP
Application
TSAP (Transport Service Access Point)
Access point for ISO-on-TCP connections
ISO-on-TCP connections always via Port 102
In ASCII or HEX
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 10
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Device- and Network configuration
Activate
networking
connect PLCs with
subnet via Drag&Drop
Properties of the
Ethernet interface
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 11
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Blocks in the Task-Card „Instructions“
Task-Card
„Instructions“
Blocks for
Open user
communication
Below „Other“ are the
blocks without connection
management
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 12
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Send data with „TSEND_C“
Connecting, send data and disconnecting in one block
Hold connection or
disconnecting
Connection
data
IP Address
ConnectionID
TSAP/PORT
Connecting and send
data with rising edge
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 13
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Blocks
Configuration
Ethernet Basics
Overview
Open user
communication
Overview
Receive data with „TRCV_C“
Connection
data
IP Address
ConnectionID
TSAP/PORT
Choice connection
type
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 14
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise for Communication
Let’s just do it the lab for you
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 15
Task Connect S7-1200 Demo Boxes
Process 1. connect two S7-1200 Demo Boxes
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Connect S7-1200 Demo Boxes
1
Team1
IP: 192.168.0.x
Team2
IP: 192.168.0.x+1
S7-1200 PLCs have to different IP Addresses
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 16
Task Create new project
Process 2. activate „Create new project“
3. set project name to „My_Communication“
4. click button „Create“
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Create new project
2
3
4
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 17
Task Add unspecified PLCs
Process 5. start editor for „Devices & Networks“
6. In Hardware catalog select 6ES7 2XX-XXXX-XXXX at PLC >
SIMATIC S7-1200 > CPU > Unspecified CPU 1200
7. insert PLC via Drag&Drop in „Network view“
8. repeat Step 7 also for the second PLC
9. select PLC_1
10. switch to the device view of PLC_1
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Add unspecified PLCs
5
8
6
7
9
10
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 18
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Upload Hardware configuration
11
12
13
1
4
1
5
1
6
1
7
Hands-on
Task Upload Hardware configuration
Process 11. detect the configuration of the connected device
12. select accessible device (check MAC-address)
13. load configuration
14. uploaded configuration of S7-1200 Demo rack
15. select PLC_2 in the DropDown list
16. repeat Step 11 up to 14 also for the second PLC
17. switch to the Network view
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 19
Task Adjust PLC properties
Process 18. activate „Networks“ in the taskbar
19. connect both PLC with a subnet via Drag&Drop
20. select PLC_1
21. activate clock memory bits for PLC_1
Hint: You need following memory bit for your user program:
- „1Hz clock“ (M0.5)
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Adjust PLC properties
19
18
20
21
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 20
Task Add “TSEND_C“ in PLC_1
Process 22. open OB1 of PLC_1
23. In Extended instructions select „TSEND_C“ at Communication >
Open user communication and insert in OB1 via Drag&Drop
24. add Instance-DB for „TSEND_C“
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Add „TSEND_C“ in PLC_1
2
2
23
24
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 21
Task Adjust connection parameters of PLC_1
Process 25. set PLC_2 as Partner PLC
26. assign „PLC1“ to Local TSAP and „PLC2“ to Partner TSAP
27. assign M0.5 (1Hz Clock) to In-Parameter „REQ“
28. assign TRUE to In-Parameter „CONT“
29. assign ‘1’ to In-Parameter „LEN“
30. assign IB0 to In-Parameter „DATA“
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Adjust connection parameters PLC_1
2
5
27
2
6
26
30
28
29
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 22
Task Add „TRCV_C“ in PLC_2
Process 31. open OB1 of PLC_2
32. In Extended instructions select „TRCV_C“ at Communication >
Open user communication and insert in OB1 via Drag&Drop
33. add Instance-DB for „TRCV_C“
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Add „TRCV_C“ in PLC_2
31
32
33
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 23
Task Adjust connection parameters of PLC_2
Process 34. set PLC_1 as Partner PLC
35. choose „PLC_2_Connection_DB“ as connection data for Local PLC
and „PLC_1_Connection_DB“ for Partner PLC
36. assign TRUE to In-Parameter „EN_R“
37. assign TRUE to In-Parameter „CONT“
38. assign ‘1’ to In-Parameter „LEN“
39. assign QB0 to In-Parameter „DATA“
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Adjust connection parameters PLC_2
3
4
36
3
5
35
39
37
38
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 24
Task Load project
Process 40. select both PLCs (CTRL + mouse click)
41. load projects
For internal use only / © Siemens AG 2009. All Rights Reserved.
Industry SectorCommunication
PtP Communication
Exercise
Open user
communication
Overview
Exercise7-1: Load project
40
40
41
Hands-on
SIMATIC Systems Support
I IA AS CS 2 FA
S7-1200 and STEP7 Basic V10.5
Communication
Page 25
For internal use only / © Siemens AG 2009. All Rights Reserved.
I IA AS CS 2 FA
Phone: +49 (911) 895-4646
E-Mail:
Thank you for your attention!