Siemens S7 Series, S7-1200, S7-1500 Communication Instruction Manual

Communication with S7 CPU via KNX Gateway

S7-1200, S7-1500, PROFINET, “Triple-X PROFINET + KNX” Universal Gateway
Siemens Industry Online Support

Warranty and Liability

Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
2
Siemens AG 2017 All rights reserved
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.
Security informa­tion
Siemens provides products and solutions with industrial security functions that support the secure operation of plants, systems, machines and networks. 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.
Warranty and Liability
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”). 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.
Table of Contents
Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
3
Siemens AG 2017 All rights reserved
Table of Contents
Warranty and Liability ................................................................................................. 2
1 Task ..................................................................................................................... 4
1.1 Introduction ........................................................................................... 4
1.2 Overview of the automation task .......................................................... 4
2 Solution............................................................................................................... 5
2.1 Overview............................................................................................... 5
2.2 Description of the core functionality ..................................................... 7
2.3 Hardware and software components ................................................... 8
3 Mode of Operation ........................................................................................... 10
3.1 Data points and signal chart ............................................................... 10
3.2 Data point mapping ............................................................................ 11
3.3 Correlation of the gateway configuration files .................................... 12
4 Configuration and Project Engineering ......................................................... 14
4.1 STEP 7 (TIA Portal) device configuration .......................................... 14
4.2 Gateway: Setting the LAN IP address ................................................ 16
4.3 Gateway: Data backup ....................................................................... 18
4.4 Gateway: Editing configuration files ................................................... 19
4.4.1 Editing in the integrated web server ................................................... 19
4.4.2 Configuration files ............................................................................... 20
4.4.3 “eib1.cfg” gateway file ........................................................................ 20
4.4.4 “eib1.txt” gateway file ......................................................................... 21
4.4.5 “pnetd1.txt” gateway file ..................................................................... 22
4.4.6 “pnetd1.cfg” gateway file .................................................................... 23
4.4.7 “dispatch.txt” gateway file ................................................................... 24
4.5 Gateway: Overview of the configuration ............................................ 25
4.6 Gateway: Restart ................................................................................ 26
5 Installation and Commissioning .................................................................... 27
5.1 Installing the software ......................................................................... 27
5.2 Installing the hardware ....................................................................... 27
5.2.1 Installation under laboratory conditions .............................................. 27
5.2.2 Installation under plant conditions ...................................................... 28
5.3 Commissioning ................................................................................... 29
5.3.1 Commissioning the gateway .............................................................. 29
5.3.2 Commissioning the S7-1200 CPU ..................................................... 31
6 Operation of the Application Example .......................................................... 33
7 Links & Literature ............................................................................................ 35
8 MBS GmbH – Contact ...................................................................................... 35
9 History............................................................................................................... 36

1 Task

Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
4
Siemens AG 2017 All rights reserved
KNX devices
KNX
gateway
PROFINET
SIMATIC
CPU
KNX
1 Task

1.1 Introduction

Gateways enable communication between two networks/bus systems that use different communications protocols.
KNX is a fieldbus for building automation. Technically, KNX is the successor to the European Installation Bus (EIB), adding communication mechanisms and transmission media.
The functionality of a KNX system can be extended by integrating an S7 CPU into a KNX system via a gateway. An S7 CPU enables the use of various functions and statements for creating a control program and processing data.
The “LGF (Library of general functions)” for STEP 7 (TIA Portal) and S7-1200 / S7­1500 additionally provides complementary functions such as an astronomical clock, weekly timer, FIFO and many more (see \4\).

1.2 Overview of the automation task

The task is to establish, using a KNX gateway, a communication connection between an S7 CPU via PROFINET (PN) and a KNX device via the KNX bus.
Each KNX device has a physical address (PA) via which the device can be accessed. The individual functions of a KNX device are addressed by group addresses (GA).
Through bidirectional data exchange between a KNX gateway and an S7 CPU, signals of a KNX device are to be processed in the S7 CPU or KNX devices are to be controlled using the S7 CPU.
The figure below provides an overview of the automation task. Figure 1-1: Block diagram of the automation task

2 Solution

Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
5
Siemens AG 2017 All rights reserved
Triple-X PROFINET+KNX universal gateway
PROFINET
KNX devices
S7-1200 CPU
KNX
1
2 Solution

2.1 Overview

