Académique Documents
Professionnel Documents
Culture Documents
SIMATIC NET
NCM S7 for Industrial Ethernet
Primer
11/2002
C79000G8976C116
Release 03
PROJECT ETHERNET
The S7 Sample Project
Communication on the
SEND/RECEIVE Interface...
...Between S7 Stations
References
Danger
indicates that death or severe personal injury will result if proper precautions are
not taken.
Warning
indicates that death or severe personal injury can result if proper precautions are
not taken.
Caution
with warning triangle indicates that minor personal injury can result if proper
precautions are not taken.
Caution
without warning triangle indicates that damage to property can result if proper
precautions are not taken.
Notice
indicates that an undesirable result or status can result if the relevant notice is
ignored.
Note
highlights important information on the product, using the product, or part of the
documentation that is of particular importance and that will be of benefit to the
user.
Trademarks
SIMATICR, SIMATIC HMIR and SIMATIC NETR are registered trademarks of
SIEMENS AG.
Third parties using for their own purposes any other names in this document which
refer to trademarks might infringe upon the rights of the trademark owners.
Safety Instructions Regarding your Product:
Before you use the product described here, read the safety instructions below thoroughly.
Qualified Personnel
Only qualified personnel should be allowed to install and work on this equipment.
Qualified persons are defined as persons who are authorized to commission, to
ground, and to tag circuits, equipment, and systems in accordance with established safety practices and standards.
Correct Usage of Hardware Products
Note the following:
Warning
This device and its components may only be used for the applications described in
the catalog or the technical description, and only in connection with devices or
components from other manufacturers which have been approved or
recommended by Siemens.
This product can only function correctly and safely if it is transported, stored, set
up, and installed correctly, and operated and maintained as recommended.
Before you use the supplied sample programs or programs you have written
yourself, make certain that no injury to persons nor damage to equipment can
result in your plant or process.
EU Directive: Do not start up until you have established that the machine on which
you intend to run this component complies with the directive 89/392/EEC.
Warning
This software may only be used for the applications described in the catalog or the
technical description, and only in connection with software products, devices, or
components from other manufacturers which have been approved or
recommended by Siemens.
Before you use the supplied sample programs or programs you have written
yourself, make certain that no injury to persons nor damage to equipment can
result in your plant or process.
Prior to Startup
Prior to startup, note the following:
Caution
Prior to startup, note the information and follow the instructions in the latest
documentation. You will find the ordering data for this documentation in the
relevant catalogs or contact your local Siemens office.
Disclaimer of Liability
We have checked the contents of this manual for agreement with the hardware and software described. Since deviations cannot be precluded entirely,
we cannot guarantee full agreement. However, the data in this manual are
reviewed regularly and any necessary corrections included in subsequent
editions. Suggestions for improvement are welcomed.
Siemens AG
Automation and Drives
Postfach 4848, D-90327 Nuernberg
Siemens Aktiengesellschaft
C79000G8976C11603
Preface
Aims
You want to install our SIMATIC S7 CPs in your system and make
optimum use of them.
How to Achieve
Your Aims
This primer will help you to become familiar with handling NCM S7 for
Industrial Ethernet, the configuration tool for S7 CPs. Based on the
configuration and program examples supplied with NCM, we introduce
you to the typical steps required to make optimum use of NCM S7 for
Industrial Ethernet with your SIMATIC S7 CPs.
Aims of the Primer...
Requirements
You should be familiar with the basics of STEP 7, in other words you
should know the following:
S
Audience
Scope of the
Manual
Further
Information...
Preface
Note
Please note that the NCM S7 for Industrial Ethernet product information bulletin
may contain further information about the sample programs described in this
primer.
Conventions
S
Based on the sample configuration and the sample program PROJECT ETHERNET, the
Primer will guide you through the following steps in the next chapters:
Chapter 2
PROJECT ETHERNET
1. Create/open your project
It is advisable to create all the system data offline.
The data can then be changed, saved and
downloaded at any time. The basis for this is the
STEP 7 project PROJECT ETHERNET.
Chapter 3
ISO
S7<>S7
Chapter 4
ISO
S7<>S5
5. Startup/diagnostics
If you encounter problems, you can
investigate the S7 stations with the
online tools of STEP 7/STL and
NCM diagnostics.
PROJECT ETHERNET
STEP 7 Samples for Ethernet CPs
This chapter explains how you can use the PROJECT ETHERNET
with the configurations and programs for the communications samples.
Contents:
Create/open your project
Configure and network your hardware
9
12
PROJECT ETHERNET
After installation of the NCM S7 optional software, the sample project is located in the project
folder of STEP 7, for example in the folder C:\SIEMENS\STEP7\EXAMPLES\EXIE.
If you want to use the project in the S7 folder, follow the steps outlined below:
Manual
/3/
Chapter 2
PROJECT ETHERNET
n ...Use the menu command File " Save As to create a copy of the sample project in any
folder you wish.
Device configuration
The following table shows the configurations in the individual stations. This will also indicate
how much of the sample you can use directly and the extent to which you will have to adapt the
sample.
Station
CP Type
MAC Address
SIMATIC 400
station(1)
CP 4431
08.00.06.01.00.00
Communicate
s with Station
SIMATIC 400
station(2)
Description
Communication via the
SEND/RECEIVE interface with the
CP 4431.
Data are transmitted in both directions. The FCs AG_SEND and
AG_RECV are used.
SIMATIC 400
station(2)
CP 4431
08.00.06.01.00.01
SIMATIC 400
station(1)
SIMATIC 400
station(3)
CP 4431
08.00.06.01.00.03
SIMATIC S5
station(1)
SIMATIC
S5(1)
10
CP 1430
TF
08.00.06.01.00.02
SIMATIC 400
station(3)
PROJECT ETHERNET
n Copy the sample programs (container with S7 programs) of the station from the sample
project to the CPU of your existing project. Make sure that blocks do not overlap.
n Make sure that the hardware configuration and networking and the configured connections
are adapted according to the descriptions below.
11
PROJECT ETHERNET
include?
TIP
Page 28 deals with the topic
Downloading
Manual
/3/
Chapter 2
NetPro.
n Double-click the object Ethernet(1) in your project in the SIMATIC Manager. This opens the
NetPro view for your project.
From this display, you can start all the steps required for hardware and connection
configuration.
As shown in the illustration,
S the connection table for the selected CPU is displayed in the lower part of the screen;
S information about the network attachment is displayed if you point to the symbol for the
interface of the node with the mouse pointer.
12
PROJECT ETHERNET
From the information relating to the network attachments, you can recognize the following
situation:
The CP 443-1 has the configured MAC address (node). The CPU is shown with an MPI
address. You require this MPI addresse, for example, when you want to run diagnostic functions
on the CP via the MPI attachment of the CPU with NCM Ethernet Diagnostics.
If you want to modify the network address...
For more
information...
Manual
/2/
Chapter
2.2.4
n Select the station or the CPU in the SIMATIC 400 station(1) in the NetPro view; then select
Edit " Open Object. You will see the hardware configuration with an overview and a
detailed view.
If you want to see the configuration of one of the displayed modules in detail,
n position the cursor on the module, for example the CP 443-1 and select Edit " Object
Properties.
13
PROJECT ETHERNET
S Entire station
S Selected module(s)
The printout for the CP you are using then appears as shown below:
14
PROJECT ETHERNET
15
PROJECT ETHERNET
n Connect the PG to the MPI interface of the CPU using the MPI cable.
n Set the interface on your PG/PC for the required type of attachment. Select the PG/PC
interface in the Windows control panel to match the CPs available on your PG and to match
the bus attachment.
TIP
To check which nodes are
accessible over Ethernet, use the
Accessible Nodes function.
Manual
/3/
Section
2.2.9
16
You can use the sample program as a basis for creating PLC
programs.
Requirements
A working knowledge of STEP 7, experience with STL, a
working knowledge of PLCs.
If you require detailed information about the properties of
the type of communication introduced here or about other
functions provided by the configuration software, please
refer to the corresponding manuals. The preface of the
manuals provides you with an overview of the available
documentation. This chapter also contains references to
specific manuals.
Contents
3.1 The task
18
19
21
23
29
36
17
3.1
The Task
Process data
Time
Time
The jobs and responses in the example contain 4 bytes of user data.
18
3.2
System Configuration
Structure
The following system configuration is required for the supplied sample project (modifications /
alternatives are possible > see following page):
MPI interface
MPI interface
Ethernet
as400
19
Required Devices/Resources
You require the following components if you want to use the supplied example unmodified.
No.
Required
Type
Order Number
see Catalog ST 70
CP 4431
6 GK 7443-1EX11-0XE0 1)
6ES7422-1BH10-0AA0
or by
Digital output module DO32xDC24V/0.5A
6ES7422-1BL10-0AA0
Transmision path
see Catalog ST 70
S MPI attachment
S As an option for the PG/PC mode on Ethernet: CP for
Ethernet attachment >
diagnostics/installation/service
1)
Newer versions of the module are normally compatible in terms of functionality; You can load
the configuration data of the sample project on your module without needing to make changes.
Please read the information in the manual of the CPs on the topic of compatibility and replacing
devices!
Alternatives:
You can adapt the sample configuration to suit your own situation. Possible modifications are
outlined below:
20
Notice
If you change the module address in the configuration, you must also adapt the
user program and the configured connection.
3.3
This description is based on the created project and on the configured stations. The steps
Create Project and Configuring and Networking Hardware were explained in Chapter 2.
1. Create/open your project
2. Configure and network your hardware
n
n
Chapter 2
5. Startup
TIP
Skip the functions that you
already know.
Chapter 2 deals with the topic of
Downloading.
21
n
n
Set up communication
connections for the CPUs.
When completed, you will have
downloaded the connection
configuration to the stations.
5. Startup
Communication on the SEND/RECEIVE interface uses
configured ISO connections . The next step is therefore
to download the connection list to the station.
TIP
Page 27 contains more detailed
information about Downloading.
First, however, you should get an overview of the sample configuration by:
For more
information...
Manual
/3/
Chapter 3
n Change back to the SIMATIC Manager and select the CPU in the required station.
22
Connection
Note...
...By selecting the stations, you
can obtain an overview of all the
stations in the project and the
configured connections.
Further connections...
...You can configure further configurations to this or other partner stations in this overview.
n To insert a new connection in the connection list, select the function Insert " Connection.
23
n Select the connection properties by double-clicking the connection in the connection table.
0001 is the ID that you
use
in the user program on the
SEND/RECEIVE interface
A020 is the ID for ISO
transport connections.
Addresses Tab
The information in the Addresses tab page for a connection between S7 stations within a
project does not normally need to be modified.
24
For further information about the status of the connection or the connection
configuration, open the Overview tab.
If the character ! appears in the Local ID field, this indicates further relevant information in
the Status field. Depending on the setting of the table header, this field may be hidden. You
can readjust the display with the horizontal arrow key.
In the situation shown here, the status is when the connection configuration is completed.
25
n ...select the Change Partners dialog with the Edit" Change Partners menu command or
by double-clickng the connection in the Partner column of the connection table.
26
n If you have made changes in the connection configuration, save your changes with
Connection Table
"
Save.
n Select the station in the connection table for which the Ethernet attachment exists.
n Select the menu command PLC " Download.
Note:
During the download, you are asked whether you want to copy
from RAM to ROM on the CP. If
you want to save the data in nonvolatile memory, answer with
Yes.
For more information...
Manual
/4/
27
n
n
n
TIP
Page 34 contains more detailed
information about the topic
Downloading.
n ...you should print out the program blocks and check them. The following page contains an
overview of the FCs required for communication.
28
The table shows which blocks of the types OB and FC handle which tasks.
Task in SIMATIC
400 Station 1
Task in SIMATIC
400 Station 2
Processing process
data
OB100
Creation of data blocks DB30 and DB31. The process
values are saved in these data blocks.
OB1
Coordination of the program sequence.
FC29
A data word is incremented and decremented cyclically.
The time interval for botj incrementing and decrementing
is 3 seconds.
FC30/FC5 (AG_SEND)
This data word is transferred to Station 2 as the current
process value (job).
Accept and process
job
OB100
Creation of data blocks DB30 and DB31. The process
values are saved in these data blocks.
OB1
Coordination of the program sequence.
FC31/FC6 (AG_RECV)
Save the received data in the data block and output the
data to the process simulation.
FC30/FC5 (AG_SEND)
Return the data to Station 1 as job confirmation.
Evaluate the
received data
FC31/FC6 (AG_RECV)
Accept and evaluate job confirmation.
Output process data to the simulation module.
Notice
You can take and use the latest versions of the communications blocks (FC5/
FC6) for your module from the SIMATIC NET block library of STEP 7.
If you are using an older module type, this is only possible if you use the latest
firmware version for this module type.
29
OB100
OB100
Create data
blocks
DB30 and 31
Create data
blocks
DB30 and 31
Startup
Cyclic
processing
OB1
OB1
FC29
Increment /
decrement /
data word
FC31
FC30
AG_SEND
ISO transport
connection
FC30
FC31
AG_RECV
Legend:
30
AG_RECV
AG_SEND
S AG_SEND (FC5)
This block transfers the user data from the specified
user data area to the Ethernet CP for transmission.
S AG_RECV (FC6)
Manual
/3/
Chapter 4
STL
Explanation
call fc 5
ACT
:=
ID
:=
LADDR :=
SEND
:=
LEN
:=
DONE
:=
ERROR :=
STATUS :=
M 50.0
1
W#16#0110
P#db30.dbx1.0 byte 240,
4
M 1.2
M 1.3
MW 200
STL
Explanation
call fc 6
ID
LADDR
RECV
NDR
ERROR
STATUS
LEN
:=
:=
:=
:=
:=
:=
:=
1
W#16#0110
P#DB31.DBX 1.0 BYTE 240
M1.0
M1.1
MW202
MW10
To see the complete code contained in these FCs, and the other OBs and FCs, please refer to
the printouts of the sample project.
31
n Confirm your selection; as far as possible, the available parameter values are entered in the
block call.
FCs AG_LSEND/ AG_LRECV for longer data areas (CP 4431)
The newer versions of the Ethernet CPs with the FCs AG_LSEND (FC50) and AG_LRECV can
transfer larger data areas (up to 8192 bytes). Please check the manual of your CP for the
supported data area and, if applicable, use the appropriate FCs.
Working with the FCs is explained in the manual.
For more
information...
Manual
/3/
Chapter 5
32
S Evaluation of the result codes of the FCs AG_SEND and AG_RECV to allow you to react to
specific statuses in your system.
S Conditional initiation of communication calls depending on result codes, so that, for example,
the send call on the client is only triggered again after the job confirmation has been
received with the receive call.
Section 4.2
Job
DONE/NDR = 1
ERROR = 0
STATUS = 0
DONE/NDR = 0
ERROR = 0
STATUS = 8180/8181
Active
Manual
/3/
DONE/NDR = 0
ERROR = 1
STATUS = x
33
Edit
Insert
PLC
Manual
/4/
n Check the program sequence online in STEP 7/STL (monitor blocks). Check whether a
changing data word is being output to the simulation module.
n Go on to the next step and check communication with NCM Ethernet diagnostics.
34
n
n
n
n
5. Startup / diagnostics
Manual
/3/
Chapter 5
S Operating Mode
What is the status of the stations?
S ISO Transport
What is the status of the ISO transport connections?
Were frames sent?
How many successful?
How many with errors?
S Diagnostic Buffer
What do the diagnostic buffer entries say?
35
Contents:
4.1 Changed system configuration
37
39
36
41
42
46
49
4.1
In the system configuration shown in Section 3.2, the S7 station 2 must be replaced by a
SIMATIC S5 station (modifications / alternatives are possible > see Section 3.2).
SIMATIC 400 station (3)
SIMATIC S5
with CP 1430 TF
MPI interface
AS511 interface
Ethernet
as400
37
Required Devices/Resources
You require the following components if you want to use the supplied example unmodified.
No.
Required
1)
Type
Order Number
see Catalog ST 70
CP 443-1
6 GK 7443-1EX11-0XE0 1)
CP 1430 TF
6 GK1 4300TA0x
6 GK1 4300TB0x
Newer versions of the module are normally compatible in terms of functionality; You can load
the configuration data of the sample project on your module without needing to make changes.
Please read the information in the manual of the CPs on the topic of compatibility and replacing
devices!
1
Transmission path
S
S
S
S
On the S5 station, you can use the example programs supplied with the NCM COM 1430
configuration tool. Depending on the hardware configuration (CPU type etc.), you must select
the suitable sample programs. For more detailed information refer to
Manual
/14/
Volume 1
Chapter 7
Appendix
A.4
38
4.2
The following example is based on the project that was created and the stations that have been
configured. The steps Creating your project and Configuring/networking your hardware were
explained in Chapter 2.
1. Create your project
2. Configure and network your hardware
n
n
Chapter 2
5. Startup
TIP
Skip the functions that you
already know.
Chapter 2 deals with the topic of
Downloading.
39
Extra:
The S5 station is managed
with NCM COM 1430 TF.
COM 1430 TF
Database file:
ABU1AG2.CP2
Manual
/14/
Volume 1
Chapter 7.
Appendix A.4
40
Extra:
The SIMATIC S5 station must be
made known in the STEP 7 project
and networked.
5. Startup
Manual
/14/
Volume 1
Chapter 5
Appendix
A.4
To network the SIMATIC 400 station with the SIMATIC S5 station and
to be able to obtain the station on ISO transport connections...
...this S5 station must be included in the STEP 7 project. In the sample project, a station of
the type SIMATIC S5 has been created.
If you want to continue working in a different project, you must now create a SIMATIC S5
station.
41
42
43
n
n
Extra:
The connection parameters
for the S5 and S7 PLCs must
be matched.
5. Startup
To create the ISO transport connections for S7Station(3) in the STEP 7 project...
...follow the steps as described in Chapter 1:
n Open the connection table for the CPU in the SIMATIC 400 station.
n Select the connection properties by double-clicking the connection in the connection table.
44
n Use the function Edit "Connections "Transport Connections in COM 1420 TF:
n Check the following assignment:
TSAP local (S5) = TSAP remote (S7)
TSAP remote (S5) = TSAP local (S7)
Manual
/14/
Volume 1
Chapter 7
COM 1430 TF
Transport Connection
Local Parameters:
TSAP (ASC): 0 1
Remote Parameters:
MAC Address: 08.00.06.01.00.01
TSAP (ASC): 0 2
45
46
n
n
n
Extra:
OBs, FBs and HDBs are used
on the SIMATIC S5 side.
5. Startup
Processing process
data
OB100
Creation of data blocks DB30 and DB31. The process
values are saved in these data blocks.
OB1
Co-ordination of the program sequence.
FC29
A data word is incremented and decremented cyclically.
The time interval for both incrementing and decrementing
is 3 seconds.
OB1
Coordination of the program sequence.
FB101 (HDB RECEIVE)
Saves received data in the data block and outputs them
to the process simulation.
Notice
You can take and use the latest versions of the communications blocks (FC5/
FC6) for your module from the SIMATIC NET block library of STEP 7.
If you are using an older module type, this is only possible if you use the latest
firmware version for this module type.
47
SIMATIC S5 station
OB 20 / 21 / 22
OB 100
FB 111
Create
data blocks
DB30 and 31
Startup
HDBSYNC
Cyclic
processing
OB 1
OB 1
FC 29
Increment /
decrement
data word
FB 101
FC 30
HDBCTRL
AG_SEND
Legend:
ISO
transport
connection
HDBRECEIVE
n If the CP 1430 TF is not synchronized during startup, this may be caused by an incorrect
OB20. Copy the content of OB21 to OB20 so that the HDB SYNC is correctly called.
48
Notice
Make sure that you use the correct HDBs for the specific CPU in the S5 station.
In the example, you require the following:
HDB-SYNC
HDB-CTRL
HDB-RECEIVE
Manual
/14/
Volume 1
Appendix A
n Check the program sequence online in STEP 7/STL (monitor blocks). Follow the same
procedure with the programs on the SIMATIC S5 PLC in STEP 5.
49
References
/1/
/2/
/3/
/4/
/5/
/6/
/7/
/8/
/9/
SINEC CP 1413
Manuals for MSDOS, Windows
SIEMENS AG
/10/
SIMATIC S7
S7-300 Programmable Controller
Hardware and Installation
Manual
SIEMENS AG
50
References
/11/
/12/
/13/
SIMATIC Software
NetPro
Graphic Network Configuration
SIEMENS AG
/14/
SINEC
CP 1430 TF with NCM COM 1430 TF
Manual
SIEMENS AG
6 GK 19701TA430AA0
Order Numbers
The order numbers for the SIEMENS documentation listed above can
be found in the catalogs SIMATIC NET Industrial Communication,
Catalog IK10 and SIMATIC Programmable Controllers SIMATIC S7 /
M7 / C7.
You can obtain these catalogs and any further information you require
from your local SIEMENS office or national head office.
51