Sei sulla pagina 1di 34

Application example  05/2016

Line Integration at the


Food & Beverage Industry -
Plant Communication Concept
Interface description based on OPEN IE Communication

https://support.industry.siemens.com/cs/ww/en/view/98278624
Warranty and liability

Warranty and liability

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 used correctly. These Application Examples do not
relieve you of the responsibility to use safe practices in application, installation,
operation and maintenance. 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 – 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
 Siemens AG 2016 All rights reserved

deficiency or breach of a condition which goes to the root of the contract


(“wesentliche Vertragspflichten”). The damages for a breach of a substantial
contractual obligation are, however, limited to the foreseeable damage, typical for
the type of contract, except in the event of intent or gross negligence or injury to
life, body or health. The above provisions do not imply a change of the burden of
proof to your detriment.
Any form of duplication or distribution of these Application Examples or excerpts
hereof is prohibited without the expressed consent of the Siemens AG.

Security Siemens provides products and solutions with industrial security functions that
informa- support the secure operation of plants, systems, machines and networks.
tion In order to protect plants, systems, machines and networks against cyber
threats, it is necessary to implement – and continuously maintain – a holistic,
state-of-the-art industrial security concept. Siemens’ products and solutions only
form one element of such a concept.
Customer is responsible to prevent unauthorized access to its plants, systems,
machines and networks. Systems, machines and components should only be
connected to the enterprise network or the internet if and to the extent necessary
and with appropriate security measures (e.g. use of firewalls and network
segmentation) in place.
Additionally, Siemens’ guidance on appropriate security measures should be
taken into account. For more information about industrial security, please visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them
more secure. Siemens strongly recommends to apply product updates as soon
as available and to always use the latest product versions. Use of product
versions that are no longer supported, and failure to apply latest updates may
increase customer’s exposure to cyber threats.
To stay informed about product updates, subscribe to the Siemens Industrial
Security RSS Feed under http://www.siemens.com/industrialsecurity.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 2
Table of contents

Table of contents
Warranty and liability ................................................................................................... 2
1 Introduction ........................................................................................................ 4
1.1 CPU-CPU Communication ................................................................... 4
2 Open User Communication .............................................................................. 5
2.1 Instructions for Open User Communication ......................................... 5
2.2 Required knowledge............................................................................. 5
3 Automation Task ................................................................................................ 6
4 Configuration of passive partners (Machine PLCs) ....................................... 7
4.1 Configure PLC in STEP7 (S7-300/400) ............................................... 7
4.2 Configure PLC in TIA Portal (S7-300/400) ......................................... 10
4.3 Configure PLC in TIA Portal (S7-1500) .............................................. 14
4.4 Configure PLC in TIA Portal (S7-1200) .............................................. 17
5 Configuration of active partners (Central PLC/LCU) ................................... 21
5.1 Configure PLC in STEP7 (S7-300/400) ............................................. 21
5.2 Configure PLC in TIA Portal (S7-300/400) ......................................... 24
5.3 Configure PLC in TIA Portal (S7-1500) .............................................. 28
6 Demo projects .................................................................................................. 31
 Siemens AG 2016 All rights reserved

6.1 ET 200S CPU as Active Partner ........................................................ 31


6.2 S7-1516 CPU as Active Partner ......................................................... 32
7 Abbreviations ................................................................................................... 33
8 Related literature ............................................................................................. 34
9 History............................................................................................................... 34

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 3
1 Introduction

1 Introduction
1.1 CPU-CPU Communication
To realize CPU-CPU communication over Ethernet Networks different options are
available for the users. To select a best solution depends on various factors. Based
on these factors a solution can be selected. Using Ethernet networks it is possible
to use:
– S7-Communication
– Open Communication (e.g. TCP/IP, UDP)
– PROFINET Data Record and IO Communication using I-Device
– OPC Server
– …
Depending on the chosen communication protocol different functions and
mechanisms on the PLCs have to be used.

NOTE This application example is making use of the PLC’s integrated PROFINET
Interface (for S7-1500 also on other PN-Interfaces). For communication over
other interfaces please ask your Siemens F&B contact or the online support
team.
 Siemens AG 2016 All rights reserved

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 4
2 Open User Communication

2 Open User Communication


Open User Communication is the name given to a program-controlled
communication process for communicating via the integrated PN/IE interface of the
S7-1200/1500 and S7-300/400 PLCs. Different connection types are available for
this communication process.
The main feature of Open User Communication is its high degree of flexibility in
terms of the data structures transferred. This allows open data exchange with any
communicating devices providing they support the connection types available here.
Since this communication is controlled solely by instructions in the user program,
event-driven connection establishment and termination is possible. Connections
can also be modified by the user program during runtime.
For CPUs with an integrated PN/IE interface, the TCP, UDP, and ISO-on-TCP
connection types are available for Open User Communication. The communication
partners can be two SIMATIC PLCs or a SIMATIC PLC/SIMOTION and a suitable
third-party device.

2.1 Instructions for Open User Communication


Individual instructions for sending and receiving data or for establishing or
terminating connections:
 TCON (connection establishment)
 Siemens AG 2016 All rights reserved

 TDISCON (connection termination)


 TSEND (TCP or ISO-on-TCP: Sending)
 TRCV (TCP or ISO-on-TCP: Receiving)