Diagrammatic representation
Representing all SIMATIC controllers, this solution uses an S7-1200 CPU. The diagrammatic representation below shows the most important components for communication between an S7-1200 CPU and a KNX network using the “Triple­X PROFINET + KNX” universal gateway from MBS GmbH.
Figure 2-1: Block diagram of the solution with the components used
The “Triple-X PROFINET + KNX” universal gateway enables communication between an S7-1200 CPU and KNX devices via PROFINET and the KNX bus.
In this example, the KNX devices consist of:
KNX wall switch triple  KNX room control unit  KNX power supply1
Correct communication is verified with the KNX devices and a STEP 7 (TIA Portal) watch table.
An external KNX power supply is necessary for operating a KNX network and is no
communication node in the network.
2 Solution
Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
6
Siemens AG 2017 All rights reserved
Interface label
Communication
medium
Network
Connected device
PROFINET 1 or PROFINET 2
Ethernet
PROFINET
SIMATIC CPU (S7-1200 CPU)
LAN
Ethernet
LAN
PG / PC
KNX
Twisted pair cable
KNX
KNX devices (incl. KNX power supply)
2
Advantages
The following table shows the relevant interfaces of the gateway for this application example:
Table 2-1: Gateway interfaces
The solution presented here offers the following advantages: Easy adaptation to other controller families. Representing all other SIMATIC
controllers with a PROFINET IO interface, this solution uses the S7-1200 CPU.
Easy adaptation when expanding plants. The gateway is configured directly in
the gateway’s integrated web server.
Integration of the gateway as a PROFINET IO device via a GSD file.  Gateway as distributed I/O with up to 340 bytes of input and 340 bytes of
output.
Up to 2500 data points possible for communication between PROFINET and
KNX.
Scope
This document does not replace the gateway manual. If there are any
differences in the documentation, the documentation provided by MBS GmbH always takes precedence.
This application example only describes how to get started with KNX
communication with SIMATIC CPUs using a KNX gateway. For more information about the KNX gateway, please refer to the gateway manual or directly contact MBS GmbH.
Configuring the KNX devices using the ETS2 software and communication
between the gateway and the KNX devices are not part of this application example.
Sales, distribution, training, service and support for the “Triple-
X PROFINET + KNX” universal gateway are provided exclusively by MBS GmbH.
Required knowledge
Basic knowledge of STEP 7 (TIA Portal) programming and project engineering  Basic knowledge of PROFINET communication and configuration  Basic knowledge of the ETS software, KNX communication and KNX group
addresses
Engineering Tool Software (ETS) for programming nodes and assigning group addresses in a
KNX network.
2 Solution
Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
7
Siemens AG 2017 All rights reserved
SIMATIC (S7-1200
CPU) Gateway
KNX
PROFINET
KNX
BOOL
BIT
UINT1 ↔ DPT-1
INT
SINT16
SINT16 ↔ DPT-7
REAL
FLOAT32
SFLOAT ← DPT-9

2.2 Description of the core functionality

Configuration
The connection between the S7-1200 CPU and the gateway is configured via
the configuration of the gateway as distributed I/O in STEP 7 (TIA Portal).  configuration files of the gateway (cfg and txt files) (see Figure 3-3) that
reference each other.
The configuration files are downloaded to the gateway using the integrated web server or directly edited.
Configuring and programming the gateway requires no ETS software. The gateway can access existing data points (group addresses) in the KNX network and provide its own data points locally on the gateway.
The assignment of the devices’ group addresses and physical addresses is not
part of this description. For more information, please refer to the supplied ETS5 sample project. The gateway’s physical address (KNX) is set using the “eib1.cfg” configuration file (see 4.4.3).
Function and data types
This application example contains a STEP 7 project and a data record for the gateway, where data of different data types is exchanged between an S7-1200 CPU and KNX devices in both directions via the gateway. A decimal value is transferred from the S7-1200 CPU to the KNX control room unit’s display and a status LED of the KNX wall switch is controlled via a binary signal. Conversely, the value of the integrated temperature sensor and a configurable decimal value are transferred from the KNX room control unit. Using the KNX wall switch, a boolean variable is set/reset in the S7-1200 CPU.
The following data types are used and parameterized:
Table 2-2: SIMATIC / gateway data types
2 Solution
Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
8
Siemens AG 2017 All rights reserved
Component
No.
Article number
Note
POWER MODULE PM1207
1
6EP1332-1SH71
Power supply input: 120/230 V AC output: 24 V DC/2.5 A
SIMATIC S7-1214C DC/DC/DC FW4.2
1
6ES7214-1AG40­0XB0
Alternatively, any other S7-1200 CPU (FW4.1 or higher) or S7­1500 CPU (FW1.7 or higher) can be used.
Compact Switch Module
1
6GK7277-1AA00­0AA0
(optional) The switch is only required if you
want to simultaneously access (without “replugging”) the S7-1200 and the gateway from the PG/PC.
“Triple-X PROFINET + KNX”
universal gateway (RS485)
1
Manufacturer: MBS GmbH
Operating system: Linux 2.6.34.7 #267 Software module: V2_05W Hardware module:
15.1.1
http://www.mbs­solutions.de/profinet-knx
For the versions on the left, visit
the gateway web server’s page,
“Help > Device info”.
Alternative: RS232
Siemens Gamma KNX room control unit
1
5WG1227-2AB11
Operating and installation instructions
https://support.industry.siemens.c om/cs/ww/en/view/76776544
Siemens Gamma KNX wall switch triple
1
5WG1223-2DB13
-
Siemens Gamma KNX bus coupling unit
1
5WG1117-2AB12
-
Siemens Gamma KNX power supply
1
5WG1125-1AB01
Siemens Gamma KNX USB interface
1
5WG1148-1AB12
Optional. Interface for programming the KNX devices.

2.3 Hardware and software components

