Tải bản đầy đủ (.pdf) (37 trang)

Ethernet Communication: Data Exchange S7-1200 S7-1200 S7-1200 Configuration Example X17  pdf

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (7.67 MB, 37 trang )



Applications & Tools
Answers for industry.
Ethernet Communication:
Data Exchange S7-1200 <-> S7-1200
S7-1200
Configuration Example X17  February 2010
Warranty, liability and support

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 2

Warranty, liability and support
Note
The application examples are not binding and do not claim to be complete
regarding the circuits shown, equipping and any eventuality. The application
examples do not represent customer-specific solutions. They are only intended
to provide support for typical applications. You are responsible for ensuring that
the described products are correctly used. These application examples do not
relieve you of the responsibility of safely and professionally using, installing,
operating and servicing equipment. When using these application examples, you
recognize that we cannot be made liable for any damage/claims beyond the
liability clause described. We reserve the right to make changes to these
application examples at any time without prior notice. If there are any deviations
between the recommendations provided in these application examples and other
Siemens publications – e.g. Catalogs – then the contents of the other documents
have priority.

We do not accept any liability for the information contained in this document.
Any claims against us – based on whatever legal reason – resulting from the use of


the examples, information, programs, engineering and performance data etc.
described in this application example shall be excluded. Such an exclusion shall
not apply in the case of mandatory liability, e.g. under the German Product Liability
Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,
body or health, guarantee for the quality of a product, fraudulent concealment of a
deficiency or breach of a condition which goes to the root of the contract
(“wesentliche Vertragspflichten”). However, claims arising from a breach of a
condition which goes to the root of the contract shall be limited to the foreseeable
damage which is intrinsic to the contract, unless caused by intent or gross
negligence or based on mandatory liability for injury of life, body or health. The
above provisions do not imply a change in the burden of proof to your detriment.
It is not permissible to transfer or copy these application examples or excerpts of
them without first having prior authorization from Siemens Industry Sector in
writing.
For questions about this document please use the following e-mail address:




Table of Contents

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 3

Table of Contents
Warranty, liability and support 2
1 Automation Problem 4
1.1 Tasks 4
Task A 4
Task B 4

1.2 Communication versions 4
Automation solution A 4
Automation solution B 5
1.3 Demo setup 5
1.4 List of components 6
2 Automation Solution 7
2.1 Connection diagram 7
2.2 S7-1200 Ethernet communication 7
Protocol versions 7
2.2.1 Integrated connection management (task A) 8
2.2.2 Manual connection management (task B) 10
2.2.3 Block parameterization 11
Saving the output parameters 13
2.3 Data transfer 15
2.3.1 Absolute addressing 15
2.3.2 Symbolic addressing 16
3 Configuration 19
3.1 Installing and wiring the hardware (automation solution A+B) 19
3.2 Hardware / network configuration (automation solution A+B) 20
3.3 Ethernet communication with integrated connection management
(automation solution A) 22

3.3.1 Sender side 22
3.3.2 Receiver side 23
3.3.3 Downloading the overall project 25
3.3.4 Creating the Watch tables 26
3.3.5 Controlling communication blocks 27
3.4 Ethernet communication with manual connection management
(automation solution B) 30


3.4.1 TCON 30
3.4.2 TSEND 31
3.4.3 TRCV 32
3.4.4 TDISCON 33
3.4.5 Controlling communication blocks 34
4 Code Elements 37
5 History 37


Automation Problem
Tasks

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 4

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

1 Automation Problem
1.1 Tasks
Data is to be transferred between two S7-1200 CPUs via Ethernet.
The task is divided into the following two cases.
Task A
Independently of the data type, data with a fixed data length is to be transferred
from one S7-1200 CPU (PLC 1) to another (PLC 2).
Task B
A dynamically changeable number of data elements is to be transferred from one
array of an S7-1200 CPU (PLC 1) to another (PLC 2).
1.2 Communication versions
For the data exchange, the S7-1200 offers the following