Connection establishment
For Open User Communication, instructions for establishing and terminating the
connection must exist for both communication partners. One communication
partner sends its data using TSEND while the other communication partner
receives the data using TRCV.
One of the communication partners starts the connection establishment as the
active partner. The other communication partner reacts by starting its connection
establishment as the passive partner. If both communication partners have initiated
their connection establishment, the communication connection is fully established.

Connection configuration
For each connection establishment, a connection description DB with the
TCON_Param must be configured. This data structure contains the parameters
necessary for configuring the connection between the user program and the
communications level of the operating system.
You can manually create, assign parameters and write directly to the instruction
connection description DB or using Open TCP wizard.

2.2 Required knowledge


It is assumed that the reader has a basic knowledge about configuring SIMATIC
and/or SIMOTION controllers using the STEP7 or SIMOTION SCOUT engineering
system.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 5
3 Automation Task

3 Automation Task
Overview of the automation task

SIMATIC IO-Controller
S7-400
S7-1500
S7-300

PDI PDI PDI

PROFINET

S7-400 D445
S7-1500
S7-300

PDI PDI PDI PDI


 Siemens AG 2016 All rights reserved

SIMATIC I-Device SIMOTION I-Device

Description of the automation task


The PDI Interface DB must be exchanged between central PLC and machine PLCs
via Open IE communication. Depending on the PDI interface configured the
corresponding DB areas are read and written respectively.
Central PLC initiate the connection establishment as an active partner and the
machine PLCs reacts to the request and the connection will be established. Once
the connection is established the PDI IF data can be exchanged between central
PLCs and machine PLCs.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 6
4 Configuration of passive partners (Machine PLCs)

4 Configuration of passive partners


(Machine PLCs)
Assigning parameters for communication connections with ISO-on-TCP
To be able to assign parameters for ISO-on-TCP for communication connections, a
DB that contains the data structure "TCON_PAR" is required. This data structure
contains the parameters necessary for configuring the connection. You will need
such a data structure for every connection. Connection establishment will be
initiated from active partner (central PLC/LCU).

4.1 Configure PLC in STEP7 (S7-300/400)


Data block for assigning parameters of passive partner
1. Open “PCC_V2_0” library and copy “TCON_PARA_DB” data block and
“TCON_CONFIG_ISOonTCP” function into your project. This function allows
you to configure the connection parameters in the data structure
“TCON_PARA_DB”.
 Siemens AG 2016 All rights reserved

2. Configure connection parameters.