This application example was created with the following components:
Hardware components
Table 2-3: Hardware components
2 Solution
Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
9
Siemens AG 2017 All rights reserved
Component
No.
Article number
Note
SIMATIC STEP 7 Professional V14 (TIA Portal)
1
6ES7822-1..04-..
-
GSDML-V2.31-MBS­MICRO3004-20150206
1
Manufacturer: MBS GmbH
The latest GSDML files are available directly from MBS GmbH. The GSDMLV2.31 file was used in this example. The files are available in the “AdditionalFiles – GSD” folder in the STEP 7 project. When opening the project, the GSD file is installed automatically.
ETS5 Demo
1
https://www.knx.org/kn x­en/software/ets/downl oad/index.php
Maximum of 5 KNX devices per project.
Component
Note
109739689_KNX_DOC_V10_en.pdf
This document
109739689_KNX_S7_PROJ_V10.zip
This .zip file contains the “MBS_KNX” STEP 7 project.
109739689_KNX_Gateway_RestoreFile_V10.zip
This zip file contains the
“ugwbackup.tgz” gateway
data backup with the configuration files.
109739689_KNX_ETS5_PROJ_V10.zip
This .zip file contains the ETS5 project.
Software components
Table 2-4: Software components
Sample files and projects
The following list contains all files and projects that are used in this example.
Table 2-5: Download files

3 Mode of Operation

Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
10
Siemens AG 2017 All rights reserved
E
PROFINET KNX
Gateway
Q
outbit
outbyte
GA
S7-1200 CPU
KNX device
Signal chart
Q
Signal
Data point
E
GA
E
PROFINET KNX
Q Output
GA Group address
Type
Meaning
M
Integer value (binary data points, counts) that can only be read by the gateway.
S
Integer value that can be read and written by the gateway.
X
Analog value (with decimal places) that can only be read by the gateway.
Y
Analog value (with decimal places) that can be read and written by the gateway.
3 Mode of Operation
The data between the two bus systems, PROFINET and KNX, is exchanged between the drivers (PROFINET, KNX) in the gateway via data point mapping.
The data points are described in the pnetd1.txt and eib1.txt configuration files and mapped to each other in the dispatch.txt dispatch file.
For each data point, the format specifies how the driver should interpret the data at the data point address.

3.1 Data points and signal chart

Each interface of a device (CPU, KNX) that is used to transfer data represents a data point. As the gateway connects two different bus systems, it has two data points – the source data point and the target data point.
The example in the following figure shows a signal that is generated in the S7-1200 CPU and transmitted to the gateway via PROFINET. The gateway converts the PROFINET signal to a KNX telegram and sends it to the appropriate group address of the KNX device. In the same way, a signal can also be transmitted from a KNX device to the S7-1200 CPU.
Figure 3-1: S7-1200 CPU KNX device – signal chart
For the KNX driver and all other gateway drivers, the following types apply to the definition of the data types:
Table 3-1: Definition of the data point types
For a definition of “data points”, please refer to the gateway manual (\3\), section 6 “Protocol properties and data points”.
3 Mode of Operation
Communication with S7 CPU via KNX Gateway Entry ID: 109739689, V1.0, 06/2017
11
Siemens AG 2017 All rights reserved
OW 100
IW 100
O 102.0
O 102.0
setValInt
readValInt
setValBool
readValBool
PLC tags
Gateway
Name Data type
Length
Address Name AddressFormat
Length
PROFINET
S7-1200 CPU
Integrated
I/O
KNX-->S7 value
S inbyte 0SINT16
2 bytes
S7-->KNX statusLED
M outbit 2.0BIT
1 bit
KNX-->S7 switch
S inbit 2.0BIT
1 bit
S7-->KNX value
M outbyte 0
SINT16 2 bytes
INT
2 bytes
INT 2 bytes
BOOL 1 bit
BOOL 1 bit
PROFINET
AddressFormat
Length
M 1/1/1SINT16
2 bytes
S 1/1/4
UINT1 1 bit
M 1/1/3UINT1
1 bit
S 1/1/2SINT16
2 bytes
EIB/KNX
KNX
Process image
PLC_1 DI14
I 0 *
I/O Address
INPUT_32B_1 I
100..131
OUTPUT_32B_1 O
100..131
O 0 *
PLC_1 DO10_1
Data points
KNX devices
(wall switches, actuators…)
ID 103
readTemprInt REAL
4 bytes
KNX-->S7
temperature
Y inbyte 3
FLOAT32
4 bytes
X 1/1/5SFLOAT
2 bytes
Note
*Compact CPUs (e.g., S7-1200) with integrated digital inputs and outputs: In STEP 7 (TIA Portal), the smallest address 0 is automatically assigned to the
integrated digital inputs and outputs. Other modules / I/O are automatically assigned to the next available address.
Here, the address space starting with 100 was selected in the process image. This makes it easier to identify the connected tags between the S7-1200 CPU and the gateway.

3.2 Data point mapping

The following figure shows all of the data used and the process image of the S7­1200 CPU for the configuration with the gateway.
Please note: The input or output signal type always refers to the “perspective” of
the respective device.
Figure 3-2: Interaction between the process image of the S7 CPU and the data points in the gateway
Loading...
+ 25 hidden pages