T communication blocks:
 TSEND_C and TRCV_C (with integrated connecting and disconnecting)
 TCON, TSEND, TRCV and TDISCON (with manual connecting and
disconnecting)
The S7-1200 supports the following Ethernet protocols:
 TCP native (RFC 793)
 ISO-on-TCP (RFC 1006)
The data can be transferred to the communication blocks with
 absolute or
 symbolic addressing.

Automation solution A
Using
 the T communication blocks with integrated
connection management (TSEND_C / TRCV_C)
 via TCP,
 2 bytes of absolutely addressed data
are sent from PLC 1 and received with PLC 2.
Automation Problem
Demo setup

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 5

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

Automation solution B
Using
 the T communication blocks with manual

connection management (TCON, TSEND, TRCV, TDISCON)
 via ISO-on-TCP
 1 array with 3 elements of symbolically addressed data
is sent from PLC 1 and received with PLC 2.
The S7-1200 compact controllers CPU 1214C are configured using the STEP7
Basic V10.5 programming user interface.
The configuration is explained and the function is demonstrated by the startup
code for each task.

1.3 Demo setup
Figure 1-1
PLC 1 PLC 2
Switch
STEP7
Basic V10.5
Power supply
1 2 43
5

9Figure 1-1 shows the basic configuration. The two communicating CPUs and the
programming unit with the “STEP7 Basic V10.5” software are connected to the
switch using Ethernet cables. For the list of components, please refer to chapter
1.4.
Automation Problem
List of components

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 6

Copyright  Siemens AG 2009 All rights reserved

39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

1.4 List of components
Siemens products
Table 1-1
Components No. MLFB/order number Note
1.
S7-1200 PM1207
POWER SUPPLY
1 6EP1332-1SH71
2. S7-1200 CPU1214C 1 6ES7214-1AE30-0XB0 DC/DC/DC
3.
CSM 1277
COMPACT SWITCH MODULE
1 6GK7277-1AA00-0AA0
4. S7-1200 CPU1214C 1 6ES7214-1HE30-0XB0 DC/DC/Relais
5. STEP 7 BASIC V10.5 1 6ES7822-0AA00-0YA0

Accessories
Table 1-2
Components No. Order number Note
1. PC/PG 1
With Ethernet
interface
2. RJ45 Ethernet patch cable 2 Specialist dealers

Automation Solution
Connection diagram

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200

V1.1, ID Number: 39040038 7

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

2 Automation Solution
2.1 Connection diagram
For the list of components, please refer to chapter 1.4.

Figure 2-1
L
N
PE
PG/PC
2
3
1
M PEL+M PEL+M PEL+
ML+
N PEL
LAN
P1
LAN
4
P2 P3

2.2 S7-1200 Ethernet communication
The S7-1200 T communication blocks allow simultaneous communication via
Ethernet up to 8 connections.


Protocol versions
The T communication blocks for Ethernet communication support the following
protocols:
 Transport Connection Protocol (TCP): Identification of the communication
partner using port addressing
 ISO Transport over TCP (ISO-on-TCP): Identification of the communication
partner via Transport Service Access Point (TSAP)
With both protocols, up to 8,192 bytes can be transferred per job.
The main difference between these protocol versions is that “ISO-on-TCP”
supports the transfer of dynamic data lengths, whereas TCP allows only static data
lengths.
Automation Solution
S7-1200 Ethernet communication

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 8

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

The following sections present the blocks with integrated and with manual
connection management on the basis of the tasks.

2.2.1 Integrated connection management (task A)
Ethernet communication with integrated connection management: Aside from the
send and receive function, each of the TSEND_C and TRCV_C blocks additionally
includes the functions for connecting and disconnecting.

Figure 2-2
Connection

data
Partner identification
TCP
PLC 1 (active)
Connect
Connection
data
Partner identification
TCP
IE port
TSEND_C
SFB
PLC 2 (passive)
IE port
Data
Disconnect
REQ
CONT
CONNECT
DATA
Send data
Start address
Data length
Receive
data
Start address
Data length
Send
Connect/disconnect
TRCV_C

SFB
EN_R
CONT
CONNECT
DATA
Receive
Connect/disconnect