Sample code for configuring “TCON_PARA_DB” is programmed in FC4000.
The parameters below must be adapted by the user:
– id  Reference to the connection (range of values: W#16#0001 to
W#16#0FFF). For each configured connection the ID must be unique
– active_est  False for passive connection establishment
– local_device_id  Based on CPU/CP type the local_device_id must be
adapted. Possible values.
 B#16#00: Communication via CP 443-1EX (only with S7-400 and
connection_type = B#16#12) Permitted CPs: CP443-1EX4x, CP443-
1EX20, CP443-1GX20, CP443-1EX30, CP443-1GX30
 B#16#01: Communication over the integrated IE interface with
IM151-8 PN/DP CPU, Communication via IE interface on interface
slot 1 (IF1) for WinAC RTX
 B#16#02: Communication over the integrated IE interface with
CPUs 315-2 PN/DP and 317-2 PN/DP

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 7
4 Configuration of passive partners (Machine PLCs)

 B#16#03: Communication via the integrated IE interface for CPU


319-3 PN/DP
 B#16#05: Communication via the integrated IE interface with CPUs
414-3 PN/DP, 416-3 PN/DP, 416-3F PN/DP
 B#16#06: Communication via IE interface on interface slot 2 (IF2),
B#16#0B: slot 3 (IF3), B#16#0F: slot 4 (IF4) for WinAC RTX or
IM151-8 PN/DP CPU
– local_tsap_id and rem_tsap_id
 All character strings with a length between 0 and 16 bytes are
permitted. Each character can have a value between B#16#00 and
B#16#FF
 In this case, local_tsap_id_len and rem_tsap_id_len are 3 bytes
st nd
long. The 1 byte E0 (connection type T connection), 2 byte rack
and slot of the local CPU (bits 0 to 4 slot, bits 5 to 7 rack number),
rd
3 byte is TSAP extension
In case of S7-300/400 controllers the TSAP-ID is : E0.02.49
In case of S7-1200/1500 controllers the TSAP-ID is : E0.01.49

NOTE Depend on the CPU type only the 2nd byte must be changed. If there are
multiple connections to the same communication partner, you have to ensure
 Siemens AG 2016 All rights reserved

that each value of local_tsap_id that you use in your CPU is unique.

– rem_staddr
 IP address of the partner (Central CPU/ LCU), for e.g. 10.20.130.20
3. After making changes to the function FC4000, save the function.
4. Call the function in OB1 and download PDI IF DB and FC4000 into PLC.

Configuration for data transfer


1. Open “PCC_V2_0” library and copy all the marked FBs into your project. The
function block FB500 (PCC_TCM) allows you to exchange the PDI interface to
central PLC/LCU via Open IE Communication.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 8
4 Configuration of passive partners (Machine PLCs)

2. Instance FB 500 with a data block and configure FB500 for PDI interface data
block transfer with central PLC/LCU.

Parameter Declaration Data Description


Type
Enable IN Bool 1= Enable data transfer
PWA_TYPE IN Int 1=PDI_BAISC, 2=PDI_LCU, 3=PDI,
4 = PDI_BASIC_OMACv2, 5 = PDI_LCU_OMACv2,
6 = PDI_PEC_OMACv2, 7 = PDI_Para_OMACv2,
8 = PDI_BASIC_WS, 9 = PDI_LCU_WS,
10 = PDI_PEC_WS, 11 = PDI_Para_WS
DBNR IN Int Number PDI Machine Interface DB
TCON_DBNR IN Int Number TCON Configuration DB
TLastCYCLE IN Int last cycle time of OB1
Call_Cycle IN Int Call cycle for Read Write PDI
RESET IN Bool RESET
QERROR OUT Bool Error
QERR_ST OUT Word Error Status
QCON OUT Bool 1= Connection ok
 Siemens AG 2016 All rights reserved

3. Save and download the user program into PLC. To initiate data transfer the
input ENABLE must be set to true.

NOTE To establish connection the active partner (central PLC/LCU) must be


configured. Once the connection is established the PDI interface DB information
can be exchanged.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 9
4 Configuration of passive partners (Machine PLCs)

4.2 Configure PLC in TIA Portal (S7-300/400)


Data Block for Assigning Parameters of Passive partner

1. Open “PCC_V2_0” library and copy “TCON_PARA_DB” data block and


“TCON_CONFIG_ISOonTCP” function into your project. This function allows
you to configure the connection parameters in the data structure
“TCON_PARA_DB”.
 Siemens AG 2016 All rights reserved

2. Configure connection parameters.


Sample code for configuring “TCON_PARA_DB” is programmed in FC4000.
The below parameters must be adapted by the user.
– id  Reference to the connection (range of values: W#16#0001 to
W#16#0FFF). For each configured connection the ID must be unique
– active_est  false for passive connection establishment
– local_device_id  Based on CPU/CP type the local_device_id must be
adapted. Possible values:
 B#16#00: Communication via CP 443-1EX (only with S7-400 and
connection_type = B#16#12) Permitted CPs: CP443-1EX4x, CP443-
1EX20, CP443-1GX20, CP443-1EX30, CP443-1GX30
 B#16#01: Communication over the integrated IE interface with
IM151-8 PN/DP CPU, Communication via IE interface on interface
slot 1 (IF1) for WinAC RTX

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 10
4 Configuration of passive partners (Machine PLCs)

 B#16#02: Communication over the integrated IE interface with


CPUs 315-2 PN/DP and 317-2 PN/DP
 B#16#03: Communication via the integrated IE interface for CPU
319-3 PN/DP
 B#16#05: Communication via the integrated IE interface with CPUs
414-3 PN/DP, 416-3 PN/DP, 416-3F PN/DP
 B#16#06: Communication via IE interface on interface slot 2 (IF2),
B#16#0B: slot 3 (IF3), B#16#0F: slot 4 (IF4) for WinAC RTX or
IM151-8 PN/DP CPU
– local_tsap_id and rem_tsap_id
 All character strings with a length between 0 and 16 bytes are
permitted. Each character can have a value between B#16#00 and
B#16#FF
 In this case, local_tsap_id_len and rem_tsap_id_len are 3 bytes
st nd
long. The 1 byte E0 (connection type T connection), 2 byte rack
and slot of the local CPU (bits 0 to 4 slot, bits 5 to 7 rack number),
rd
3 byte is TSAP extension
In case of S7-300/400 controllers the TSAP-ID is : E0.02.49
In case of S7-1200/1500 controllers the TSAP-ID is : E0.01.49
 Siemens AG 2016 All rights reserved

NOTE Depend on the CPU type only the 2nd byte must be changed. If there are
multiple connections to the same communication partner, you have to ensure
that each value of local_tsap_id that you use in your CPU is unique.

– rem_staddr
 IP address of the partner (Central CPU/ LCU), for e.g. 10.20.130.20
3. After making changes to the function FC4000, save the function.
4. Call the function in OB1 and download PDI IF DB and FC4000 into PLC

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 11
4 Configuration of passive partners (Machine PLCs)

Configuration for data transfer


5. Open “PCC_V2_0” library. Drag and Drop the FB “PCC_TCC” on to a Network
in OB1. The system automatically assigns the free available DB. The function
block FB500 (PCC_TCM) allows you to exchange the PDI interface to central
PLC/LCU via Open IE Communication.
 Siemens AG 2016 All rights reserved

6. Configure FB500 to transfer with central PLC/LCU.

Parameter Declaration Data Type Description


Enable IN Bool 1= Enable data transfer
PDI_TYPE IN Int 1=PDI_BAISC, 2=PDI_LCU, 3=PDI,
4 = PDI_BASIC_OMACv2, 5 = PDI_LCU_OMACv2,
6 = PDI_PEC_OMACv2, 7 = PDI_Para_OMACv2,
8 = PDI_BASIC_WS, 9 = PDI_LCU_WS,
10 = PDI_PEC_WS, 11 = PDI_Para_WS
PDI_DBNR IN Int Number PDI Machine Interface DB
TCON_DBNR IN Int Number TCON Configuration DB
TLastCYCLE IN Int last cycle time of OB1
Call_Cycle IN Int Call cycle for Read Write PDI
RESET IN Bool RESET
QERROR OUT Bool Error
QERR_ST OUT Word Error Status
QCON OUT Bool 1= Connection ok

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 12
4 Configuration of passive partners (Machine PLCs)

Figure 4-1
 Siemens AG 2016 All rights reserved

7. Save and download the user program into PLC. To initiate data transfer the
input ENABLE must be set to true.

NOTE To establish connection the active partner (central PLC/LCU) must be


configured. Once the connection is established the PDI interface DB information
can be exchanged.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 13
4 Configuration of passive partners (Machine PLCs)

4.3 Configure PLC in TIA Portal (S7-1500)


Data Block for Assigning Parameters of Passive partner
8. Open “PCC_V2_0” library and copy “TCON_PARA_DB” data block and
“TCON_CONFIG_ISOonTCP” function into your project. This function allows
you to configure the connection parameters in the data structure
“TCON_PARA_DB”.

Figure 4-2
 Siemens AG 2016 All rights reserved

9. Configure connection parameters.


Sample code for configuring “TCON_PARA_DB” is programmed in FC4000.
The below parameters must be adapted by the user
– interfaceId  Hardware identifier of the local PN interface (value range: 0
to 65535). Default value is 64 will be assigned from system. For use of
another S7-1500 Ethernet Interface change the interfaceID according to
the HW-ID in the Hardware Configuration.
– active_est  false for passive connection establishment
– id  Reference to the connection (range of values: W#16#0001 to
W#16#0FFF). For each configured connection the ID must be unique
– localTSelector and remoteTSelector
 All character strings with a length between 0 and 16 bytes are
permitted. Each character can have a value between B#16#00 and
B#16#FF

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 14
4 Configuration of passive partners (Machine PLCs)

 In this case, localTSelctorLength and remoteTSelctorLength are 3


st nd
bytes long. The 1 byte E0 (connection type T connection), 2 byte
rack and slot of the local CPU (bits 0 to 4 slot, bits 5 to 7 rack
rd
number), 3 byte is TSAP extension
 In case of S7-300/ 400 controllers the TSAP-ID is : E0.02.49
 In case of S7-1200/ 1500 controllers the TSAP-ID is : E0.01.49

NOTE Depend on the CPU type only the 2nd byte must be changed. If there are
multiple connections to the same communication partner, you have to ensure
that each value of local_tsap_id that you use in your CPU is unique.

– rem_staddr
 IP address of the partner (Central CPU/ LCU), for e.g. 10.20.130.20
10. After making changes to the function FC4000, save the function

Configuration for data transfer


1. Open “PCC_V2_0” library. Drag and Drop the FB “PCC_TCC” on to a Network
in OB1. The system automatically assigns the free available DB. The function
 Siemens AG 2016 All rights reserved

block FB500 (PCC_TCM) allows you to exchange the PDI interface to central
CPU/LCU via Open IE Communication

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 15
4 Configuration of passive partners (Machine PLCs)

2. Configure FB500 to transfer with central PLC/LCU.

Parameter Declaration Data Description


Type
Enable In Bool 1= Enable data transfer
PDI_TYPE In Int 1=PDI_BAISC, 2=PDI_LCU, 3=PDI,
4 = PDI_BASIC_OMACv2,
5 = PDI_LCU_OMACv2,
6 = PDI_PEC_OMACv2, 7 = PDI_Para_OMACv2,
8 = PDI_BASIC_WS, 9 = PDI_LCU_WS,
10 = PDI_PEC_WS, 11 = PDI_Para_WS
DBNR In Int Number PDI Machine Interface DB
TCON_DBNR In Int Number TCON Configuration DB
TLastCYCLE In Int last cycle time of OB1
Call_Cycle In Int Call cycle for Read Write PDI
RESET In Bool RESET
QERROR Output Bool Error
TCON_CONNECT_DB In/Out Variant TCON connection parameter DB
QERR_ST Out Word Error Status
QCON Out Bool 1= Connection ok
 Siemens AG 2016 All rights reserved

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 16
4 Configuration of passive partners (Machine PLCs)

3. Save and download the user program into PLC. To initiate data transfer the
input ENABLE must be set to true.

NOTE To establish connection the active partner (central PLC/LCU) must be


configured. Once the connection is established the PDI interface DB information
can be exchanged.

4.4 Configure PLC in TIA Portal (S7-1200)


Data Block for Assigning Parameters of Passive partner
1. Open “PCC_V2_0” library and copy “TCON_PARA_DB” data block and
“TCON_CONFIG_ISOonTCP” function into your project. This function allows
you to configure the connection parameters in the data structure
“TCON_PARA_DB”.
 Siemens AG 2016 All rights reserved

2. Configure connection parameters


Sample code for configuring “TCON_PARA_DB” is programmed in FC4000.
The below parameters must be adapted by the user.
– interfaceId  Hardware identifier of the local PN interface (value range: 0
to 65535). Default value is 64 will be assigned from system
– active_est  false for passive connection establishment
– id  Reference to the connection (range of values: W#16#0001 to
W#16#0FFF). For each configured connection the ID must be unique
– local_tsap_id and rem_tsap_id

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 17
4 Configuration of passive partners (Machine PLCs)

 All character strings with a length between 0 and 16 bytes are


permitted. Each character can have a value between B#16#00 and
B#16#FF
 In this case, local_tsap_id_len and rem_tsap_id_len are 3 bytes
st nd
long. The 1 byte E0 (connection type T connection), 2 byte rack
and slot of the local CPU (bits 0 to 4 slot, bits 5 to 7 rack number),
rd
3 byte is TSAP extension
In case of S7-300/400 controllers the TSAP-ID is : E0.02.49
In case of S7-1200/1500 controllers the TSAP-ID is : E0.01.49

NOTE Depend on the CPU type only the 2nd byte must be changed. If there are
multiple connections to the same communication partner, you have to ensure
that each value of local_tsap_id that you use in your CPU is unique.

– rem_staddr
 IP address of the partner (Central CPU/ LCU), for e.g. 10.20.130.20
3. After making changes to the function FC4000, save the function.
 Siemens AG 2016 All rights reserved

Configuration for data transfer


1. Open “PCC_V2_0” library. Drag and Drop the FB “PCC_TCC” on to a Network
in OB1. The system automatically assigns the free available DB. The function
block FB500 (PCC_TCM) allows you to exchange the PDI interface to central
CPU/LCU via Open IE Communication.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 18
4 Configuration of passive partners (Machine PLCs)

2. Configure FB500 to transfer with central PLC/LCU.

Parameter Declaration Data Type Description


Enable In Bool 1= Enable data transfer
PDI_TYPE In Int 1=PDI_BAISC, 2=PDI_LCU, 3=PDI,
4 = PDI_BASIC_OMACv2,
5 = PDI_LCU_OMACv2,
6 = PDI_PEC_OMACv2,
7 = PDI_Para_OMACv2,
8 = PDI_BASIC_WS, 9 = PDI_LCU_WS,
10 = PDI_PEC_WS, 11 = PDI_Para_WS
TCON_DBNR In Int Number TCON Configuration DB
TLastCYCLE In Int last cycle time of OB1
Call_Cycle In Int Call cycle for Read Write PDI
PDI_IF_S In/Out Variant PDI IF send (status + admin) area as pointer
PDI_IF_R In/Out Variant PDI IF receive area (command) as pointer
TCON_CONNECT_DB In/Out TCON_Param Tcon connection parameter DB
RESET In/Out Bool RESET
QERROR Out Bool Error
QERR_ST Out Word Error Status
 Siemens AG 2016 All rights reserved

QCON Out Bool 1= Connection ok

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 19
4 Configuration of passive partners (Machine PLCs)

3. Possible values for PDI_IF_S and PDI_IF_S input pointers.

Table 4-1 For V1 PDI


PDI IF Type Pointer PDI_IF_S Pointer PDI_IF_R Description
PDI_BASIC P#DBNr.DBX0.0 BYTE 52 P#DBNr.DBX0.0 BYTE 52 Status & Admin (52
Bytes)
PDI_LCU P#DBNr.DBX14.0 BYTE 22 P#DBNr.DBX0.0 BYTE 14 Command (14 Bytes),
Status (22 Bytes)
PDI P#DBNr.DBX14.0 BYTE 74 P#DBNr.DBX0.0 BYTE 14 Command (14 Bytes),
Status & Admin (74
Bytes)

Table 4-2 For OMAC PDI according to V2


PDI IF Type Pointer PDI_IF_S Pointer PDI_IF_R Description
PDI_BASIC_OMACv2 P#DBNr.DBX0.0 BYTE 88 P#DBNr.DBX0.0 BYTE Status & Admin (88
88 Bytes)
PDI_LCU_OMACv2 P#DBNr.DBX18.0 BYTE 39 P#DBNr.DBX0.0 BYTE Command (18
18 Bytes), Status (39
Bytes)
PDI_PEC_OMACv2 P#DBNr.DBX0.0 BYTE 124 P#DBNr.DBX0.0 BYTE Status & Admin (124
 Siemens AG 2016 All rights reserved

124 Bytes)
PDI_Para_OMACv2 P#DBNr.DBX0.0 BYTE 148 P#DBNr.DBX0.0 BYTE Status & Admin (148
148 Bytes)

