Block For Connecting Modbus TCP Devices To Energy Suite V14 SP1
Block For Connecting Modbus TCP Devices To Energy Suite V14 SP1
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. This Application Example does not relieve you of the responsibility of safely and
professionally using, installing, operating and servicing equipment. When using this
Application Example, 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 this
Application Example at any time without prior notice. If there are any deviations between
the recommendations provided in this Application Example 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
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
Siemens AG 2017 All rights reserved
negligence or based on mandatory liability for injury of life, body or health. The
above provisions do not imply a change of 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 AG in writing.
Security Siemens provides products and solutions with industrial security functions that support the
informa- secure operation of plants, systems, machines and networks.
tion 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. Products and solutions from Siemens are only one part of such a concept.
The customer is responsible for preventing unauthorized access to the customer’s plants,
systems, machines and networks. Systems, machines and components should be
connected to the company network or the Internet only if and to the extent necessary and
if appropriate protective action (e.g., use of firewalls and network segmentation) was
taken.
In addition, Siemens’ recommendations regarding appropriate protective action should be
followed. For more information about industrial security, visit
http://www.siemens.com/industrialsecurity.
Siemens’ products and solutions undergo continuous development to make them even
more secure. Siemens strongly recommends to perform updates as they become
available and use only the latest product versions. Using versions that are out of date or
no longer supported can increase the risk of cyber threats.
To stay informed about product updates as they occur, subscribe to the Siemens
Industrial Security RSS feed at http://www.siemens.com/industrialsecurity.
Table of Contents
Warranty and Liability ................................................................................................. 2
1 Overview ............................................................................................................. 4
1.1 Introduction ........................................................................................... 4
1.2 Validity .................................................................................................. 4
1.3 Mode of operation ................................................................................ 5
1.4 Components of the application example .............................................. 5
1.5 Components used ................................................................................ 5
2 Engineering ........................................................................................................ 6
2.1 Interface description ............................................................................. 6
2.2 Integration into the user project ............................................................ 8
2.2.1 Checking the online values ................................................................ 12
2.3 Error handling ..................................................................................... 13
2.4 Custom register map .......................................................................... 14
2.5 Visualizing the energy data ................................................................ 15
2.5.1 Preparations ....................................................................................... 15
2.5.2 Short instructions ................................................................................ 16
3 Appendix .......................................................................................................... 18
3.1 Service and Support ........................................................................... 18
3.2 Links and literature ............................................................................. 19
3.3 Change documentation ...................................................................... 19
Siemens AG 2017 All rights reserved
1 Overview
1.1 Introduction
SIMATIC Energy Suite provides the option to read energy data relevant to
accounting, such as power and voltage values. However, the program blocks for
advanced energy data added by TIA Portal V14 SP1 can only be generated using
devices that are supported by the Energy Support Library (EnSL).
The block library described in this application example contains a block that allows
you to integrate Modbus TCP devices into Energy Suite that are not supported by
default by the EnSL. A preconfigured data block allows you to integrate SENTRON
7KM measuring devices into your energy data program without additional
configuration overhead.
Figure 1-1
100111101011100010101011000
EnS_Modbus100111101011100010101011000
100111101011100010101011000
_energyAdv100111101011100010101011000
Siemens AG 2017 All rights reserved
1.2 Validity 1 0
This block library has been tested for the0following
0 products:
Table 1-1
0 1
1 0
Software Hardware
1 1
TIA Portal V14 or higher
1 0SIMATIC S7-1500
Energy Suite V14 SP1 Upd 2 or higher 1 1Modbus TCP device:
SENTRON PAC 5200
0 0
SENTRON PAC 3200
1 1
0 1
Note Modbus RTU devices are not supported by the block.
1 0
1 0
1 0
0
2 Engineering
2.1 Interface description
The following sections explain the Modbus_TCP_energyAdv function block that
performs the functionality described in this document.
Figure 2-1
Modbus_TCP_energyAdv
typeMBTCP_energyAdv_DeviceAdress
The "*_DeviceAdress" data type contains information about the connection settings
for Modbus TCP communication. The following table lists all variables included in
this data type.
Table 2-3
Name Data type Explanation
Siemens AG 2017 All rights reserved
typeMBTCP_energyAdv_DeviceType
The "*_DeviceType" data type contains the information for the measuring device's
register map. It consists of an array of another UDT
("typeMBTCP_EnergyAdv_DeviceType_Value"), where each array element
contains the configuration data for one measured value.
The following table lists all parameters included in the "*_DeviceType_Value" data
type.
Table 2-4: Parameters of an "advData[0]" array element
Name Data Values
type
Index Int 3 (unchanged)
Name String 'voltage3N' (unchanged)
Type String 'DInt', 'Real' or 'LReal'
Adress DInt 22
Instructions
1. Open your TIA Portal project.
2. Unzip the "109749074_LModbusTCP_energyAdv.zip" file and open the library
in TIA Portal.
Figure 2-2 Open library view
Siemens AG 2017 All rights reserved
You need this data block only once per device type. This means the
"DeviceType_PAC_22_32_32T_42" data block allows you to connect any
number of SENTRON devices (4200/3200(T)/2200).
Note For the SENTRON PAC 5100 and 5200 devices, use the
"DeviceType_PAC_51_52" master copy. For other Modbus TCP devices,
manually customize the register map. Chapter 2.4 shows you how to create a
custom register map.
8. Expand the data block and make changes in the following places highlighted in
red.
2 In the "ADDR[]" array, enter the IP address of your Modbus TCP device.
Enter the IP address byte by byte in the individual array elements.
Note For each Modbus TCP device you want to integrate, you must call the block
once. To do this, repeat steps 4 through 7.
Note If you make changes to the configuration data blocks, make sure to download
the user program in its entirety.
3. Generate the energy data program with the advanced energy data. Now you
can access the energy data of the Modbus TCP device using Energy Suite.
Figure 2-10 Generating energy data
Note For information about using SIMATIC Energy Suite, refer to the following
application example or the Energy Suite manual.
Application example: "SIMATIC Energy Suite – Getting Started"
https://support.industry.siemens.com/cs/ww/en/view/109739102
Manual: "SIMATIC Energy Suite V14 SP1"
https://support.industry.siemens.com/cs/ww/en/view/109741977
Now you can check whether you have successfully integrated the measuring
device:
1. In TIA Portal, open the data block you specified when calling the Modbus
block; in this application example: "EnO_Dev1_PAC3200_Adv".
Figure 2-11 Call of the Modbus block
If no data is displayed, the "STATUS" (1) error code can help diagnose the error.
Note For the error codes of the MB_CLIENT instance, refer to the "WinCC Advanced
V14 SP1" manual or the TIA Portal Online Help.
The following link takes you directly to the right place in the manual:
MB_CLIENT STATUS Parameter Description
Preparations
In the device manufacturer's manual, look for the Modbus register map for the
energy data.
Figure 2-14
Siemens AG 2017 All rights reserved
Figure 2-15
Note You have to enter the data type as a string with '…', e.g.: 'DInt' or 'Real'. Be sure
to use the correct notation. The other parameters need not be changed.
To integrate the Modbus TCP device into the Energy Suite program, continue with
Step 5 in Chapter 2.2.
2.5.1 Preparations
Check the name of the instance DB of the Modbus block and the energy object. If
you are using the "EnS Visu" library for visualization, change the names as follows:
Energy object: EnO_Name
Instance DB: EnO_Name + "_Adv"
In the application example:
Energy object: "EnO_Dev1_PAC3200"
Instance DB: "EnO_Dev1_PAC3200_Adv"
Note Make sure that SIMATIC Energy Suite V14 SP1 Update 2 or higher is installed
on your system.
Note For detailed instructions for using the "EnS_Visu" library, refer to the following
application example:
"SIMATIC Energy Suite – Visualization Examples"
https://support.industry.siemens.com/cs/ww/en/view/109739775
3. Depending on the operator panel you are using, copy all objects from the
"VisuComfort/RTAdvanced" or "VisuRuntimeProf" folder to your project.
Note If you want to visualize more than one energy object, you have to insert the
faceplate and the pop-up screens multiple times. Before you insert the pop-up
screens once again, change the names of the existing pop-up screens in the
project.
Chapter 3.2.1, Step 5 and the following steps of the following application
example describe the detailed procedure:
"SIMATIC Energy Suite – Visualization Examples"
(https://support.industry.siemens.com/cs/ww/en/view/109739775).
Siemens AG 2017 All rights reserved
Note If you want to visualize more than one energy object, drag another faceplate to
your screen and interconnect it. You do not need a second screen window and
you do not have to drag any other screens to your project.
3 Appendix
3.1 Service and Support
Industry Online Support
Do you have any questions or do you need support?
With Industry Online Support, our complete service and support know-how and
services are available to you 24/7.
Industry Online Support is the place to go to for information about our products,
solutions and services.
Product Information, Manuals, Downloads, FAQs and Application Examples – all
the information can be accessed with just a few clicks:
https://support.industry.siemens.com
Technical Support
Siemens Industry’s Technical Support offers you fast and competent support for
any technical queries you may have, including numerous tailor-made offerings
ranging from basic support to custom support contracts.
You can use the web form below to send queries to Technical Support:
www.siemens.com/industry/supportrequest.
Siemens AG 2017 All rights reserved
Service offer
Our service offer includes the following services:
Product Training
Plant Data Services
Spare Part Services
Repair Services
Field & Maintenance Services
Retrofit & Modernization Services
Service Programs & Agreements
For detailed information about our service offer, please refer to the Service
Catalog:
https://support.industry.siemens.com/cs/sc