1Figure 2-2 shows Ethernet communication with integrated connection management
for task A.
PLC 1 sends absolutely addressed data to PLC 2 via TCP (identification of the
communication partner using port addressing).
The connection is established via the CONT parameter.
The connection is established according to the server-client principle.
PLC 2 passively offers its service (server) and PLC 1 actively requests the
connection establishment (client).
After the connection has been successfully established, it is maintained.
The connection information is stored in one data block for TSEND_C and in one for
TRCV_C (addressed via the “CONNECT” parameter).
The IP address of the communication partner and the protocol to be used are
defined here.
On the side of the communication partner, the connection data is stored
accordingly.
Automation Solution
S7-1200 Ethernet communication

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 9

Copyright  Siemens AG 2009 All rights reserved

39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

When selecting a different protocol, this setting changes also in the connection
block of the communication partner, which requires a corresponding update of the
control program.
“TSEND_C” and “TRCV_C” are executed asynchronously via REQ or EN_R.
When executing a send job via a positive edge on REQ, it is not required that
“TRCV_C” be ready to receive (EN_R = 1) since the data is buffered.
The data can thus still be received by a later receive enable (set
“EN_R = 1”) (but only the last sent data).
The DATA parameter determines the data to be sent or the receive mailbox with
absolute start address and length.
By resetting the CONT parameter, the communication connection is terminated.
Automation Solution
S7-1200 Ethernet communication

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 10

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

2.2.2 Manual connection management (task B)
Ethernet communication with manual connection management: Data exchange via
the send block (“TSEND”) and the receive block (“TRCV”) requires connection
establishment with “TCON” and to terminate the connection, the “TDISCON” block
has to be executed on each communication side.

Figure 2-3
PLC 1 (active)

Connect
Connection
data
Partner identification
ISO-on-TCP
Connection ID
TSAP
TSEND
SFB
TCON
SFB
TDISCON
SFB
PLC 2 (passive)
Connection
data
Partner identification
ISO-on-TCP
Connection ID
TSAP
TRCV
SFB
TCON
SFB
TDISCON
SFB
Disconnect
Data
REQ
ID

LEN
DATA
ID
REQ
REQ
CONNECT
ID
REQ
CONNECT
ID
EN_R
ID
LEN
DATA
ID
REQ
Send data
Array
Receive data
Array
Connect
Send
Length
Disconnect
Connect
Disconnect
Receive
Length

1Figure 2-3 shows Ethernet communication with manual connection management for

task B.
PLC 1 sends symbolically addressed data to PLC 2 via ISO-on-TCP (identification
of the communication partner via TSAP).
At a positive edge on REQ, TCON attempts to establish a connection to the
communication partner (defined in the data block in “CONNECT”, identified by
“ID”).
After both communication partners have executed REQ, the connection is
established and maintained.
The connection information (communication partner, protocol selection and
connection ID) is stored in the connection data block (addressed via the
“CONNECT” parameter in the TCON connection block).
The send block (TSEND), the receive block (TRCV) and the TDISCON
disconnection block get the connection information only via the connection ID
assignment on the respective “ID” parameter for the connection data block.
Via a positive edge on “REQ”, TSEND sends the symbolically addressed “DATA”
data with the length “LEN” to the communication partner with the connection “ID”
(defined in the TCON connection block, “CONNECT” parameter).
The data is buffered.
Automation Solution
S7-1200 Ethernet communication

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 11

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

TRCV receives and stores the data in “DATA” when receive enable “EN_R”=“1”
from the communication partner with the connection “ID” (defined in the TCON
connection block, “CONNECT” parameter).

At a positive edge on “REQ”, TDISCON terminates the connection to the
communication partner with the parameterized connection “ID”.
TDISCON must be executed on the sender and on the receiver side.

2.2.3 Block parameterization
1Table 2-1 provides an overview of all parameters of the
T communication blocks of the S7-1200.
For more information, please refer to the S7-1200 system manual,
ID number 36932465, or to the STEP 7 Basic V10.5 help.