Table 4-3 For Weihenstephan PDI


PDI IF Type Pointer PDI_IF_S Pointer PDI_IF_R Description
PDI_BASIC_WS P#DBNr.DBX0.0 BYTE 88 P#DBNr.DBX0.0 BYTE Status & Admin (88
88 Bytes)
PDI_LCU_WS P#DBNr.DBX18.0 BYTE 39 P#DBNr.DBX0.0 BYTE Command (24
18 Bytes), Status (44
Bytes)
PDI_PEC_WS P#DBNr.DBX0.0 BYTE 124 P#DBNr.DBX0.0 BYTE Status & Admin (124
124 Bytes)
PDI_Para_WS P#DBNr.DBX0.0 BYTE 140 P#DBNr.DBX0.0 BYTE Status & Admin (140
140 Bytes)

4. Save and download the user program into CPU. To initiate the data transfer
input ENABLE must be set to true.

NOTE To establish connection the active partner (central PLC/LCU) must be


configured. Once the connection is established the PDI interface DB information
can be exchanged.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 20
5 Configuration of active partners (Central PLC/LCU)

5 Configuration of active partners


(Central PLC/LCU)
Assigning Parameters for Communications Connections with ISO-on-TCP
To be able to assign parameters for ISOonTCP for communication connections, a
DB that contains the data structure "TCON_PAR" is required. This data structure
contains the parameters necessary for configuring the connection. You will need
such a data structure for every connection. Connection establishment will be
initiated by active partner (central PLC/LCU) and passive partner reacts to the
request sent from active partner. If the request is successful the connection is
established.

