Professional Documents
Culture Documents
SIMATIC S7
Siemens AG 2008. All rights reserved.
Date:
File:
18.09.2009
PRO3_08E.1
Contents
Page
Objectives ........................................................................................................................................
Subnets in SIMATIC .........................................................................................................................
Communication Services for SIMATIC ............................................................................................
Industrial Ethernet An Overview ....................................................................................................
Ethernet CP Communications Services ............................................................................................
Functions and Services ....................................................................................................................
Definition of Terms ...........................................................................................................................
Structure of the IP Address (Internet Address) ..................................................................................
Integrating an Ethernet CP in the Hardware Configuration ................................................................
Assigning Parameters to the Ethernet Interface ................................................................................
Loading the Configuration Data ........................................................................................................
Communication Connections ............................................................................................................
Creating/Inserting a New Connection ................................................................................................
Connection Properties ......................................................................................................................
Functions for Data Transfer ..............................................................................................................
SIMATIC_NET_CP Library ...............................................................................................................
Communications Structure ...............................................................................................................
Communications Structure ...............................................................................................................
Exercise 1: Configuring a CP and Assigning Parameters to It ...........................................................
Exercise 2: Creating/Inserting an ISO-on-TCP Connection ...............................................................
Exercise 3: Assigning Parameters to the ISO-on-TCP Connection ...................................................
Exercise 4 : Expanding the S7 and Operator Panel Program ............................................................
Exercise 5: Communication via ISO-on-TCP Connection ..................................................................
Page 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
ST-PRO3
Industrial Ethernet
Objectives
SIMATIC S7
Siemens AG 2008. All rights reserved.
...
Date:
File:
18.09.2009
PRO3_08E.2
Page 2
ST-PRO3
Industrial Ethernet
Subnets in SIMATIC
PG 720
OPs
PC, OS
PG
MPI Network
Industrial Ethernet
Point to Point
PROFIBUS
SIMATIC S5
S7-400
M7-400
S7-300
Cell Level
-SINUMERIK, RCM
-TI 505
-Other PLC
PROFIBUS-DP
Field Level
DP/AS-I Link
ET 200C
ET 200B/L
ASI (Actuator Sensor Interface)
AS-I
Submodule
AS-I
Level
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.3
Overview
MPI
The MPI subnet is designed for tasks in the cell area. The MPI is the multi-point
capable interface in SIMATIC S7.
It is designed as the PG interface, that is, for the connection of PGs
(commissioning and test) and OPs (operator interface). Beyond that, the MPI
subnet can also be used to network a few CPUs.
Industrial Ethernet
Industrial Ethernet is the network for the management level and the cell level in
the open, manufacturer independent communication system of SIMATIC.
Industrial Ethernet is designed for the non-time critical transmission of larger
amounts of data and offers the possibility of connecting to location crossing
networks via Gateways.
PROFIBUS
PROFIBUS is the network for the cell and field area in the open, manufacturer
independent communication system of SIMATIC. There are two versions each
with their own characteristics:
in the cell area as PROFIBUS for the non-time critical communication
between equal, intelligent nodes.
as field bus PROFIBUS DP for time critical, cyclical data exchange between
intelligent masters and field devices.
PtP-Connection
Point-to-Point connections are mainly used for the non-time critical data
exchange between two stations or for the connection of devices, such as OPs,
printers, bar code readers, magnetic card readers etc. to a station.
AS-Interface
Page 3
ST-PRO3
Industrial Ethernet
Global Data
PG and HMI Functions
S7 Basic Comm.
S7 Expanded Communication
FDL
Comm. Conf.
Standards
SIMATIC S7
Communication
TCP/ISO-on-TCP
Open
Communic.
UDP
FMS
SIMATIC S7
S7 Communication
FDL (SDA)
ISO-Transport
TCP, ISO-on-TCP
UDP
FMS
MAP
DP
Profibus
Date:
File:
Global Data
MAP 3.0
DP
MPI
Services
ISO Transport
18.09.2009
PRO3_08E.4
Ethernet
Page 4
ST-PRO3
Industrial Ethernet
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.5
Overview
SIMATIC S7
Page 5
ST-PRO3
Industrial Ethernet
PG/OP communication
S7 communication
S5-compatible
communication
PROFINET communication
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.6
PG/OP
S7 Communication
S5compatible
IT Functions
PROFINET
Page 6
ST-PRO3
Industrial Ethernet
Date:
File:
18.09.2009
PRO3_08E.7
General
For connection configuration with STEP 7 (NetPro tool), you can explicitly select the
suitable connection type.
ISO-on-TCP
ISO-on-TCP is meant for secured cross-network data transmission. The ISO-onTCP protocol corresponds to the TCP Standard with the RFC 1006 addendum which
enables the transfer of data blocks. The advantage is that the transmission security
is very high due to automatic repetition and automatic block test mechanisms. For
communication between SIMATIC devices, the use of ISO-on-TCP connections is
recommended. Of course, both partners must fulfill the RFC 1006 Standard.
The communications partner confirms the data receipt using the SEND/RECEIVE
interface.
TCP/IP
The TCP connection is also called TCP-native or TCP/IP connection. With the TCP
connections and the SEND/RECEIVE interface, the Ethernet-CP supports the
socket interface (such as, winsocket.dll) to TCP/IP which is available on almost
every end system (PC or other system). TCP/IP connections should be used for the
connection to other systems if these do not support the RFC 1006 protocol
addendum.
ISO Transport The ISO protocol is, according to the ISO 8073 standard, an open protocol for
secured data transmission using configured connections. ISO Transport is
transmitted exclusively using Industrial Ethernet and is optimized for use on the
production level.
UDP
Page 7
ST-PRO3
Industrial Ethernet
Definition of Terms
IP = 192.168.0.3
MAC = 08-00-06-01-CA-FE
Subnet mask = 255.255.255.0
IP = 192.168.0.2
MAC = 08-00-06-01-AD-AC
Subnet mask = 255.255.255.0
2.
3.
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.8
ARP
To determine the Ethernet address of the receiver, the IP driver makes use of
the ARP protocol structure (Address Resolution Protocol).
In every TCP/IP-capable computer there is such an ARP table in which the
assignment of IP address to Ethernet address exists.
MAC Address
Since all stations are connected to the same bus cable, it is necessary for
targeted addressing that every participant has its own address through which it
is then accessible in the network.
For this, every Ethernet interface has been assigned a fixed and world-wide
unique address by is manufacturer. This address is called hardware or MAC
address (Media Access Control). It is stored on the network card and is used for
unique identification in the local network. Manufacturer cooperation ensures that
the address is unique world-wide.
DHCP
Subnet Mask
With the subnet mask, the division of the IP address into network and computer
address is carried out. Furthermore, a network can be further divided into
subnets with the subnet mask. As a result, a part of the computer address is
used as the subnet(work) address. That way, networks can be flexibly adapted
to organizational and physical factors.
Page 8
ST-PRO3
Industrial Ethernet
Addresses of Type A
b31
b0
Version
Subnet
Station address
Addresses of Type B
b31
Version
10
Subnet
Addresses of Type C
Station address
b31
Version
110
SIMATIC S7
Date:
File:
IP Address
18.09.2009
PRO3_08E.9
Type A:
Type B:
Type C:
Type D:
Type E:
Note
Station
address
Subnet
0 - 127.H.H.H
128 - 191.N.H.H
192 - 223.N.N.H
224-239.M.M.M
240-255.R.R.R
The network with the number 127 can not be used (loopback interface of IP
implementation: 127.0.0.1 = localhost).
Host IDs whose bits are all set to 0 or 1 are reserved for special functions, such
as, broadcasting, and therefore may not be assigned.
Carefully check the assignment of the IP addresses, if necessary, with the
support of the DV administration.
Page 9
ST-PRO3
Industrial Ethernet
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.10
Task
What to Do
A new subnet Ethernet (1) is then created in the project. All SIMATIC stations
existing in the project can be connected to this subnet.
If you prefer a graphic network display, select the network object Ethernet(1)
and open this object by double-clicking on it.
Page 10
ST-PRO3
Industrial Ethernet
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.11
General
When you use the TCP/IP Protocol, the MAC address as well as the IP
parameters are displayed. The default values can be changed accordingly.
ISO and/or IP Protocol must be explicitly selected.
In addition, a Router with its IP address can also be configured.
What to Do
Note
Page 11
ST-PRO3
Industrial Ethernet
Date:
File:
Principle
18.09.2009
PRO3_08E.12
Type of Connection
You can load the configuration data into the S7 station using the MPI
connection or the Ethernet. Prerequisite for loading using Ethernet is the node
initialization.
Node Initialization
In the so-called "node initialization", you initially supply the Ethernet CP with a
MAC address or an Internet address.
The node initialization is only possible using the MPI connection.
Page 12
ST-PRO3
Industrial Ethernet
Communication Connections
SIMATIC S7 station
with Ethernet CP
Ethernet node
send
communication
connection
receive
receive
send
Ethernet node
send
communication
connection
receive
SIMATIC S7
Date:
File:
Connections
18.09.2009
PRO3_08E.13
receive
send
The data transfer is bidirectional. That is, data can be sent and received at
the same time via the connection.
Both nodes have equal rights. That is, either node can initiate Send or
Receive activities as events demand.
The address of the communication partner is specified by configuration.
Exception: In the case of a "free UDP connection", the address is
specified at the FC interface in the user program.
General
Note
All stations outside of the STEP 7 project must be configured with dummy
objects such as, "SIMATIC S5" or "Other Station". Or, the Partner type is
"Unspecified" when you create the connection.
Page 13
ST-PRO3
Industrial Ethernet
Double-click
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.14
Creating/Inserting a
Connection
What to Do
Page 14
ST-PRO3
Industrial Ethernet
Connection Properties
SIMATIC S7
Siemens AG 2008. All rights reserved.
Attributes
Date:
File:
18.09.2009
PRO3_08E.15
If there are several CPs of the same type in the station that are all
connected to the same subnet, you can select the one you want to use
for the connection by clicking the Route... button.
Loading
After saving and compiling the connection configuration, both stations have to be
loaded. To do so, select the station with an existing Ethernet or MPI connection. Use
the menu options PLC Download to Current Project to now load the two stations.
Result
Both SIMATIC stations are connected to one another through a working ISO-onTCP connection.
Page 15
ST-PRO3
Industrial Ethernet
The FC blocks are supplied with the NCM S7-Ethernet configuration tool
(SIMATIC_NET_CP Library).
The following table shows the default block numbers.
You can change the block numbers if you wish.
Function
Symbolic Name
Explanation
FC5
AG_SEND
FC6
AG_RECV
FC7
AG_LOCK
FC8
AG_UNLOCK
FC50
AG_LSEND
FC60
AG_LRECV
SIMATIC S7
Date:
File:
Note
18.09.2009
PRO3_08E.16
For data transmission using TCP/IP Connections, you can only use the
functions
FC 50 "AG_LSEND",
FC 60 "AG_LRECV"
regardless of the amount of data to be transferred.
The earlier differentiation between FC 5 "AG_SEND" and FC 50
"AG_LSEND" as well as FC 6 "AG_RECV" and FC 60 "AG_LRECV" is no
longer valid as of block version V 4.1. As of this version, FC 5 and FC 6 are
also capable of processing long send and receive requests.
Page 16
ST-PRO3
Industrial Ethernet
SIMATIC_NET_CP Library
SIMATIC S7
Date:
File:
General
18.09.2009
PRO3_08E.17
AG_SEND
The block passes the user data from the specified user data area to the
Ethernet CP. The Ethernet CP independently triggers the transfer to the partner
station.
AG_RECV
The block accepts the user data received from the partner station in the user
data area specified in the call.
User Program
The user program triggers the transfer of the user data areas through the FC
block calls and monitors their execution by evaluating the return values.
The execution of the request is confirmed either positively or negatively in the
Done/NDR and Error Bit as well as Status Word of the respective block. Based
on the outputs of these three parameters, conclusions can be drawn on the
connection status.
Note
You will find help and exact explanation of all parameters, interconnections and
outputs of the respective blocks in the Online Help.
Page 17
ST-PRO3
Industrial Ethernet
Communications Structure
An ISO-on-TCP connection between 2 automation devices
Station LEFT
CPU 1
CP 1
MAC: 08-00-06-01-74-10
TSAP
ID
1
FC
LSEND
Station RIGHT
Example of a
connection
CPU 2
MAC: 08-00-06-01-74-20
TSAP
1
SEND
CP 2
1
DATA
RECEIVE
ID
FC
LRECV
Acknowledgement
ID
1
FC
LRECV
1
RECEIVE
1
SEND
IP Address:
IP Address:
192.168.0.3
192.168.0.2
SIMATIC S7
Date:
File:
Structure
DATA
Acknowledgement
18.09.2009
PRO3_08E.18
ID
FC
LSEND
Page 18
ST-PRO3
Industrial Ethernet
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.19
Function Up Till Now Up until now, only your own parts data record is created, displayed and
transferred into your "own" controller with the operator panel (WinCC-flexible Runtime) in the screen "Recipe". The individual values of the recipe are also
displayed in the Start screen (see slide above).
Task
Now the function of the operator panel is to be expanded so that the "Other
Recipe" of the partner station is displayed on your operator panel. For this, a
recipe view is to be created on the operator panel that displays the "Other
Recipe" of the other station (see slide).
The two stations are to exchange the current parts data records amongst
themselves, that is, the "Own Recipe" sends and the "Other Recipe" receives.
Note
Basically, the OPs could access their own controller and the controller of the
partner station directly and read out the data directly. The task could therefore
be solved without the explicit configuration of a communication.
For the exercise though, it is to be implemented with an Ethernet connection and
then with S7 communication.
Page 19
ST-PRO3
Industrial Ethernet
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.20
Task
You are to configure the communications processor of your training unit and
assign parameters to it as shown in the slide.
What to Do
1. Integrate the CP in your HW-Config as shown in the slide. You will find the
CP in the HW Catalog under
SIMATIC 300 CP-300 Industrial Ethernet CP343-1
2. Parameterize the CP as shown in the slide
Make the following arrangements with your partner group:
the IP addresses of both CPs must begin with 192.168.0. .., only the
last digit must be different, for example:
CP LEFT: 192.168.0.3
and CP RIGHT: 192.168.0.2
the subnet masks of both CPs must be identical: 255.255.255.0
Station LEFT: active connection build up, Station RIGHT not!
3. Save and compile the hardware configuration and download it in your station.
Page 20
ST-PRO3
Industrial Ethernet
Double-click
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.21
Task
So that you dont have to load the hardware station of your partner group into
your own project, create an ISO-on-TCP connection to a station that is not
stored in your project. For this, select "unspecified" station as the connection
partner in the Connection dialog.
What to Do
Page 21
ST-PRO3
Industrial Ethernet
SIMATIC S7
Date:
File:
What to Do
18.09.2009
PRO3_08E.22
Page 22
ST-PRO3
Industrial Ethernet
ISO-on-TCP
Connection
SIMATIC S7
Date:
File:
18.09.2009
PRO3_08E.23
Function Up Till Now With the OP, your own parts data records are transferred directly into the
Instance DB "DB_FB-OP" (DB99), that is, into the OUT parameter #Parts_Data
of the function block "FB-OP" (FB99) using the screen "Own Recipe". Through
this OUT parameter, the current parts data record is then passed on to FB-Line".
Task
On both CPUs, the DB99 instance data block of FB99 is to be used as the
interface for the exchange of recipes.
The OP writes the "Own Recipe" as usual in the variable, that is, the OUT
parameter #Parts_Data. The OP reads the "Other Recipe" from the (STAT)
variable #Other_Data that is to be newly created in FB99 (and that is also
automatically created in the instance DB 99). Each OP still only accesses the
DB99 of its "own" CPU, not that of the "other" CPU.
What to Do
Page 23
ST-PRO3
Industrial Ethernet
LEFT
S t a t i o n
FB99
FB99
"AG_SEND" (FC 5)
ACT
RIGHT
"AG_SEND" (FC 5)
ACT
DONE
ID
ERROR
LADDR
STATUS
ISO-on-TCP
SEND
LEN
DONE
ID
ERROR
LADDR
STATUS
SEND
LEN
"AG_RECV" (FC 6)
ID
"AG_RECV" (FC 6)
NDR
ERROR
LADDR
RECV
ID
Connection
RECV
STATUS
LEN
SIMATIC S7
NDR
ERROR
STATUS
LEN
Date:
File:
LADDR
18.09.2009
PRO3_08E.24
Task
To exchange the parts data records via the ISO-on-TCP connection, the
standard blocks "AG_SEND" (FC 5) and "AG_RECV" (FC 6) must now be
integrated in the S7 program.
The blocks are included in the "SIMATIC_NET_CP" "CP 300" library.
What to Do
Page 24
ST-PRO3
Industrial Ethernet