Automation Solution
S7-1200 Ethernet communication

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 12

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

Table 2-1
Para-
meter
type
Para-
meter
Data
type TSEND_C TRCV_C TCON TSEND TRCV TDISCON Description
EN_R BOOL x x
Ready to receive
(EN_REQ=1)

REQ BOOL x x x x Job execution (positive edge)
ID WORD x x x x
Connection ID (assignment to
the connection data via the
“CONNECT” parameter)
CONT BOOL x x
Connection control (0:
Terminate, 1: Establish and
maintain)
IN
LEN INT x x x x Data length in bytes
CONNECT ANY x x x
Pointer to
connection description
DATA ANY x x x x
Data area (send or receive
data with start address and
possibly length)
IN_OUT
COM_RST BOOL x x
Connection restart
(positive edge)
DONE BOOL x x x x x
NDR BOOL x
Done message
(DONE/NDR=1)
BUSY BOOL x x x x x x Busy message (BUSY=1)
ERROR BOOL x x x x x x Error message (ERROR=1)
STATUS WORD x x x x x x Block status
OUT

RCVD_LEN INT x x Received data length in bytes

Automation Solution
S7-1200 Ethernet communication

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 13

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

Saving the output parameters
The DONE, NDR, BUSY, ERROR, STATUS and RCVD_LEN output parameters
are updated cyclically and non-saving.
To check the communication, it is recommended to save these parameters.
In the sample programs, the status information is saved when an error message
occurs.
Figure 2-4

1Figure 2-4 shows the saving of STATUS when enabling the ERROR error output
for the TRCV_C receive block (MW6: TRCV_C_ERROR_STATUS).
When enabling the Done message for the TRCV_C and TRCV receive blocks, the
last received data lengths are also saved and each Done message is counted.
Figure 2-5

1Figure 2-5 shows the configuration of the TRCV_C_DONE_count Done message
counter and the last received data length TRCV_C_last_RCVD_LEN for the
TRCV_C block.
In addition, the BUSY messages per block are also counted.


Automation Solution
S7-1200 Ethernet communication

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 14

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

Figure 2-6


1Figure 2-6 shows the “TRCV_C_BUSY_count” Busy counter for the TRCV_C
block.
All saved values and counter contents can be reset using the “Reset” variable.

Figure 2-7

1Figure 2-7 shows the reset function for the TRCV_C block.
The RESET_edge edge trigger flag is used to reset the counter contents (see
1Figure 2-5 and 1Figure 2-6).
The reset function remains active for only once cycle.
Automation Solution
Data transfer

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 15

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc


2.3 Data transfer
The T communication blocks offer absolute or symbolic addressing of the “DATA”
data to be transferred.

2.3.1 Absolute addressing
Absolute addressing of data blocks requires that the “Symbolic access only”
property be unchecked when creating by selecting PLC ->
“Add new block” and “Data block” (see
1Figure 2-8).
Figure 2-8


Automation Solution
Data transfer

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 16

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

Figure 2-9


When addressing absolute, the pointer is transferred to the start address together
with the data length information on the "DATA" parameter.
Setting the "LEN" = "0" parameter is essential for absolute addressing.
The entry is either directly on the "DATA" block parameter as pointer or via the
instance block configuration (here: TSEND_C_DB) with details of data length. This

entry is then applied to the pointer representation.
1Table 2-2 shows which protocol supports which absolute data length transfer.

Table 2-2
Data length comparison
(TSEND_C/TSEND x TRCV_C/TRCV)
Protocol support
> TCP
< ISO-on-TCP
= TCP / ISO-on-TCP

Example:
Data transfers in which the absolute length of the data of the TSEND_C or TSEND
send data block to be transferred is larger than the receive mailbox size configured
on the TRCV_C or TRCV block are supported only by TCP. The absolute length
specification of the receive block limits the data to be transferred.
However, the TCP protocol can only transfer static lengths.
Dynamic length transfer is only possible via the symbolic addressing with the ISO-
on-TCP protocol.
Automation Solution
Data transfer

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 17

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