5.1 Configure PLC in STEP7 (S7-300/400)


Data Block for Assigning Parameters of Active partner
1. Open “PCC_V2_0” library and copy “TCON_PARA_DB” data block and
“TCON_CONFIG_ISOonTCP” function into your project. This function allows
you to configure the connection parameters in the data structure
“TCON_PARA_DB”.
 Siemens AG 2016 All rights reserved

Figure 5-1

2. Configure connection parameters.


Sample code for configuring “TCON_PARA_DB” is programmed in FC4000.
The below parameters must be adapted by the user.
– id  Reference to the connection (range of values: W#16#0001 to
W#16#0FFF). For each configured connection the ID must be unique.
– active_est  True for active connection establishment.
– local_device_id  Based on CPU/CP type the local_device_id must be
adapted. Possible values:
 B#16#00: Communication via CP 443-1EX (only with S7-400 and
connection_type = B#16#12) Permitted CPs: CP443-1EX4x, CP443-
1EX20, CP443-1GX20, CP443-1EX30, CP443-1GX30
 B#16#01: Communication over the integrated IE interface with
IM151-8 PN/DP CPU, Communication via IE interface on interface
slot 1 (IF1) for WinAC RTX
 B#16#02: Communication over the integrated IE interface with
CPUs 315-2 PN/DP and 317-2 PN/DP

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 21
5 Configuration of active partners (Central PLC/LCU)

 B#16#03: Communication via the integrated IE interface for CPU


319-3 PN/DP
 B#16#05: Communication via the integrated IE interface with CPUs
414-3 PN/DP, 416-3 PN/DP, 416-3F PN/DP
 B#16#06: Communication via IE interface on interface slot 2 (IF2),
B#16#0B: slot 3 (IF3), B#16#0F: slot 4 (IF4) for WinAC RTX or
IM151-8 PN/DP CPU
– local_tsap_id and rem_tsap_id
 All character strings with a length between 0 and 16 bytes are
permitted. Each character can have a value between B#16#00 and
B#16#FF
 In this case, local_tsap_id_len and rem_tsap_id_len are 3 bytes
st nd
long. The 1 byte E0 (connection type T connection), 2 byte rack
and slot of the local CPU (bits 0 to 4 slot, bits 5 to 7 rack number),
rd
3 byte is TSAP extension
In case of S7-300/ 400 controllers the TSAP-ID is: E0.02.49
In case of S7-1200/ 1500 controllers the TSAP-ID is: E0.01.49

NOTE Depend on the CPU type only the 2nd byte must be changed. If there are
multiple connections to the same communication partner, you have to ensure
 Siemens AG 2016 All rights reserved

that each value of local_tsap_id that you use in your CPU is unique.

– rem_staddr
 IP address of the partner (Central CPU/ LCU), for e.g. 10.20.130.20
3. After making changes to the function FC4000, save the function.
4. Call the function in OB1 and download the blocks into PLC.

Configuration for data transfer


1. Open “PCC_V2_0” library and copy all the marked FBs into your project. The
function block FB501 (PCC_TCC) allows you to exchange the PDI interface to
central CPU/LCU via Open IE Communication.

5. Instance FB 501 with a data block.


6. Configure FB501 for PDI interface data block transfer with machine PLCs.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 22
5 Configuration of active partners (Central PLC/LCU)

Parameter Declaration Data Type Description


Enable IN Bool 1= Enable data transfer
PWA_TYPE IN Int 1=PDI_BAISC, 2=PDI_LCU, 3=PDI,
4 = PDI_BASIC_OMACv2, 5 = PDI_LCU_OMACv2,
6 = PDI_PEC_OMACv2, 7 = PDI_Para_OMACv2,
8 = PDI_BASIC_WS, 9 = PDI_LCU_WS,
10 = PDI_PEC_WS, 11 = PDI_Para_WS
DBNR IN Int Number PDI Machine Interface DB
TCON_DBNR IN Int Number TCON Configuration DB
TLastCYCLE IN Int last cycle time of OB1
Call_Cycle IN Int Call cycle for Read Write PDI
RESET IN Bool RESET
QERROR OUT Bool Error
QERR_ST OUT Word Error Status
QCON OUT Bool 1= Connection ok
 Siemens AG 2016 All rights reserved

7. Save and download the user program into PLC. To initiate data transfer the
input ENABLE must be set to true.

NOTE To establish connection the passive partner (machine PLC) must be configured.
Once the connection is established the PDI interface DB information can be
exchanged.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 23
5 Configuration of active partners (Central PLC/LCU)

5.2 Configure PLC in TIA Portal (S7-300/400)


Data Block for Assigning Parameters of Active partner
1. Open “PCC_V2_0” library and copy “TCON_PARA_DB” data block and
“TCON_CONFIG_ISOonTCP” function into your project. This function allows
you to configure the connection parameters in the data structure
“TCON_PARA_DB”.
 Siemens AG 2016 All rights reserved

2. Configure connection parameters.


Sample code for configuring “TCON_PARA_DB” is programmed in FC4000.
The below parameters must be adapted by the user.
– id  Reference to the connection (range of values: W#16#0001 to
W#16#0FFF). For each configured connection the ID must be unique
– active_est  True for active connection establishment
– local_device_id  Based on CPU/CP type the local_device_id must be
adapted. Possible values
 B#16#00: Communication via CP 443-1EX (only with S7-400 and
connection_type = B#16#12) Permitted CPs: CP443-1EX4x, CP443-
1EX20, CP443-1GX20, CP443-1EX30, CP443-1GX30
 B#16#01: Communication over the integrated IE interface with
IM151-8 PN/DP CPU, Communication via IE interface on interface
slot 1 (IF1) for WinAC RTX
 B#16#02: Communication over the integrated IE interface with
CPUs 315-2 PN/DP and 317-2 PN/DP

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 24
5 Configuration of active partners (Central PLC/LCU)

 B#16#03: Communication via the integrated IE interface for CPU


319-3 PN/DP
 B#16#05: Communication via the integrated IE interface with CPUs
414-3 PN/DP, 416-3 PN/DP, 416-3F PN/DP
 B#16#06: Communication via IE interface on interface slot 2 (IF2),
B#16#0B: slot 3 (IF3), B#16#0F: slot 4 (IF4) for WinAC RTX or
IM151-8 PN/DP CPU
– local_tsap_id and rem_tsap_id
 All character strings with a length between 0 and 16 bytes are
permitted. Each character can have a value between B#16#00 and
B#16#FF
 In this case, local_tsap_id_len and rem_tsap_id_len are 3 bytes
st nd
long. The 1 byte E0 (connection type T connection), 2 byte rack
and slot of the local CPU (bits 0 to 4 slot, bits 5 to 7 rack number),
rd
3 byte is TSAP extension
In case of S7-300/400 controllers the TSAP-ID is : E0.02.49
In case of S7-1200/1500 controllers the TSAP-ID is : E0.01.49

NOTE Depend on the CPU type only the 2nd byte must be changed. If there are
multiple connections to the same communication partner, you have to ensure
 Siemens AG 2016 All rights reserved

that each value of local_tsap_id that you use in your CPU is unique.

– rem_staddr
 IP address of the partner (Central CPU/ LCU), for e.g. 10.20.130.20
3. After making changes to the function FC4000, save the function.
4. Call the function in OB1 and download the data block and function into CPU.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 25
5 Configuration of active partners (Central PLC/LCU)

Configuration for data transfer


1. Open “PCC_V2_0” library. Drag and Drop the FB “PCC_TCC” on to a network
in OB1. The system automatically assigns the free available DB. The function
block FB501 (PCC_TCC) allows you to exchange the PDI interface to machine
PLCs via Open IE Communication.
 Siemens AG 2016 All rights reserved

2. Configure FB501 to transfer with machine PLCs.

Parameter Declaration Data Type Description


Enable INPUT BOOL 1= Enable data transfer
PDI_Type INPUT INT 1=PDI_BAISC, 2=PDI_LCU, 3=PDI,
4 = PDI_BASIC_OMACv2, 5 = PDI_LCU_OMACv2,
6 = PDI_PEC_OMACv2, 7 = PDI_Para_OMACv2,
8 = PDI_BASIC_WS, 9 = PDI_LCU_WS,
10 = PDI_PEC_WS, 11 = PDI_Para_WS
PDI_DBNR INPUT INT Number PDI Machine Interface DB
TCON_DBNR INPUT INT Number TCON Configuration DB
TLastCYCLE INPUT INT last cycle time of OB1
Call_Cycle INPUT INT Call cycle for Read Write PDI
RESET INPUT BOOL RESET
QERROR OUTPUT BOOL Error
QERR_ST OUTPUT WORD Error Status
QCON OUTPUT BOOL 1= Connection ok

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 26
5 Configuration of active partners (Central PLC/LCU)
 Siemens AG 2016 All rights reserved

3. Save and download the user program into PLC. To initiate data transfer the
input ENABLE must be set to true.

NOTE To establish connection the passive partner (machine PLC) must be configured.
Once the connection is established the PDI interface DB information can be
exchanged.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 27
5 Configuration of active partners (Central PLC/LCU)

5.3 Configure PLC in TIA Portal (S7-1500)


Data Block for Assigning Parameters of Active partner
1. Open “PCC_V2_0” library and copy “TCON_PARA_DB” data block and
“TCON_CONFIG_ISOonTCP” function into your project. This function allows
you to configure the connection parameters in the data structure
“TCON_PARA_DB”.
 Siemens AG 2016 All rights reserved

2. Configure connection parameters.


Sample code for configuring “TCON_PARA_DB” is programmed in FC4000.
The below parameters must be adapted by the user.
– interfaceId  Hardware identifier of the local PN interface (value range: 0
to 65535). Default value is 64 will be assigned from system. For use of
another S7-1500 Ethernet Interface change the interfaceID according to
the HW-ID in the Hardware Configuration.
– active_est  True for active connection establishment
– id  Reference to the connection (range of values: W#16#0001 to
W#16#0FFF). For each configured connection the ID must be unique
– localTSelector and remoteTSelector
 All character strings with a length between 0 and 16 bytes are
permitted. Each character can have a value between B#16#00 and
B#16#FF

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 28
5 Configuration of active partners (Central PLC/LCU)

 In this case, localTSelctorLength and remoteTSelctorLength are 3


st nd
bytes long. The 1 byte E0 (connection type T connection), 2 byte
rack and slot of the local CPU (bits 0 to 4 slot, bits 5 to 7 rack
rd
number), 3 byte is TSAP extension
In case of S7-300/ 400 controllers the TSAP-ID is: E0.02.49
In case of S7-1200/ 1500 controllers the TSAP-ID is: E0.01.49

NOTE Depend on the CPU type only the 2nd byte must be changed. If there are
multiple connections to the same communication partner, you have to ensure
that each value of local_tsap_id that you use in your CPU is unique.

– rem_staddr
 IP address of the partner (Central CPU/ LCU), for e.g. 10.20.130.20
3. After making changes to the function FC4000, save the function.

Configuration for data transfer


1. Open “PCC_V2_0” library. Drag and Drop the FB “PCC_TCC” on to a Network
in OB1. The system automatically assigns the free available DB. The function
 Siemens AG 2016 All rights reserved

block FB501 (PCC_TCC) allows you to exchange the PDI interface to machine
PLCs via Open IE Communication.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 29
5 Configuration of active partners (Central PLC/LCU)

2. Configure FB501 to transfer with machine PLCs.

Parameter Declaration Data Type Description


Enable In Bool 1= Enable data transfer
PDI_TYPE In Int 1=PDI_BAISC, 2=PDI_LCU, 3=PDI,
4 = PDI_BASIC_OMACv2,
5 = PDI_LCU_OMACv2,
6 = PDI_PEC_OMACv2,
7 = PDI_Para_OMACv2, 8 = PDI_BASIC_WS,
9 = PDI_LCU_WS, 10 = PDI_PEC_WS,
11 = PDI_Para_WS
DBNR In Int Number PDI Machine Interface DB
TCON_DBNR In Int Number TCON Configuration DB
TLastCYCLE In Int last cycle time of OB1
Call_Cycle In Int Call cycle for Read Write PDI
RESET In Bool RESET
QERROR Output Bool Error
TCON_CONNECT_DB In/Out Variant TCON connection parameter DB
QERR_ST Out Word Error Status
QCON Out Bool 1= Connection ok
 Siemens AG 2016 All rights reserved

3. Save and download the user program into PLC. To initiate data transfer the
input ENABLE must be set to true.

NOTE To establish connection the active partner (central PLC/LCU) must be


configured. Once the connection is established the PDI interface DB information
can be exchanged.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 30
6 Demo projects

6 Demo projects
6.1 ET 200S CPU as Active Partner
Description
ET 200S PLC (ET 200S with IM 151-8 PN/DP CPU) is configured as central PLC
and communicates with 4 machine PLCs via Open IE communication. Central PLC
is configured as active partner and all other machine PLCs as passive partners.
Each machine PLC will exchange PDI interface DB with central PLC.
Status and Admin areas in the PDI interface are read by central PLC and
Command area will be written to the respective machine PLC.

SIMATIC IO-Controller

ET 200S
IM151-8 PN/DP

PDI
 Siemens AG 2016 All rights reserved

PROFINET

ET 200S SIMOTION
IM 151-8 PN/DP S7 1516-3 D445-2
PN/DP

PDI PDI PDI

SIMATIC I-Device SIMOTION I-Device

NOTICE S7-1516-3 PN/DP and S7-1215C PLCs are configured in TIA portal V13SP1,
SIMOTION Controller using SIMOTION SCOUT and ET 200S PLCs are
configured with STEP 7 V5.5 SP3.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 31
6 Demo projects

6.2 S7-1516 CPU as Active Partner


Description
S7 1516-3 PN/DP PLC is configured as central PLC and communicates with 2
machine PLCs via Open IE communication. Central PLC is configured as active
partner and all other machine PLCs as passive partners. Each machine PLC will
exchange PDI interface DB with central PLC.
Status and Admin areas in the PDI interface are read by central PLC and
Command area will be written to the respective machine PLC.

SIMATIC IO-Controller

S7 1516-3
PN/DP

PDI

PROFINET
 Siemens AG 2016 All rights reserved

ET 200S SIMOTION
IM 151-8 PN/DP D445-2

PDI PDI

SIMATIC I-Device SIMOTION I-Device

NOTICE S7-1516-3 PN/DP, S7-1215C and ET 200S PLCs are configured in TIA portal
V13 SP1.

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 32
7 Abbreviations

7 Abbreviations
F&B Food and Beverage
HMI Human Machine Interface
IF Interface
LCU Line Control Unit
OMAC Open Modular Architecture Controls
PLC Programmable Logic Controller
PDI Plant Data Interface
PCC Plant Communication Concept
 Siemens AG 2016 All rights reserved

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 33
8 Related literature

8 Related literature
Topic
\1\ Siemens Industry Online Support
https://support.industry.siemens.com
\2\ Download page of this entry
https://support.industry.siemens.com/cs/ww/en/view/98278624

\3\ Line Integration at the Food & Beverage Industry (Overview)


https://support.industry.siemens.com/cs/ww/en/view/109483779
\4\ Line Integration at the Food & Beverage Industry – Plant Data Interface
https://support.industry.siemens.com/cs/ww/en/view/86302104

9 History
Version Date Modifications
V1.0 07/2014 First version
V2.0 05/2016 Additional PDI-Types added
 Siemens AG 2016 All rights reserved

Plant Communication Concept - OPEN IE Communication


Entry-ID: 98278624, V2.0, 05/2016 34

Potrebbero piacerti anche