2.3.2 Symbolic addressing
Transfer of symbolically addressed data requires that the structures of send and

receive area match.
The setting of the data blocks (“Symbolic access only” or not) is irrelevant for
symbolic addressing.

Figure 2-10


As shown in
1Figure 2-10, the data block to be sent can be selected by double
clicking and opening the menu for the symbolic names via button.
You will get the menu for the elements by typing a dot (“.”) behind the symbolic
name of the data block.
The length of the data to be sent can be varied using the LEN parameter. The LEN
data length can be parameterized with a fixed value or a variable.
When modifying the length in bytes (LEN parameter), make sure that only whole
elements can be transmitted.
When LEN=0, the entire data area of the structure or array specified in DATA is
transferred.
When transferring arrays and structures, there is an additional option to
dynamically define the length on the TSEND_C or TSEND send block via the
variable assignment of LEN.
Automation Solution
Data transfer

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 18

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc


LEN=0 then has to be selected for the length of the TRCV_C or TRCV receive
block.
NOTE
For the dynamic data length transmission of structures (STRUCT data type) via
ISO-on-TCP protocol the receive area (DATA parameter of the receiving block
TRCV or TRCV_C) has to be a data block without the property “symbolic
access only”.


Configuration
Installing and wiring the hardware (automation solution A+B)

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 19

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

3 Configuration
3.1 Installing and wiring the hardware (automation
solution A+B)
Table 3-1
No. Instruction Note/picture
1.
Mount the power supply, the S7-1200 CPUs
and the switch on a DIN rail.

2.
Use RJ45 Ethernet cables to connect the
controllers and your programming unit to the

CSM 1277 switch.
See chapter “1Connection diagram”
3. Connect all ground connections to ground.
See chapter “1Connection diagram”
4.
Connect the controller and the CSM 1277
switch to the PM1207 24 V DC power supply.
See chapter “1Connection diagram”
5.
Connect the PM1207 power supply to the 230
V AC supply voltage.
See chapter “1Connection diagram”
6.
Install STEP 7 BASIC V10.5 on your
programming unit.


Configuration
Hardware / network configuration (automation solution A+B)

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 20

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

3.2 Hardware / network configuration (automation solution
A+B)
Table 3-2
No. Instruction Note/picture

1.
Open “SIMATIC STEP 7 Basic V10.5” by
selecting “Start” -> “Totally Integrated
Automation Portal V10”.

2.
Create a new project by specifying a
corresponding name and a directory and by
confirming with “Create”.

3.
Go to the “Devices & Networks” view and
select “Configure networks”.

4.
 To insert PLC 1 from the hardware
catalog, select “Unspecific CPU 1200”
with order number “6ES7 2XX-XXXX-
XXXX” with a double-click.
 Repeat this procedure to insert
PLC 2.
 Go to the Device view.

Configuration
Hardware / network configuration (automation solution A+B)

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 21

Copyright  Siemens AG 2009 All rights reserved

39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

No. Instruction Note/picture
5.
 Select “PLC_1” to detect the hardware
configuration.
 Detect the configuration of the connected
device using “detect”.

6.
 Select the desired CPU from the list of
accessible devices in the target subnet.
 For identification, compare the MAC
address or enable the LED flashing
indicator (“Flash LED”).
 Start hardware detection for “PLC_1” by
selecting “Load”.
 Repeat step 5 for “PLC_2” and step 6 with
the selection of the other accessible
device.

7.
Go to the Network view to set up the network
connection.

8.
Use drag-and-drop to connect the Ethernet
interfaces of the two CPUs.



Configuration
Ethernet communication with integrated connection management (automation solution A)

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 22

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

3.3 Ethernet communication with integrated connection
management (automation solution A)
3.3.1 Sender side
Table 3-3
No. Instruction Note/picture
1.
 Open the “Main [OB1]” operation block of
“PLC_1” in the
“Program Blocks” folder with a double-
click.
 In “Instructions” -> “Extended instructions”
-> “Communications”, open the “Open
user communication” folder and drag the
“TSEND_C” block to network 1.
 This automatically generates an instance
data block for the “TSEND_C” function
that you confirm with “OK”.

2.
The “Connection parameter(s)” of the
“TSEND_C_DB” instance data block open.

 Select “PLC_2” as a partner.
 As connection data of the partner, use
“<new>” to create a new data block
named “PLC_2_Connection_DB”.
 Select the “TCP” connection type.

3.
Create a source data block for “PLC_1” as
follows:
 “Add new block”
 Select “Data block”
 Assign a name (here: “Source”)
 Uncheck “Symbolic access only”
 Confirm with “OK”.

4.
In the “Source” data block, create the data to
be sent (here: “Byte” and “Char”) with name,
data type and initial value.

Configuration
Ethernet communication with integrated connection management (automation solution A)

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 23

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

No. Instruction Note/picture

5. Parameterize the “TSEND_C” send block.
For data blocks without “Symbolic access
only” and “LEN” = “0”, you can specify the
“DATA” data to be sent as a pointer and
length.
 Double-click on “TSEND_C” to open the
“TSEND_C_DB” data block.
 Navigate to the entry of DATA by
selecting “Configuration” ->
“Block parameter” -> “Properties”.
 Initialize the pointer of the “DATA” send
mailbox with the start address of the
“Source” data block (“P#DB3.DBX0.0”)
and the length “2 BYTE”.


3.3.2 Receiver side
Table 3-4
No. Instruction Note/picture
1.
 Open the “Main [OB1]” operation block of
“PLC_2” in the
“Program Blocks” folder with a double-
click.
 In “Instructions” -> “Extended instructions”
-> “Communications”, open the “Open
user communication” folder and drag the
“TRCV_C” block to network 1.
 This automatically generates an instance
data block for the “TRCV_C” function.

Please confirm with “OK”.

2.
The “Connection parameter(s)” of the
“TRCV_C_DB” instance data block open.
Select “PLC_1” as a partner, the
“PLC_1_Connection_DB” data block as
connection data of the partner and the “TCP”
connection type.

3.
Create a destination data block for “PLC_2” as
follows:
 “Add new block”
 Select “Data block”
 Assign a name (here: “Dest”)
 Uncheck “Symbolic access only” also here
and confirm with “OK”.

Configuration
Ethernet communication with integrated connection management (automation solution A)

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 24

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

No. Instruction Note/picture
4.

In the “Dest” data block, create the data to be
received with name, data type (here “Word”)
(we transfer the “Byte” and “Char” send data to
a word).

5. Parameterize the “TRCV_C” receive block.
 Also here, the “LEN” data length
parameter must be “0”.
 Initialize the pointer of the “DATA” data
reception with the start address of the
“Dest” receive block and the length of one
word (“P#DB3.DBX0.0 WORD 1”).
Configuration
Ethernet communication with integrated connection management (automation solution A)

Ethernet Communication: Data Exchange S7-1200 <-> S7-1200
V1.1, ID Number: 39040038 25

Copyright  Siemens AG 2009 All rights reserved
39040038_CE-X17_EthernetCom_S7-1200_S7-1200_v1d1_en.doc

3.3.3 Downloading the overall project
Table 3-5
No. Instruction Note/picture
1.
 Open the Network view.
 Select both controllers.
 Right-click and select
“Download to device” -> “All” to download
the overall project to the controllers.


2.
 Enable the display of all accessible
devices.
 Select one of the displayed controllers
and use the “Load” button.
The program blocks for both controllers are
successively downloaded. Therefore the
selection of the CPU is irrelevant here.

3.
Communication requires that the IP address of
the PG/PC be in the same subnet as the
controllers.
You can assign such an IP in STEP 7 Basic
V10.5.
To assign a corresponding IP address, confirm
this message with “Yes”.

4.
The IP address assignment of the PG/PC is
confirmed.
Close this message with “OK”.

5.
After transferring all program blocks to the two
controllers, a “Load results” window appears.
 Select the “Start all” fields to set both
controllers to “Run” mode.
 Exit the download by selecting “Finish”.



×