You are on page 1of 69

Application Description 07/2015

Measuring and Visualizing


Energy Data
Programming of the Data Acquisition (Part 2/3)

https://support.industry.siemens.com/cs/ww/en/view/86299299
Warranty and Liability

Warranty and Liability

Note The Application Examples are not binding and do not claim to be complete with
regard to configuration, equipment or any contingencies. The Application
Examples do not represent customer-specific solutions. They are only intended
to provide support for typical applications. You are responsible for the correct
operation of the described products. 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 and 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 will be excluded. Such an exclusion will 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 2015 All rights reserved

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


(wesentliche Vertragspflichten). The compensation for damages due to a breach
of a fundamental contractual obligation is, 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 in the burden of proof to your disadvantage.
Any form of duplication or distribution of these Application Examples or excerpts
hereof is prohibited without the expressed consent of Siemens Industry Sector.

Security Siemens provides products and solutions with industrial security functions that
informa- support the secure operation of plants, solutions, machines, equipment and/or
tion networks. They are important components in a holistic industrial security
concept. With this in mind, Siemens products and solutions undergo continuous
development. Siemens recommends strongly that you regularly check for
product updates.
For the secure operation of Siemens products and solutions, it is necessary to
take suitable preventive action (e.g. cell protection concept) and integrate each
component into a holistic, state-of-the-art industrial security concept. Third-party
products that may be in use should also be considered. For more information
about industrial security, visit http://www.siemens.com/industrialsecurity.
To stay informed about product updates as they occur, sign up for a product-
specific newsletter. For more information, visit
http://support.industry.siemens.com.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 2
Table of contents

Table of contents
Warranty and Liability ................................................................................................. 2
Preface .......................................................................................................................... 5
1 Task ..................................................................................................................... 6
2 Solution............................................................................................................... 7
2.1 Solution overview ................................................................................. 7
2.2 Description of the core functionality ..................................................... 8
2.3 Hardware and software components used......................................... 10
2.4 Basic performance data ..................................................................... 12
3 Interface Description of the Blocks ............................................................... 13
3.1 Function block E2M_VISU ............................................................... 13
3.1.1 Function .............................................................................................. 13
3.1.2 Interfaces ............................................................................................ 13
3.2 Function block E2M_SENTRON_PAC_DRV................................... 15
3.2.1 Function .............................................................................................. 15
3.2.2 Interfaces ............................................................................................ 16
3.3 Function block E2M_AIEnergyMeter_DRV...................................... 19
3.3.1 Function .............................................................................................. 19
3.3.2 Interfaces ............................................................................................ 19
3.4 Function block E2M_SIMOCODE_PRO_V_DRV ............................ 23
3.4.1 Function .............................................................................................. 23
Siemens AG 2015 All rights reserved

3.4.2 Interfaces ............................................................................................ 23


3.5 Function block E2M_SIRIUS_3RR2441_DRV ................................ 26
3.5.1 Function .............................................................................................. 26
3.5.2 Interfaces ............................................................................................ 26
3.6 Function block E2M_SIRIUS_3UG4841_DRV ................................ 30
3.6.1 Function .............................................................................................. 30
3.6.2 Interfaces ............................................................................................ 30
3.7 Function block E2M_SIRIUS_3RW44_DRV.................................... 34
3.7.1 Function .............................................................................................. 34
3.7.2 Interfaces ............................................................................................ 34
3.8 Function block E2M_3VA_DRV ....................................................... 37
3.8.1 Function .............................................................................................. 37
3.8.2 Interfaces ............................................................................................ 38
3.8.3 Error codes ......................................................................................... 42
3.8.4 Function block E2M_3VA_COORD ................................................. 43
3.8.5 Interfaces ............................................................................................ 44
3.9 Error and status codes ....................................................................... 45
3.9.1 Error codes ......................................................................................... 45
3.9.2 Status codes ....................................................................................... 46
4 Bit Masks for Dynamization of the Visualization .......................................... 47
4.1 General ............................................................................................... 47
4.2 Indicators for calculated measured values ......................................... 48
4.3 Visibility of the measured values ........................................................ 50
5 General Notes .................................................................................................. 56
5.1 Prioritizing the communication resources .......................................... 56
5.2 Error Obs ............................................................................................ 56
5.3 Communication via CPs ..................................................................... 56
6 Acquisition of Energy Data with STEP 7 V5.5 .............................................. 57
6.1 Preparation ......................................................................................... 57
6.2 Creating an S7 program ..................................................................... 58

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 3
Table of contents

6.2.1 Copy blocks to the project .................................................................. 58


6.2.2 Calling blocks in the S7 program ....................................................... 59
7 Acquisition of Energy Data with STEP 7 V13 ............................................... 61
7.1 Preparation ......................................................................................... 61
7.1.1 Creating a hardware configuration ..................................................... 61
7.1.2 Setting the WRREC version ............................................................ 62
7.2 Creating an S7 program ..................................................................... 63
7.2.1 Copy blocks to the project .................................................................. 63
7.2.2 Calling blocks in the S7 program ....................................................... 64
8 Installation ........................................................................................................ 65
9 Commissioning the Demo Application .......................................................... 67
9.1 Preparation (WinCC V7/STEP 7 V5.5) ............................................... 67
9.2 Commissioning (WinCC V7/STEP 7 V5.5)......................................... 67
9.3 Preparation (WinCC V13/STEP7 V13) ............................................... 68
9.4 Commissioning (WinCC V13/STEP 7 V13)........................................ 68
10 Links & Literature ............................................................................................ 69
11 History............................................................................................................... 69
Siemens AG 2015 All rights reserved

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 4
Preface

Preface
Objective of this application
In this application, you learn about the basics of energy data acquisition as well as
the setup of an integrated and logic measuring concept.
The application example is divided into three topic areas.
Documentation is available for each topic area.
The following table shows what topics are described in the respective document.
The document you are currently reading is written in bold letters.

Table 0-1
Document Content
Part 1 Basic Knowledge In this document you learn about the basic
setup of a measuring system for energy
data with SIMATIC components.
Part 2 Programming the This document mainly discusses
Data Acquisition programming the PLC for connecting it to
the visualization.
Furthermore, commissioning the supplied
Copyright Siemens AG 2015 All rights reserved

demo application is described.


Part 3 Visualizing the Energy Data This document mainly discusses the
configuration of the visualization. Operating
the supplied faceplates and demo
applications is also explained in this
document.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 5
1 Task

1 Task
Introduction
Data acquisition is the first step in the energy management process.

Overview of the automation task


The figure below provides an overview of the automation task.
Figure 1-1

Measuring Visualizing Analyzing Managing

Transparency of your Acquisition and Analyzing and


Comprehensive
consumption representation of monitoring the
energy management
energy energy
Copyright Siemens AG 2015 All rights reserved

Description of the automation task


After installing the measurement instrumentation, the acquisition of energy data
can commence.
Irrespective of the measuring instrumentation used, it is useful for the programmer
if the control program structure is identical for each measuring point.
This facilitates programming and saves time during the commissioning process.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 6
2 Solution
2.1 Solution overview

2 Solution
2.1 Solution overview
Schematic layout
The figure below shows a schematic overview of the most important components of
the solution:
Figure 2-1

Management level

Control level

Data flow
Basic Comfort Runtime
Advanced WinCC V7
Panel Panel
Copyright Siemens AG 2015 All rights reserved

Field level

Advantages
This application offers the following advantages:
Simple and quick programming through supplied blocks.
The program structure is identical for all measuring devices.
Further processing of data with higher-level systems is possible.
Time saving and cost reduction due to simple integration into existing PLC
program.
Easily expandable to several measuring points.

Scope
This document does not include a description of
how to configure the visualization of energy data.
commissioning SIMATIC, SIRIUS and SIMOCODE components.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 7
2 Solution
2.2 Description of the core functionality

Assumed knowledge
Basic knowledge of programming and commissioning of SIMATIC S7, SIRIUS, and
SIMOCODE components is assumed.

2.2 Description of the core functionality


Overview of the core functionality
Figure 2-2

S7-300
S7-400
Data Acquisition Data processing S7-1200 Visualization
S7-1500

7KM PAC 3200 Driver - PAC


- PROFIBUS
- PROFINET
WinCC V7

ET 200SP Driver - AI Energy Meter


AI Energy Meter
Copyright Siemens AG 2015 All rights reserved

SIMOCODE PRO V Driver - SIMOCODE


- PROFIBUS
- PROFINET Runtime Advanced

SIRIUS 3RR2441 Driver 3RR2441 Universal FB


- IO link per driver

SIRIUS 3UG484x Driver 3UG484x


- IO link
Comfort Panel

SIRIUS 3RW44 Driver 3RW44


- PROFIBUS
- PROFINET

Driver - various Basic Panel


Further devices

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 8
2 Solution
2.2 Description of the core functionality

Sequence of the core functionality


Figure 2-3

Start/Stop
(OB1 cycle) 1

Calling
Calling
E2M_Visu
driver block

Read data
Read data from the
record structure

Check
Calculate number of
missing user-defined
Copyright Siemens AG 2015 All rights reserved

values
values

Define the Unit


bit masks handling

Write data Copy data


to the to instance
structure DB

Calculating
1 the gauge
scales

Transfer-
ring bit
masks

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 9
2 Solution
2.3 Hardware and software components used

Table 2-1
Action Note
1. OB1 cycle Calling OB1
2. Call the driver block
3. Read data record The data is read from the measuring
device.
4. Calculate missing values Any value not supplied by default by the
measuring device, yet can be
calculated, will be calculated here (e.g.
min. and max. values).
5. Define the bit masks The bit masks for the visualization are
defined depending on the measured
values which the device or the driver
block supplies.
6. Write data to the structure The structure with the measured data is
later transferred to the E2M_Visu
block.
7. Call E2M_Visu
8. Read data from the structure
9. Check the number of user-defined
values
Copyright Siemens AG 2015 All rights reserved

10. Unit handling Only executed if the automatic scaling


for units has been enabled.
11. Write data to instance DB
12. Calculate the scales Calculation of start and end values of
the scales for the pointer instruments of
the default view.
13. Transfer bit masks Bit masks for dynamization of the
visualization.

2.3 Hardware and software components used


The application was created and tested with the following components:

Hardware components
Table 2-2
Component No. Article number Note
SIMATIC HMI KTP600 Basic 1 6AV6647-0AB11-3AX0
mono PN
SIMATIC HMI TP900 Comfort 1 6AV2124-0JC01-0AX0
SIMTAIC HMI KTP900 Basic 1 6AV2123-2JB03-0AX0
7KM PAC3200 1 7KM2112-0BA00-3AA0
Switched Ethernet PROFINET 1 7KM9300-0AE01-0AA0 Required for 7KM
module PAC3200
SIMOCODE PRO V PN 1 3UF7011-1AB00-0
Current / voltage 1 3UF7110-1AA00-0 Required for
acquisition module SIMOCODE pro V

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 10
2 Solution
2.3 Hardware and software components used

Component No. Article number Note


SIMATIC ET 200SP 1 6ES7155-6AU00-0BN0 Firmware V1.1
SIMATIC ET 200SP AI Energy 1 6ES7134-6PA00- Firmware V2.0
Meter ST 0BD0ET
SIMATIC ET 200SP CM AS-I 1 3RK7137-6SA00-0BC1
Master
SIMATIC S7-1516 3PN/DP 1 6ES7516-3AN00-0AB0 Firmware V1.6
SIMATIC S7-319 3PN/DP 1 6ES7318-3EL01- Firmware V3.2
0AB0CPU319-3
Scalance X208 1 6GK5208-0BA00-2AA3
SIRIUS 3UG481 1 3UG4841-1CA40
SIRIUS 3RR241 1 3RR2141-2AW30
SIRIUS 3RW44 1 3RW4422-1BC34
PROFINET communication 1 3RW4900-0NC00 Required for
module SIRIUS 3RW44

Standard software components


Table 2-3
Component No. /Article number Note
Copyright Siemens AG 2015 All rights reserved

SIMATIC Step7 Professional 1 6ES7822-1..03-.. Incl. Update 4


V13
SIMATIC WinCC Engineering 1 6AV210.-....3-0 Incl. Update 4
V13
SIMATIC Step7 V5.5 1 6ES7810-4C.10-..
SIMATIC S7-PCT V3.1 1 Download under
entry ID
32469496.
SIMATIC WinCC V7.0 1 6AV63.1-....7-0...
Softstarter ES 2007 1 3ZS1313-6CC10-0YA5
SIMOCODE ES 2007 1 3ZS1312-2CC10-0YA0

Example files and projects


The following list includes all files and projects that are used in this example.
Table 2-4
Component Note
86299299_E2M_TIA.zip This zip-file contains a global library
for TIA Portal V13 including all
required blocks and visualization
objects.
86299299_E2M_Classic.zip This zip-file contains the files for data
acquisition with STEP 7 V5.5 and
visualization in WinCC V7.
86299299_E2M_TIA_Demo.zip Example project for STEP 7 V13 and
WinCC V13.
86299299_E2M_Classic_Demo.zip Example project for Step7 V5.5 and
WinCC V7.2.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 11
2 Solution
2.4 Basic performance data

Component Note
86299299_E2M_Basic_Knowledge.pdf Basic knowledge on energy data
acquisition (part 1/4)
86299299_E2M_PLC_Programming.pdf This document.
86299299_E2M_Visualization.pdf Documentation Visualizing the
Energy Data (part 3/4).
86299299_E2M_Energy_Meter_Details.pdf Documentation Detailed Information
ET 200SP AI Energy Meter (part 4/4)
86299299_E2M_EnergyMeter_Sample_V12.zip Example project with different
application scenarios of the energy
meter for STEP 7 V12.
86299299_E2M_EnergyMeter_Sample_V55.zip Example project with different
application scenarios of the energy
meter for STEP 7 V5.5.

2.4 Basic performance data


General
The performance of this application primarily depends on the hardware used.
Decisive for the quantity framework is the number of simultaneous SFB calls of the
Copyright Siemens AG 2015 All rights reserved

respective S7 controller.
Respective information is available in the manual of the controller.

The update cycles are also affected by whether the program needs to process
further data or whether it is exclusively assigned to the acquisition of energy data.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 12
3 Interface Description of the Blocks
3.1 Function block E2M_VISU

3 Interface Description of the Blocks


3.1 Function block E2M_VISU
3.1.1 Function

This function block provides a uniform interface for visualizing the energy data.
The block represents the link between the driver block of the measuring device
and the visualization of the energy data.
The E2M_VISU block must be called for each measuring point independent of the
measuring device used.
The block has the additional option of also creating up to twelve additional
measured values and transferring them to the visualization (e.g. operating hours
counter of the measuring device).

Note Depending on the target system for which the block was compiled, the block has
the name E2M_VISU, E2M_1200_VISU or E2M_1500_VISU.

3.1.2 Interfaces
Copyright Siemens AG 2015 All rights reserved

Inputs
Table 3-1
Parameter Data type Description
Add_Value_Count (optional) INT Number of user-defined measured values.
AddValue_01 (optional) REAL User-defined measured value 1.
AddValue_02 (optional) REAL User-defined measured value 2.
AddValue_03 (optional) REAL User-defined measured value 3.
AddValue_04 (optional) REAL User-defined measured value 4.
AddValue_05 (optional) REAL User-defined measured value 5.
AddValue_06 (optional) REAL User-defined measured value 6.
AddValue_07 (optional) REAL User-defined measured value 7.
AddValue_08 (optional) REAL User-defined measured value 8.
AddValue_09 (optional) REAL User-defined measured value 9.
AddValue_10 (optional) REAL User-defined measured value 10.
AddValue_11 (optional) REAL User-defined measured value 11.
AddValue_12 (optional) REAL User-defined measured value 12.
Start_Azyclic (optional) BOOL Starts reading the measured values once,
independent of the HMI.
Start_Auto (optional) BOOL Starts automatic reading of the values
independent of the HMI.
Reset_Min_Max_Data BOOL Resets the MIN and MAX values of
(optional) visualization and measuring device.
Reset_Energy_Meter BOOL Resets the energy counters of visualization
(optional) and measuring device.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 13
3 Interface Description of the Blocks
3.1 Function block E2M_VISU

Inputs and outputs


Table 3-2
Parameter Data type Description
DriverData STRUCT Contains all measured values and data
relevant for the visualization.

Outputs
Table 3-3
Parameter Data type Description
HMI_Bits STRUCT Structure for transferring the commands of
the operating device as well as the bit
masks for dynamization of the
visualization.
ERROR DWORD Outputs error codes.

Note All further outputs contain the measured values of the DriverData structure
which are additionally put out.
Copyright Siemens AG 2015 All rights reserved

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 14
3 Interface Description of the Blocks
3.2 Function block E2M_SENTRON_PAC_DRV

3.2 Function block E2M_SENTRON_PAC_DRV

NOTICE This block was developed for the application of the following devices and
firmware versions.
7KM PAC3200
- Firmware: V 2.3.0
7KM PAC4200
- Firmware: V 1.5.1
Expansion module PROFIBUS DPV1
- MLFB: 7KM9300-0AB01-0AA0
- Firmware: V 4.0
Switched Ethernet PROFINET module
- MLFB: 7KM9300-0AE01-0AA0
- Firmware: V 2.0.1

3.2.1 Function
Copyright Siemens AG 2015 All rights reserved

This function block ensures the data exchange of the measured values for
PROFINET and PROFIBUS with a 7KM PAC3200 and 7KM PAC4200 measuring
device.
The function block supplies the measured data in a standardized structure and
transfers it to the E2M_VISU block for an S7-300 or S7-400, to an
E2M_1200_VISU block for an S7-1200, or to an E2M_1500_VISU block for an
S7-1500 respectively.
Furthermore, the standardized visualization is influenced via a bit mask. Values
which are no longer available are hidden via the bit mask.
Values calculated by the driver block are explicitly labeled via the bit mask.

Note This block does not work with the default Modbus TCP interface of the measuring
device.
For using the block you need the separately available PROFIBUS or PROFINET
module.
For further information on the modules, refer to entry ID 63454754.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 15
3 Interface Description of the Blocks
3.2 Function block E2M_SENTRON_PAC_DRV

3.2.2 Interfaces

Inputs
Table 3-4
Parameter Data type Default Description
ID S7-300/ 0 First input byte of the
S7-400: measuring device in the
INT hardware configuration or
diagnostic address for
PROFINET.

S7-1200/ -
S7-1500: Hardware identifier of the
measuring device in the
HW_IO hardware configuration.
First_Byte_IO_Data INT 0 First input byte of the
measuring device in the
hardware configuration.

Connection_Type INT 1 Connection variant of the


measuring device.
Copyright Siemens AG 2015 All rights reserved

States:
1 1-phase
3 3-phase
Comm_Resource_Limit INT 4 Maximum number of
simultaneous SFB calls which
the drive can assign at the
same time.
Automatic_Update (optional) BOOL FALSE Specifies whether the data is
automatically updated
independent of the HMI.
Reset_Min_Max (optional) BOOL FALSE Resets all minimum and
maximum values of the block
with a positive edge.
Reset_Energy_Counter BOOL FALSE Resets all energy counters in
(optional) the measuring device with a
positive edge.
HMI_Bits_Connected BOOL FALSE The HMI_Bits structure is
connected.
Comm_Type INT 1 Specifies the communication
protocol used.

States:
1 PROFINET
2 PROFIBUS
Min_Max_Calculated BOOL TRUE Specifies whether the
minimum and maximum
values are directly read from
the device
(only for PROFIBUS)

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 16
3 Interface Description of the Blocks
3.2 Function block E2M_SENTRON_PAC_DRV

Parameter Data type Default Description


States:
TRUE Values are
calculated
FALSE Values are read

When using an S7-1200 or S7-1500, the hardware identifier of the measuring


device must be specified for the ID parameter.
The HW identifier can be read in the hardware configuration.

Figure 3-1
Copyright Siemens AG 2015 All rights reserved

When using an S7-300 or S7-400, the following value must be specified for the ID
parameter.
PROFIBUS module: First input byte of the configured measured value.
PROFINET module: Diagnostic address of the measuring device.

In order to read the first input byte, at least one measured value must be
configured in the device.

Figure 3-2

The First_Byte_I_O_Data input must be supplied with the first output byte of the
control byte for all controllers.
Figure 3-3

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 17
3 Interface Description of the Blocks
3.2 Function block E2M_SENTRON_PAC_DRV

Inputs and outputs


Table 3-5
Parameter Data type Default Description
HMI_Bits STRUCT Structure for the
communication between the
PC and visualization. If the
block is used without the
visualization, this parameter
needs not be interconnected.
Comm_Resource_Counter INT 0 Counter that specifies the
current number of
simultaneous SFB calls.
The tag used must be
interconnected with all drivers
which are to use the assigned
number of SFB calls.

Outputs
Table 3-6
Parameter Data type Default Description
Driver_Data STRUCT Contains all measured values
Copyright Siemens AG 2015 All rights reserved

of the device as well as all


values calculated by the
driver.

Additionally, the structure


contains all bit masks
necessary for the
visualization.
Energy_Counter STRUCT Contains all energy counters
of the device.
Time_Between_Update TIME T#0MS Specifies the time elapsed
since the last update of the
measured values.
Time_Between_Update_Max TIME T#0MS Specifies the maximum time
between updating measured
values.
Time_Stamp_Meas_Values S7-300/ DT#1990 Time of the last update of the
S7-400: -01-01- measured values.
DT 00:00:00

S7-1200/
S7-1500:
DTL
Error_Location WORD W#16#0 Specifies the error cause and
location.
Error_Code DWORD DW#16# Specifies the error code of the
0 SFB or SFC which has
produced an error.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 18
3 Interface Description of the Blocks
3.3 Function block E2M_AIEnergyMeter_DRV

3.3 Function block E2M_AIEnergyMeter_DRV


3.3.1 Function

This function block ensures the data exchange of the measured values for
PROFINET and PROFIBUS with an AI Energy Meter module of an ET 200SP.
The function block supplies the measured data in a standardized structure and
transfers it to the E2M_VISU block for an S7-300 or S7-400, to an
E2M_1200_VISU block for an S7-1200, or to an E2M_1500_VISU block for an
S7-1500 respectively.
Furthermore, the standardized visualization is influenced via a bit mask. Values
which are no longer available are hidden via the bit mask.
Values calculated by the driver block are explicitly labeled via the bit mask.

Additionally, the driver takes on the automatic securing and restoring of the energy
counter values in the event of a power failure at the energy meter module.

The following values are determined by the block:


Minimum values
Copyright Siemens AG 2015 All rights reserved

Maximum values
Average values

3.3.2 Interfaces

Inputs
Table 3-7
Parameter Data type Default Description
ID S7-300/ 0 First input byte of the
S7-400: measuring device in HW
INT Config.

S7-1200/ - Hardware identifier of the


S7-1500: measuring device in the HW
HW_IO Config.

First_Byte_I_O_Data INT 0 First input byte of the


measuring device in the
hardware configuration.
Connection_Type INT 1 Connection variant of the
measuring device.

States:
1 1-phase
3 3-phase
Comm_Resource_Limit INT 4 Maximum number of
simultaneous SFB calls which
the drive can assign at the
same time.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 19
3 Interface Description of the Blocks
3.3 Function block E2M_AIEnergyMeter_DRV

Parameter Data type Default Description


Automatic_Update (optional) BOOL FALSE Specifies whether the data is
automatically updated
independent of the HMI.
Reset_Min_Max (optional) BOOL FALSE Resets all minimum and
maximum values of the block
with a positive edge.
Reset_Energy_Counter BOOL FALSE Resets all energy counters in
(optional) the measuring device with a
positive edge.
HMI_Bits_Connected BOOL FALSE Specifies whether an instance
of the HMI_Bits structure is
connected with the driver.
Backup_Cycle_En_Count Time T#5S Backup cycle of the energy
counter.
Minimum value: 5s.

When using an S7-1200 or S7-1500, the hardware identifier of the energy meter
module must be specified for the ID parameter.
It can be read out from the properties of the energy meter module.
Figure 3-4
Copyright Siemens AG 2015 All rights reserved

The First_Byte_I_O_Data input must be supplied with the address of the first
input byte of the module.
Figure 3-5

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 20
3 Interface Description of the Blocks
3.3 Function block E2M_AIEnergyMeter_DRV

Inputs and outputs


Table 3-8
Parameter Data type Default Description
HMI_Bits (optional) STRUCT Structure for the
communication between the
PC and visualization. If the
block is used without the
visualization, this parameter
needs not be interconnected.
Comm_Resource_Counter INT 0 Counter that specifies the
current number of
simultaneous SFB calls.
The tag used must be
interconnected with all drivers
which are to use the assigned
number of SFB calls.

Outputs
Table 3-9
Copyright Siemens AG 2015 All rights reserved

Parameter Data type Default Description


Driver_Data STRUCT Contains all measured values
of the device as well as all
values calculated by the
driver.

Additionally, the structure


contains all bit masks
necessary for the
visualization.
Energy_Counter STRUCT Contains all energy counters
of the device.
Time_Between_Update TIME T#0s Specifies the time elapsed
since the last update of the
measured values.
Time_Between_Update_Max TIME T#0s Specifies the maximum time
between updating measured
values.
Time_Stamp_Meas_Values S7-300/ DT#1990 Time of the last update of the
S7-400: -01-01- measured values.
DT 00:00:00

S7-1200/
S7-1500:
DTL
Error_Location WORD W#16#0 Specifies the error cause and
location.
Error_Code DWORD DW#16# Specifies the error code of the
0 SFB or SFC which has
produced an error.
Time_Stamp_En_Count S7-300/ DT#1990 Time of the last update of the
S7-400: -01-01- energy counter.
DT 00:00:00

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 21
3 Interface Description of the Blocks
3.3 Function block E2M_AIEnergyMeter_DRV

Parameter Data type Default Description

S7-1200/
S7-1500:
DTL
Copyright Siemens AG 2015 All rights reserved

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 22
3 Interface Description of the Blocks
3.4 Function block E2M_SIMOCODE_PRO_V_DRV

3.4 Function block E2M_SIMOCODE_PRO_V_DRV


3.4.1 Function

This function block ensures the data exchange of the measured values for
PROFINET and PROFIBUS with a SIMOCODE pro V motor management system.
The function block supplies the measured data in a standardized structure and
transfers it to the E2M_VISU block for an S7-300 or S7-400, to an
E2M_1200_VISU block for an S7-1200, or to an E2M_1500_VISU block for an
S7-1500 respectively.
Furthermore, the standardized visualization is influenced via a bit mask. Values
which are no longer available are hidden via the bit mask.
Values calculated by the driver block are explicitly labeled via the bit mask.

The following values are determined by the block:


Minimum values
Maximum values
Average or total values
Copyright Siemens AG 2015 All rights reserved

3.4.2 Interfaces

Inputs
Table 3-10
Parameter Data type Default Description
ID S7-300/ 0 First input byte of the
S7-400: measuring device in HW
INT Config.

S7-1200/ - HW identifier of the device in


S7-1500: HW Config.
HW_IO
First_Byte_I_O_Data INT 0 First input byte of the
measuring device in the
hardware configuration.
Connection_Type INT 1 Connection variant of the
measuring device.

States:
1 1-phase
3 3-phase
Comm_Resource_Limit INT 4 Maximum number of
simultaneous SFB calls which
the drive can assign at the
same time.
Automatic_Update (optional) BOOL FALSE Specifies whether the data is
automatically updated
independent of the HMI.
Reset_Min_Max (optional) BOOL FALSE Resets all minimum and
maximum values of the block
with a positive edge.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 23
3 Interface Description of the Blocks
3.4 Function block E2M_SIMOCODE_PRO_V_DRV

Parameter Data type Default Description


Reset_Energy_Counter BOOL FALSE Resets all energy counters in
(optional) the measuring device with a
positive edge.
HMI_Bits_Connected BOOL FALSE Specifies whether an instance
of the HMI_Bits structure is
connected with the driver.
Comm_Type INT 1 Specifies the communication
protocol used.

States:
1 PROFINET
2 PROFIBUS
Set_Current_Is REAL REAL Set current of the connected
motor.
Nominal_Motor_Current REAL REAL Nominal current of the
connected motor.

When using an S7-1200 or S7-1500, the hardware identifier of the basic device
must be used for the ID parameter.
Copyright Siemens AG 2015 All rights reserved

Figure 3-6

Inputs and outputs


Table 3-11
Parameter Data type Default Description
HMI_Bits (optional) STRUCT Structure for the
communication between the
PC and visualization. If the
block is used without the
visualization, this parameter
needs not be interconnected.
Comm_Resource_Counter INT 0 Counter that specifies the
current number of
simultaneous SFB calls.
The tag used must be
interconnected with all drivers
which are to use the assigned
number of SFB calls.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 24
3 Interface Description of the Blocks
3.4 Function block E2M_SIMOCODE_PRO_V_DRV

Outputs
Table 3-12
Parameter Data type Default Description
Driver_Data STRUCT Contains all measured values
of the device as well as all
values calculated by the
driver.

Additionally, the structure


contains all bit masks
necessary for the
visualization.
Energy_Counter STRUCT Contains all energy counters
of the device.
Time_Between_Update TIME T#0s Specifies the time elapsed
since the last update of the
measured values.
Time_Between_Update_Max TIME T#0s Specifies the maximum time
between updating measured
values.
Time_Stamp_Meas_Values S7-300/ DT#1990 Time of the last update of the
Copyright Siemens AG 2015 All rights reserved

S7-400: -01-01- measured values.


DT 00:00:00

S7-1200/
S7-1500:
DTL
Error_Location (optional) WORD W#16#0 Specifies the error cause and
location.
Error_Code (optional) DWORD DW#16# Specifies the error code of the
0 SFB or SFC which has
produced an error.
Time_Stamp_En_Count S7-300/ DT#1990 Time of the last update of the
S7-400: -01-01- energy counter.
DT 00:00:00

S7-1200/
S7-1500:
DTL

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 25
3 Interface Description of the Blocks
3.5 Function block E2M_SIRIUS_3RR2441_DRV

3.5 Function block E2M_SIRIUS_3RR2441_DRV


3.5.1 Function

This function block ensures the data exchange of the measured values with a
SIRIUS 3RR2441 control device.
The function block supplies the measured data in a standardized structure and
transfers it to the E2M_VISU block for an S7-300 or S7-400, to an
E2M_1200_VISU block for an S7-1200, or to an E2M_1500_VISU block for an
S7-1500 respectively.
Furthermore, the standardized visualization is influenced via a bit mask. Values
which are no longer available are hidden via the bit mask.
Values calculated by the driver block are explicitly labeled via the bit mask.

The following values are determined by the block:


Minimum values
Maximum values
Average or total values
Copyright Siemens AG 2015 All rights reserved

NOTICE Using this block additionally requires the IO_LINK_DEVICE block.


You can download this block free of charge under entry ID 82981502 .

3.5.2 Interfaces

Inputs
Table 3-13
Parameter Data type Default Description
ID S7-300/ 0 First input byte of the
S7-400: measuring device in HW
INT Config.

S7-1200/ - Hardware identifier of the


S7-1500: measuring device in the HW
HW_IO Config.

First_Byte_I_O_Data INT 0 First input byte of the


measuring device in the
hardware configuration (only
for S7-1200 and S7-1500)
Comm_Resource_Limit INT 4 Maximum number of
simultaneous SFB calls which
the drive can assign at the
same time.
Automatic_Update (optional) BOOL FALSE Specifies whether the data is
automatically updated
independent of the HMI.
Reset_Min_Max (optional) BOOL FALSE Resets all minimum and
maximum values of the block
with a positive edge.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 26
3 Interface Description of the Blocks
3.5 Function block E2M_SIRIUS_3RR2441_DRV

Parameter Data type Default Description


HMI_Bits_Connected BOOL FALSE Specifies whether an instance
of the HMI_Bits structure is
connected with the driver.
PORT Int 0 Port number of the IO link
device.

0 Master

When using an S7-300 or S7-400, it must be noted that when connecting the ID
input, the address of the respective device IO link port must be added to the first
input byte of the respective device (IO link master) in the PCT tool.

Figure 3-7
Copyright Siemens AG 2015 All rights reserved

When using an S7-1200 or S7-1500, the hardware identifier of the respective IO


link master module must be specified for the ID parameter.
The identifier can be read in the module properties of the hardware configuration.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 27
3 Interface Description of the Blocks
3.5 Function block E2M_SIRIUS_3RR2441_DRV

Figure 3-8

The First_Byte_I_O_Data input must be supplied with the address of the first
input byte of the module. You need to add the address of the respective IO link port
to this value in the PCT tool.

Figure 3-9
Copyright Siemens AG 2015 All rights reserved

Inputs and outputs


Table 3-14
Parameter Data type Default Description
HMI_Bits (optional) STRUCT Structure for the
communication between the
PC and visualization. If the
block is used without the
visualization, this parameter
needs not be interconnected.
Comm_Resource_Counter INT 0 Counter that specifies the
current number of
simultaneous SFB calls.
The tag used must be
interconnected with all drivers
which are to use the assigned
number of SFB calls.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 28
3 Interface Description of the Blocks
3.5 Function block E2M_SIRIUS_3RR2441_DRV

Outputs
Table 3-15
Parameter Data type Default Description
Driver_Data STRUCT Contains all measured values
of the device as well as all
values calculated by the
driver.

Additionally, the structure


contains all bit masks
necessary for the
visualization.
Time_Between_Update TIME T#0s Specifies the time elapsed
since the last update of the
measured values.
Time_Between_Update_Max TIME T#0s Specifies the maximum time
between updating measured
values.
Time_Stamp_Meas_Values S7-300/ DT#1990 Time of the last update of the
S7-400: -01-01- measured values.
DT 00:00:00
Copyright Siemens AG 2015 All rights reserved

S7-1200/
S7-1500:
DTL
Error_Location WORD W#16#0 Specifies the error cause and
location.
Error_Code DWORD DW#16# Specifies the error code of the
0 SFB or SFC which has
produced an error.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 29
3 Interface Description of the Blocks
3.6 Function block E2M_SIRIUS_3UG4841_DRV

3.6 Function block E2M_SIRIUS_3UG4841_DRV


3.6.1 Function

This function block ensures the data exchange of the measured values with a
SIRIUS 3UG4841 control device.
The function block supplies the measured data in a standardized structure and
transfers it to the E2M_VISU block for an S7-300 or S7-400, to an
E2M_1200_VISU block for an S7-1200, or to an E2M_1500_VISU block for an
S7-1500 respectively.
Furthermore, the standardized visualization is influenced via a bit mask. Values
which are no longer available are hidden via the bit mask.
Values calculated by the driver block are explicitly labeled via the bit mask.

The following values are determined by the block:


Minimum values
Maximum values
Average or total values
Copyright Siemens AG 2015 All rights reserved

NOTICE Notice that using this block additionally requires the IO_LINK_DEVICE
block.
You can download this block free of charge under entry ID 82981502 .

3.6.2 Interfaces

Inputs
Table 3-16
Parameter Data type Default Description
ID S7-300/ 0 First input byte of the
S7-400: measuring device in HW
INT Config.

S7-1200/ - Hardware identifier of the


S7-1500: measuring device in the HW
HW_IO Config.

First_Byte_I_O_Data INT 0 First input byte of the


measuring device in the
hardware configuration.
Comm_Resource_Limit INT 4 Maximum number of
simultaneous SFB calls which
the drive can assign at the
same time.
Automatic_Update (optional) BOOL FALSE Specifies whether the data is
automatically updated
independent of the HMI.
Reset_Min_Max (optional) BOOL FALSE Resets all minimum and
maximum values of the block
with a positive edge.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 30
3 Interface Description of the Blocks
3.6 Function block E2M_SIRIUS_3UG4841_DRV

Parameter Data type Default Description


HMI_Bits_Connected BOOL FALSE Specifies whether an instance
of the HMI_Bits structure is
connected with the driver.
PORT Uint 0 Port number of the IO link
device.

0 master

When using an S7-300 or S7-400, it must be noted that when connecting the ID
input, the address of the respective device IO link port must be added to the first
input byte of the respective device (IO link master) in the PCT tool.

Figure 3-10
Copyright Siemens AG 2015 All rights reserved

When using an S7-1200 or S7-1500, the hardware identifier of the respective IO


link master module must be specified for the ID parameter.
The identifier can be read in the module properties of the hardware configuration.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 31
3 Interface Description of the Blocks
3.6 Function block E2M_SIRIUS_3UG4841_DRV

Figure 3-11

The First_Byte_I_O_Data input must be supplied with the address of the first
input byte of the module. You need to add the address of the respective IO link port
to this value in the PCT tool.

Figure 3-12
Copyright Siemens AG 2015 All rights reserved

Inputs and outputs


Table 3-17
Parameter Data type Default Description
HMI_Bits (optional) STRUCT Structure for the
communication between the
PC and visualization. If the
block is used without the
visualization, this parameter
needs not be interconnected.
Comm_Resource_Counter INT 0 Counter that specifies the
current number of
simultaneous SFB calls.
The tag used must be
interconnected with all drivers
which are to use the assigned
number of SFB calls.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 32
3 Interface Description of the Blocks
3.6 Function block E2M_SIRIUS_3UG4841_DRV

Outputs
Table 3-18
Parameter Data type Default Description
Driver_Data (optional) STRUCT Contains all measured values
of the device as well as all
values calculated by the
driver.

Additionally, the structure


contains all bit masks
necessary for the
visualization.
Time_Between_Update TIME T#0s Specifies the time elapsed
(optional) since the last update of the
measured values.
Time_Between_Update_Max TIME T#0s Specifies the maximum time
(optional) between updating measured
values.
Time_Stamp_Meas_Values S7-300/ DT#1990 Time of the last update of the
(optional) S7-400: -01-01- measured values.
DT 00:00:00
Copyright Siemens AG 2015 All rights reserved

S7-1200/
S7-1500:
DTL
Error_Location (optional) WORD W#16#0 Specifies the error cause and
location.
Error_Code (optional) DWORD DW#16# Specifies the error code of the
0 SFB or SFC which has
produced an error.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 33
3 Interface Description of the Blocks
3.7 Function block E2M_SIRIUS_3RW44_DRV

3.7 Function block E2M_SIRIUS_3RW44_DRV


3.7.1 Function

This function block ensures the data exchange of the measured values with a
SIRIUS 3RW44 soft starter via PROFIBUS and PROFINET.
The function block supplies the measured data in a standardized structure and
transfers it to the E2M_VISU block for an S7-300 or S7-400, to an
E2M_1200_VISU block for an S7-1200, or to an E2M_1500_VISU block for an
S7-1500 respectively.
Furthermore, the standardized visualization is influenced via a bit mask. Values
which are no longer available are hidden via the bit mask.
Values calculated by the driver block are explicitly labeled via the bit mask.

The following values are determined by the block:


Minimum values
Maximum values
Average or total values
Copyright Siemens AG 2015 All rights reserved

3.7.2 Interfaces

Inputs
Table 3-19
Parameter Data type Default Description
ID S7-300/ 0 First input byte of the
S7-400: measuring device in HW
INT Config.

S7-1200/ - Hardware identifier of the


S7-1500: measuring device in the HW
HW_IO Config.

First_Byte_I_O_Data INT 0 First input byte of the


measuring device in the
hardware configuration.
Comm_Resource_Limit INT 4 Maximum number of
simultaneous SFB calls which
the drive can assign at the
same time.
Automatic_Update (optional) BOOL FALSE Specifies whether the data is
automatically updated
independent of the HMI.
Reset_Min_Max (optional) BOOL FALSE Resets all minimum and
maximum values of the block
with a positive edge.
HMI_Bits_Connected BOOL FALSE Specifies whether an instance
of the HMI_Bits structure is
connected with the driver.
PORT Uint 0 Port number of the IO link
device.

0 master

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 34
3 Interface Description of the Blocks
3.7 Function block E2M_SIRIUS_3RW44_DRV

When using an S7-1200 or S7-1500, the hardware identifier of the communication


module must be used for the ID parameter.

Figure 3-13

Inputs and outputs


Table 3-20
Parameter Data type Default Description
HMI_Bits (optional) STRUCT Structure for the
communication between the
PC and visualization. If the
Copyright Siemens AG 2015 All rights reserved

block is used without the


visualization, this parameter
needs not be interconnected.
Comm_Resource_Counter INT 0 Counter that specifies the
current number of
simultaneous SFB calls.
The tag used must be
interconnected with all drivers
which are to use the assigned
number of SFB calls.

Outputs
Table 3-21
Parameter Data type Default Description
Driver_Data (optional) STRUCT Contains all measured values
of the device as well as all
values calculated by the
driver.

Additionally, the structure


contains all bit masks
necessary for the
visualization.
Time_Between_Update TIME T#0s Specifies the time elapsed
(optional) since the last update of the
measured values.
Time_Between_Update_Max TIME T#0s Specifies the maximum time
(optional) between updating measured
values.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 35
3 Interface Description of the Blocks
3.7 Function block E2M_SIRIUS_3RW44_DRV

Parameter Data type Default Description


Time_Stamp_Meas_Values S7-300/ DT#1990 Time of the last update of the
(optional) S7-400: -01-01- measured values.
DT 00:00:00

S7-1200/
S7-1500:
DTL
Error_Location (optional) WORD W#16#0 Specifies the error cause and
location.
Error_Code (optional) DWORD DW#16# Specifies the error code of the
0 SFB or SFC which has
produced an error.
Copyright Siemens AG 2015 All rights reserved

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 36
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

3.8 Function block E2M_3VA_DRV

NOTICE For the communication via PROFIBUS, please note that this block can be
used for PROFIBUS module 7KM9300-0AB01-0AA0 as of firmware version
V2.0.
For the communication via PROFINET, please note that this block can be
used for PROFINET module 7KM9300-0AB01-0AA0 as of firmware version
V2.1.

3.8.1 Function

This function block ensures the data exchange of the measured values for
PROFINET and PROFIBUS with a 3VA compact circuit-breaker (breaker).
The number of 3VA compact circuit-breakers that can be connected at a data
concentrator depends on the type of the data concentrator.

Table 3-22
Copyright Siemens AG 2015 All rights reserved

Data concentrator Max. Number of 3VA compact circuit-breakers


COM100 1
COM800 8

The communication occurs between the CPU and the PB or PN module plugged in
the data concentrator. The data concentrator directs the message frames to the
addressed 3VA compact circuit-breaker.
The 3 VA compact circuit-breakers can obtain address 1 to 8. The address is equal
to the slot in the hardware configuration in Step 7.
The function block supplies the measured data in a standardized structure and
transfers it to the E2M_VISU block for an S7-300 or S7-400, to an
E2M_1200_VISU block for an S7-1200, or to an E2M_1500_VISU block for an
S7-1500 respectively.
Furthermore, the standardized visualization is influenced via a bit mask. Values
which are no longer available are hidden via the bit mask.
Values calculated by the driver block are explicitly labeled via the bit mask.

Note This block does not work with the default Modbus/TCP interface of the data
concentrator.
For using the block you need the separately available PROFIBUS or PROFINET
module.
Further information on the modules is available in entry ID 26504884 for the
PROFIBUS module and entry ID 26504372 for the PROFINET module.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 37
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

3.8.2 Interfaces

Inputs
Table 3-23
Parameter Data type Default Description
ID S7-300/ 0 PROFIBUS: 1. Input address of the
S7-400: COM device in HW Config.
INT PROFINET: diagnostic address of
the breaker in HW Config
PROFIBUS: HW ID of the breaker in
S7-1200/ - the device view
S7-1500: PROFINET: HW ID of COM060 in
HW_IO the device view.
First_Byte_I_O_Data INT 0 First input byte of the measuring
device in the hardware configuration
(control/status bytes).
Connection_Type INT 1 Connection variant of the measuring
device.
States:
1 1-phase
11 3-phase
Copyright Siemens AG 2015 All rights reserved

4 3-phase with neutral cable


Comm_Resource_Limit INT 4 Maximum number of simultaneous
SFB calls which the driver can assign
at the same time.
Automatic_Update BOOL FALSE Specifies whether the data is
(optional) automatically updated independent of
the HMI.
Reset_Min_Max BOOL FALSE Resets all minimum and maximum
(optional) values of the block with a positive
edge.
Reset_Energy_Counter BOOL FALSE Resets all energy counters in the
(optional) measuring device with a positive
edge.
HMI_Bits_Connected BOOL FALSE Specifies whether an instance of the
(optional) HMI_Bits structure is connected with
the driver.
Note: this parameter needs not be
interconnected when using STEP 7
V5.5.
Comm_Type INT 1 Specifies the protocol used for
communicating with the device.
States:
1 PROFINET
2 PROFIBUS
Min_Max_Calculated BOOL TRUE Specifies whether the minimum and
maximum values are calculated or
directly read from the device
States:
TRUE Values are calculated
FALSE Values are read
Breaker_Active INT 0 Breaker address of the device, from
which the data is currently processed

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 38
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

Parameter Data type Default Description


Breaker_Address INT 0 Breaker address of the 3VA switch
possible values: 1 to 8
ETU type INT 8 ETU type, only ETU8xx is supported
at present

Note The identifier as optional parameter only applies when using the visualization.

The following applies for PROFINET:


When using an S7-1200 or S7-1500, the hardware identifier of the configured
COM060 must be specified for the ID parameter and can be viewed in the
device view.
Figure 3-14
Copyright Siemens AG 2015 All rights reserved

The First_Byte_I_O_Data input must be supplied with the first output byte of
the control byte.
Figure 3-15

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 39
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

The following applies for PROFIBUS:


When using an S7-1200 or S7-1500, the hardware identifier of the configured
breaker must be specified for the ID parameter and can be viewed in the
device view.
Figure 3-16
Copyright Siemens AG 2015 All rights reserved

Inputs and outputs


Table 3-24
Parameter Data type Start value Description
HMI_Bits STRUCT Structure for the
communication between
the PC and visualization.
If the block is used
without the visualization,
this parameter needs not
be interconnected.
Comm_Resource_Counter INT 0 Counter that specifies
the current number of
simultaneous SFB calls.
The tag used must be
interconnected with all
drivers which are to use
the assigned number of
SFB calls.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 40
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

Outputs
Table 3-25
Parameter Data Start value Description
type
Driver_Data (optional) STRUCT Contains all measured
values of the device as
well as all values
calculated by the driver.
- energy counter 32 bit
format.

Additionally, the structure


contains all bit masks
necessary for the
visualization.
Energy_Counter (optional) STRUCT Contains all energy
counters of the device in
64 bit format.
Additionally, the structure
contains all bit masks
necessary for the
visualization.
Copyright Siemens AG 2015 All rights reserved

Time_Between_Update TIME T#0MS Specifies the time elapsed


(optional) since the last update of the
measured values.
Time_Between_Update_Max TIME T#0MS Specifies the maximum
(optional) time elapsed since the last
update of the measured
values.
Time_Stamp_Meas_Values S7-300/ DT#1990-01-01- Time of the last update of
(optional) S7-400: 00:00:00 the measured values.
DT

S7-1200/
S7-1500:
DTL
Error_Location (optional) WORD W#16#0 Specifies the error cause
and location.
Error_Code (optional) DWORD DW#16#0 Specifies the error code of
the SFB or SFC which has
produced an error.
Breaker_Adr_State WORD W#16#0 Breaker address and
status of the block

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 41
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

3.8.3 Error codes

Table 3-26
Error_Location Error_Code Description
Error when resetting the energy counters
0x1311 SFB 53 or minimum and maximal values or when
requesting the measured values.
Error during the update of measured
0x1321 SFB 52
values.
The selected measuring variant is not
available. Available values for the 3VA are
0x1372 DW#16#1
1 (1-phase measurement) and 3 (3-phase
measurement).
No resources have been assigned to the
0x1373 DW#16#1
driver for communication.
No resources counters have been
0x1376 DW#16#1 assigned to the driver
(Comm_Resource_Counter).
The selected communication type is
0x1377 DW#16#1 invalid. PROFINET and PROFIBUS are
valid for Comm_Type.
The selected ETU type is invalid. Currently
0x1382 DW#16#1
only ETU type = 8 is supported.
0x1383 DW#16#1 Wrong breaker address, 1-8 is possible
Copyright Siemens AG 2015 All rights reserved

Resource limit = 0; currently no measured


0x1384 DW#16#1
values are read
The block type in the PROFIenergy
0x1391 DW#16#1
response is invalid.
The service request ID in the
0x1392 DW#16#1
PROFIenergy response is invalid.
The reference in the PROFIenergy
0x1393 DW#16#1
response is not equal to the requirement.
The status in the PROFIenergy response
0x1394 DW#16#1
is not correct.
The data structure ID in the PROFIenergy
0x1395 DW#16#1
response is not correct.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 42
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

3.8.4 Function block E2M_3VA_COORD

Data concentrator COM800 cannot read the values from all connected breakers
simultaneously. This makes sequential reading necessary.
A separate 3VA_E2M_DRV block instance must be called for each breaker.
To prevent the breakers connected at the same COM800 from polling data
simultaneously, they need to be coordinated. This task is performed by the
E2M_3VA_COORD.

Overview:
Abbildung 3-17

E2M_3VA_DRV E2M_3VA_COORD
Breaker_Active Breaker_Adr_State Breaker_1 Breaker
Active
Breaker_2

E2M_3VA_DRV
Breaker_3

Breaker_Active
Breaker_4
Breaker_Adr_State
Copyright Siemens AG 2015 All rights reserved

Breaker_5

E2M_3VA_DRV Breaker_6

Breaker_Active Breaker_Adr_State Breaker_7


Breaker_8

The coordination block has 8 inputs: Breaker_1 to Breaker_8. These inputs are
connected to the Breaker_Adr_State outputs of the individual 3VA_E2M_DRV
instances. Not all 8 inputs must be used.
The breaker address for the breaker in which the data is currently processed is
output at output parameter Breaker_Active. This output is connected with each
Breaker_Active input parameter of the connected 3 VA instances.
Only one breaker at a time can be active. As soon as the data of the active breaker
was read, the coordination block activates the next breaker by outputting the next
breaker address.
If parameter Breaker_Active does not contain the own breaker address, the drive
block is not processed.
If a breaker is not currently edited, it retains the data in the data structures that it
provides to the visualization. The last read values are displayed until they are read
and updated again.

A maximum of 1 breaker can be connected to a COM100 data concentrator. In this


case, the Breaker_Activate input must be supplied with the address of the
breaker (input Breaker_Address).
Using the E2M_3VA_COORD and interconnecting the Breaker_Adr_State
output is not necessary.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 43
3 Interface Description of the Blocks
3.8 Function block E2M_3VA_DRV

3.8.5 Interfaces

Inputs
Table 3-27
Parameter Data Default Description
type
Breaker_1 WORD 0 1. byte: 1. Breaker address
2. byte: Status (00 inactive; 01
running; 02 finished)
Breaker_2 WORD 0 1. byte: 2. Breaker address
2. byte: Status (00 inactive; 01
running; 02 finished)
Breaker_3 WORD 0 1. byte: 3. Breaker address
2. byte: Status (00 inactive; 01
running; 02 finished)
Breaker_4 WORD 0 1. byte: 4. Breaker address
2. byte: Status (00 inactive; 01
running; 02 finished)
Breaker_5 WORD 0 1. byte: 5. Breaker address
2. byte: Status (00 inactive; 01
Copyright Siemens AG 2015 All rights reserved

running; 02 finished)
Breaker_6 WORD 0 1. byte: 6. Breaker address
2. byte: Status (00 inactive; 01
running; 02 finished)
Breaker_7 WORD 0 1. byte: 7. Breaker address
2. byte: Status (00 inactive; 01
running; 02 finished)
Breaker_8 WORD 0 1. byte: 8. Breaker address
2. byte: Status (00 inactive; 01
running; 02 finished)
Reset BOOL FALSE Resets the block

Outputs
Table 3-28
Parameter Data Start value Description
type
Breaker_Active INT 0 Breaker address of the
3VA switch to be edited at
this moment

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 44
3 Interface Description of the Blocks
3.9 Error and status codes

3.9 Error and status codes


3.9.1 Error codes

Table 3-29
Error_Location Error_Code Description
W#16#1311 Status Error when writing the first job with
WRREC PROFIenergy: for reading the measured
values.
W#16#1312 Status Error when writing the second job with
WRREC PROFIenergy for reading the measured
values.
W#16#1313 Status Error when writing the job with PROFIBUS
WRREC for fetching the measured values.

W#16#1314 Status Error when writing the job with PROFIBUS


WRREC for fetching the minimum/maximum values.

W#16#1321 Status Error when reading the measured values


RDREC with PROFIenergy.
W#16#1322 Status Error when reading the energy counter
Copyright Siemens AG 2015 All rights reserved

RDREC with PROFIenergy.


W#16#1323 Status Error when reading the measured values
RDREC with PROFIBUS.
W#16#1324 Status Error when reading the
RDREC minimum/maximum values with
PROFIBUS.
W#16#1371 1 The input parameter ID is outside the
permitted limit.
W#16#1372 1 Input parameter Connection_Type is not
valid.
W#16#1373 1 Input parameter Comm_Resource_Limit
is outside the permitted limit.
W#16#1374 1 Input parameter First_Byte_IO_Data is
outside the permitted limit.
W#16#1375 1 Input parameter
Backup_Cycle_En_Count is outside the
limit.
W#16#1376 1 Input parameter Port is outside the limit.
W#16#1377 1 Input parameter Comm_Type is not valid.
W#16#1378 1 Input parameter Nominal_Motor_Current
is not valid.
W#16#1379 1 Input parameter Set_Current_Is is not
valid.
The supply voltage of the module/device
W#16#1381 1
has failed.
The PROFIenergy response of SENTRON
W#16#1390 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1391 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1392 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1393 1 PAC is not valid.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 45
3 Interface Description of the Blocks
3.9 Error and status codes

Error_Location Error_Code Description


The PROFIenergy response of SENTRON
W#16#1394 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1395 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1396 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1397 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1398 1
PAC is not valid.
The PROFIenergy response of SENTRON
W#16#1399 1
PAC is not valid.

3.9.2 Status codes

Table 3-30
Error_Location Error_Code Description
W#16#7000 0 Block waits for new job.
W#16#7001 0 Wait for free communication resource.
Copyright Siemens AG 2015 All rights reserved

W#16#7002 0 Reading the measured values.


W#16#7003 0 Resetting of the minimum and maximum
values.
W#16#7004 0 Resetting the energy counters.
W#16#7005 0 Energy counters restored.
W#16#7006 0 Energy counters stored.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 46
4 Bit Masks for Dynamization of the Visualization
4.1 General

4 Bit Masks for Dynamization of the


Visualization
4.1 General
Uniform visualization of energy data enables transferring the bit masks
independent of the used measuring device.
The data structure contains several tags (PLC tags), which contain a bit mask for
dynamization of the visualization. One or several objects are then enabled or
disabled depending on a bit of this tag.
These bit masks are not only used to enable or disable available objects, but also
to show and hide an indicator when a measured value has been calculated by the
driver block.
The following figure shows a section of the visualization for SIMATIC HMI Comfort
Panels. The symbol in the red frame indicates that a measured value has been
calculated.
Figure 4-1
Copyright Siemens AG 2015 All rights reserved

During the visualization for WinCC V7, a measured value is displayed in italics if it
was calculated by the driver.
Figure 4-2

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 47
4 Bit Masks for Dynamization of the Visualization
4.2 Indicators for calculated measured values

4.2 Indicators for calculated measured values


Table 4-1
PLC tag Bit (visualization) Object (visualization)
CalculateValue1 8 U_L1L2_MIN
CalculateValue1 9 U_L1L2_MAX
CalculateValue1 10 U_L2L3_MIN
CalculateValue1 11 U_L2L3_MAX
CalculateValue1 12 U_L3L1_MIN
CalculateValue1 13 U_L3L1_MAX
CalculateValue1 14 U_L1N_MIN
CalculateValue1 15 U_L1N_MAX
CalculateValue1 0 U_L2N_MIN
CalculateValue1 1 U_L2N_MAX
CalculateValue1 2 U_L3N_MIN
CalculateValue1 3 U_L3N_MAX
CalculateValue1 4 Reserved
CalculateValue1 5 Reserved
Copyright Siemens AG 2015 All rights reserved

CalculateValue1 6 Reserved
CalculateValue1 7 Reserved

Table 4-2
PLC tag Bit (visualization) Object (visualization)

CalculateValue2 8 U_PH_PH_Average
CalculateValue2 9 U_PH_PH_Average_MIN
CalculateValue2 10 U_PH_PH_Average_MAX
CalculateValue2 11 U_PH_N_Average
CalculateValue2 12 U_PH_N_Average_MIN
CalculateValue2 13 U_PH_N_Average_MAX
CalculateValue2 14 I_L1_MIN
CalculateValue2 15 I_L1_MAX
CalculateValue2 0 I_L2_MIN
CalculateValue2 1 I_L2_MAX
CalculateValue2 2 I_L3_MIN
CalculateValue2 3 I_L3_MAX
CalculateValue2 4 I_Average
CalculateValue2 5 I_Average_MIN
CalculateValue2 6 I_Average_MAX
CalculateValue2 7 Reserved

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 48
4 Bit Masks for Dynamization of the Visualization
4.2 Indicators for calculated measured values

Table 4-3
PLC tag Bit (visualization) Object (visualization)
CalculateValue3 8 S_L1
CalculateValue3 9 S_L1_MIN
CalculateValue3 10 S_L1_MAX
CalculateValue3 11 S_L2
CalculateValue3 12 S_L2_MIN
CalculateValue3 13 S_L2_MAX
CalculateValue3 14 S_L3
CalculateValue3 15 S_L3_MIN
CalculateValue3 0 S_L3_MAX
CalculateValue3 1 S_Total
CalculateValue3 2 S_Total_MIN
CalculateValue3 3 S_Total_MAX
CalculateValue3 4 Reserved
CalculateValue3 5 Reserved
CalculateValue3 6 Reserved
CalculateValue3 7 Reserved
Copyright Siemens AG 2015 All rights reserved

Table 4-4
PLC tag Bit (visualization) Object (visualization)
CalculateValue4 8 P_L1
CalculateValue4 9 P_L1_MIN
CalculateValue4 10 P_L1_MAX
CalculateValue4 11 P_L2
CalculateValue4 12 P_L2_MIN
CalculateValue4 13 P_L2_MAX
CalculateValue4 14 P_L3
CalculateValue4 15 P_L3_MIN
CalculateValue4 0 P_L3_MAX
CalculateValue4 1 P_Total
CalculateValue4 2 P_Total_MIN
CalculateValue4 3 P_Total_MAX
CalculateValue4 4 Reserved
CalculateValue4 5 Reserved
CalculateValue4 6 Reserved
CalculateValue4 7 Reserved

Table 4-5
PLC tag Bit (visualization) Object (visualization)
CalculateValue5 8 Q_L1
CalculateValue5 9 Q_L1_MIN
CalculateValue5 10 Q_L1_MAX

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 49
4 Bit Masks for Dynamization of the Visualization
4.3 Visibility of the measured values

PLC tag Bit (visualization) Object (visualization)


CalculateValue5 11 Q_L2
CalculateValue5 12 Q_L2_MIN
CalculateValue5 13 Q_L2_MAX
CalculateValue5 14 Q_L3
CalculateValue5 15 Q_L3_MIN
CalculateValue5 0 Q_L3_MAX
CalculateValue5 1 Q_Total
CalculateValue5 2 Q_Total_MIN
CalculateValue5 3 Q_Total_MAX
CalculateValue5 4 Reserved
CalculateValue5 5 Reserved
CalculateValue5 6 Reserved
CalculateValue5 7 Reserved

Table 4-6
PLC tag Bit (visualization) Object (visualization)
Copyright Siemens AG 2015 All rights reserved

CalculateValue6 8 Cos _L1_MIN


CalculateValue6 9 Cos _L1_MAX
CalculateValue6 10 Cos _L2_MIN
CalculateValue6 11 Cos _L2_MAX
CalculateValue6 12 Cos _L3_MIN
CalculateValue6 13 Cos _L3_MAX
CalculateValue6 14 Cos _Total
CalculateValue6 15 Cos _Total_MIN
CalculateValue6 0 Cos _Total_MAX
CalculateValue6 1 f_MIN
CalculateValue6 2 f_MAX
CalculateValue6 3 Reserved
CalculateValue6 4 Reserved
CalculateValue6 5 Reserved
CalculateValue6 6 Reserved
CalculateValue6 7 Reserved

4.3 Visibility of the measured values


Voltage (PH-PH)
Table 4-7
PLC tag Bit (visualization) Object (visualization)
U_PH_PH_Mod 8 U_L1L2
U_PH_PH_Mod 9 U_L2L3
U_PH_PH_Mod 10 U_L3L1
U_PH_PH_Mod 11 U_PH_PH_Average

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 50
4 Bit Masks for Dynamization of the Visualization
4.3 Visibility of the measured values

PLC tag Bit (visualization) Object (visualization)


U_PH_PH_Mod 12 U_L1L2 MIN/MAX
U_PH_PH_Mod 13 U_L2L3 MIN/MAX
U_PH_PH_Mod 14 I_L3L1 MIN/MAX
U_PH_PH_Mod 15 U_PH_PH Average
MIN/MAX
U_PH_PH_Mod 0 Reserved
U_PH_PH_Mod 1 Reserved
U_PH_PH_Mod 2 Reserved
U_PH_PH_Mod 3 Reserved
U_PH_PH_Mod 4 Reserved
U_PH_PH_Mod 5 Reserved
U_PH_PH_Mod 6 Reserved
U_PH_PH_Mod 7 No voltage (PH-PH)
(Value=FALSE)

Voltage (PH-N)
Copyright Siemens AG 2015 All rights reserved

Table 4-8
PLC tag Bit (visualization) Object (visualization)
U_PH_N_Mod 8 U_L1_N
U_PH_N_Mod 9 U_L2_N
U_PH_N_Mod 10 U_L3_N
U_PH_N_Mod 11 U_PH_N_Average
U_PH_N_Mod 12 U_L1_N MIN/MAX
U_PH_N_Mod 13 U_L2_N MIN/MAX
U_PH_N_Mod 14 U_L3_N MIN/MAX
U_PH_N_Mod 15 U_PH_N_Average
MIN/MAX
U_PH_N_Mod 0 Reserved
U_PH_N_Mod 1 Reserved
U_PH_N_Mod 2 Reserved
U_PH_N_Mod 3 Reserved
U_PH_N_Mod 4 Reserved
U_PH_N_Mod 5 Reserved
U_PH_N_Mod 6 Reserved
U_PH_N_Mod 7 No voltage (PH-N) (Value =
FALSE)

Current
Table 4-9
PLC tag Bit (visualization) Object (visualization)
I_Mod 8 I_L1
I_Mod 9 I_L2

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 51
4 Bit Masks for Dynamization of the Visualization
4.3 Visibility of the measured values

PLC tag Bit (visualization) Object (visualization)


I_Mod 10 I_L3
I_Mod 11 I_Average
I_Mod 12 I_L1 MIN/MAX
I_Mod 13 I_L2 MIN/MAX
I_Mod 14 I_L3 MIN/MAX
I_Mod 15 I_Average MIN/MAX
I_Mod 0 Reserved
I_Mod 1 Reserved
I_Mod 2 Reserved
I_Mod 3 Reserved
I_Mod 4 Reserved
I_Mod 5 Reserved
I_Mod 6 Reserved
I_Mod 7 No current
(Value = FALSE)
Copyright Siemens AG 2015 All rights reserved

Apparent power
Table 4-10
PLC tag Bit (visualization) Object (visualization)
S_Mod 8 S_L1
S_Mod 9 S_L2
S_Mod 10 S_L3
S_Mod 11 S_Total
S_Mod 12 S_L1 MIN/MAX
S_Mod 13 S_L2 MIN/MAX
S_Mod 14 S_L3 MIN/MAX
S_Mod 15 S_Total MIN/MAX
S_Mod 0 Reserved
S_Mod 1 Reserved
S_Mod 2 Reserved
S_Mod 3 Reserved
S_Mod 4 Reserved
S_Mod 5 Reserved
S_Mod 6 Reserved
S_Mod 7 No apparent power
(Value = FALSE)

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 52
4 Bit Masks for Dynamization of the Visualization
4.3 Visibility of the measured values

Active power
Table 4-11
PLC tag Bit (visualization) Object (visualization)
P_Mod 8 P_L1
P_Mod 9 P_L2
P_Mod 10 P_L3
P_Mod 11 P_Total
P_Mod 12 P_L1 MIN/MAX
P_Mod 13 P_L2 MIN/MAX
P_Mod 14 P_L3 MIN/MAX
P_Mod 15 P_Total MIN/MAX
P_Mod 0 Reserved
P_Mod 1 Reserved
P_Mod 2 Reserved
P_Mod 3 Reserved
P_Mod 4 Reserved
P_Mod 5 Reserved
Copyright Siemens AG 2015 All rights reserved

P_Mod 6 Reserved
P_Mod 7 No active power
(Value = False)

Reactive power
Table 4-12
PLC tag Bit (visualization) Object (visualization)
Q_Mod 8 Q_L1
Q_Mod 9 Q_L2
Q_Mod 10 Q_L3
Q_Mod 11 Q_Total
Q_Mod 12 Q_L1 MIN/MAX
Q_Mod 13 Q_L2 MIN/MAX
Q_Mod 14 Q_L3 MIN/MAX
Q_Mod 15 Q_Total MIN/MAX
Q_Mod 0 Reserved
Q_Mod 1 Reserved
Q_Mod 2 Reserved
Q_Mod 3 Reserved
Q_Mod 4 Reserved
Q_Mod 5 Reserved
Q_Mod 6 Reserved
Q_Mod 7 No reactive power
(Value = False)

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 53
4 Bit Masks for Dynamization of the Visualization
4.3 Visibility of the measured values

Energy (counter)
Table 4-13
PLC tag Bit (visualization) Object (visualization)
E_Mod 8 Active rate 1 import
E_Mod 9 Active rate 1 export
E_Mod 10 Active rate 2 import
E_Mod 11 Active rate 2 export
E_Mod 12 Reactive rate 1 import
E_Mod 13 Reactive rate 1 export
E_Mod 14 Reactive rate 2 import
E_Mod 15 Reactive rate 2 export
E_Mod 0 Apparent rate 1 import
E_Mod 1 Apparent rate 2 import
E_Mod 2 Reserved
E_Mod 3 Reserved
E_Mod 4 Reserved
E_Mod 5 Reserved
Copyright Siemens AG 2015 All rights reserved

E_Mod 6 Reserved
E_Mod 7 No energy (counter) (Value
= FALSE)

Frequency
Table 4-14
PLC tag Bit (visualization) Object (visualization)
f_Mod 8 Frequency
f_Mod 9 Frequency MIN/MAX
f_Mod 10 Reserved
f_Mod 11 Reserved
f_Mod 12 Reserved
f_Mod 13 Reserved
f_Mod 14 Reserved
f_Mod 15 Reserved
f_Mod 0 Reserved
f_Mod 1 Reserved
f_Mod 2 Reserved
f_Mod 3 Reserved
f_Mod 4 Reserved
f_Mod 5 Reserved
f_Mod 6 Reserved
f_Mod 7 No frequency
(Value = FALSE)

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 54
4 Bit Masks for Dynamization of the Visualization
4.3 Visibility of the measured values

Power factor (Cos-Phi)


Table 4-15
PLC tag Bit (visualization) Object (visualization)
Cos_Mod 8 Cos_L1
Cos_Mod 9 Cos_L2
Cos_Mod 10 Cos_L3
Cos_Mod 11 Cos_Average
Cos_Mod 12 Cos_L1 MIN/MAX
Cos_Mod 13 Cos_L2 MIN/MAX
Cos_Mod 14 Cos_L3 MIN/MAX
Cos_Mod 15 Cos_Average MIN/MAX
Cos_Mod 0 Reserved
Cos_Mod 1 Reserved
Cos_Mod 2 Reserved
Cos_Mod 3 Reserved
Cos_Mod 4 Reserved
Cos_Mod 5 Reserved
Copyright Siemens AG 2015 All rights reserved

Cos_Mod 6 Reserved
Cos_Mod 7 No power factor
(Value = FALSE)

User-defined measured values


Table 4-16
PLC tag Value Object (visualization)
Add_Value_Count 1 AddValue 1
Add_Value_Count 2 AddValue 2
Add_Value_Count 3 AddValue 3
Add_Value_Count 4 AddValue 4
Add_Value_Count 5 AddValue 5
Add_Value_Count 6 AddValue 6
Add_Value_Count 7 AddValue 7
Add_Value_Count 8 AddValue 8
Add_Value_Count 9 AddValue 9
Add_Value_Count 10 AddValue 10
Add_Value_Count 11 AddValue 11
Add_Value_Count 12 AddValue 12

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 55
5 General Notes
5.1 Prioritizing the communication resources

5 General Notes
5.1 Prioritizing the communication resources
Through dividing the measuring points to be recorded into several groups,
preferred processing of individual measuring points can be achieved.

Example
The data of 10 measuring points shall be recorded in a plant.
An S7-319 3PN/DP is used which enables simultaneous calling of 8 SFBs.
Measuring points 1-4 shall be processed with preference.
Measuring points 5-10 can temporarily be neglected.
When calling the respective driver block for measuring points 1-4, value 4 is
transferred to the Comm_Resource_Limit parameter. Therefore, one SFB call is
reserved for each measuring point.
For measuring points 5-10, a value of 4 is transferred to the
Comm_Resource_Limit parameter.
In this case, 6 measuring points must share only 4 SFB calls. This delays the
update of the values.
Copyright Siemens AG 2015 All rights reserved

For both groups, an independent tag must be connected at the


Comm_Resource_Counter parameter (e.g.
Comm_Resource_Counter_HighPrio and Comm_Resource_Counter_LowPrio)

Note The total of the values at the Comm_Resource_Limit parameter must not
exceed the maximum number of SFB calls of your CPU.

5.2 Error Obs


When resetting the values in a measuring device (MIN/MAX values or energy
counters) it is possible that the device might not be accessible via the process bus
for a short time.

Note Only for 7KM PAC3200 and 7KM PAC4200.

Therefore, the program must contain organization blocks OB82 and OB86 in
STEP 7 V5.5, or I/O FLT1 in TIA Portal respectively, especially for controllers of
the S7-300 and S7-400 family.

5.3 Communication via CPs


Communication via CPs is not supported.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 56
6 Acquisition of Energy Data with STEP 7 V5.5
6.1 Preparation

6 Acquisition of Energy Data with


STEP 7 V5.5
6.1 Preparation
Copying the program blocks
Table 6-1
No. Action
1. Download the 86299299_E2M_Classic.zip file.
2. Unzip the file with a respective program (e.g. 7zip).
3. Open the previously unzipped block E2M library with STEP 7.
4. Open the project to which the application code shall be integrated.

Creating a hardware configuration


The following chapters show an example of energy data acquisition with a 7KM
PAC3200 measuring device.
Follow the instructions in the table below to configure the device correctly.
Copyright Siemens AG 2015 All rights reserved

Table 6-2
No. Action Remark
5. Open the hardware catalog and select the
PAC3200 device.
(Available for PROFINET and PROFIBUS)

6. Add the device into the project and connect it


with the respective bus system.

7. Select the device.


8. Go to the hardware catalog and open the
PAC3200 node.
Then select a measured value at random.

Note: You should select a single measured


value (e.g. voltage L1-N) in order to keep the
size of the data in the process image low.
The driver block can nevertheless read all of
the data of the measuring device.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 57
6 Acquisition of Energy Data with STEP 7 V5.5
6.2 Creating an S7 program

No. Action Remark


9. Drag the measured value into the device
configuration using drag&drop.

Note: The size of the data in the process


image results from the difference between the
first and the last input address of the value.
10. Repeat step 4 and step 5 for the Control
Bytes parameter.

11. Save and compile the hardware configuration.

6.2 Creating an S7 program


6.2.1 Copy blocks to the project

Table 6-3
Copyright Siemens AG 2015 All rights reserved

No. Action Remark


1. Open the E2M library in STEP 7 V5.5 and
navigate to the Blocks folder via the
navigation tree.

2. Select all blocks you need in your project.

Note: For each measuring device, the


respective driver block as well as the
E2M_VISU block (FB42) and the E2M_64
(FB43) block are required.

3. Drag the blocks into the Blocks folder of the


target device via drag&drop (e.g. S7-300).

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 58
6 Acquisition of Energy Data with STEP 7 V5.5
6.2 Creating an S7 program

6.2.2 Calling blocks in the S7 program

Table 6-4
No. Action Remark
1. Create a new PLC tag of type INT (e.g.
Comm_Resource_Counter)

2. Create an instance data block for the


E2M_VISU block.
3. Open the Special Object Properties >
Operator Control and Monitoring menu via the
context menu of the instance data block.
Enable the Operator Control and Monitoring
option and confirm the dialog by pressing the
Save button.

4. Create an instance data block for the driver


block of your measuring device (e.g.
E2M_SENTRON_PAC_DRV).
5. Open the OB1 organization block.
Copyright Siemens AG 2015 All rights reserved

6. Call the driver block of the measuring device


from which you wish to read the data (e.g.
7KM PAC3200).
7. Connect the parameters of the driver block.
(e.g. E2M_SENTRON_PAC_DRV)
A description of the parameters is available in
Chapter 3.2.

Note: The right hand figure is only an example


and may deviate from your configuration.

8. Call the E2M_VISU block.


9. Connect the parameters of the E2M_Visu
block.
A description of the parameters is available in
Chapter 3.1.

Note: The right hand figure is only an example


and may deviate from your configuration.

10. Open the OB100 organization block.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 59
6 Acquisition of Energy Data with STEP 7 V5.5
6.2 Creating an S7 program

No. Action Remark


11. Copy the call of the E2M_VISU and
E2M_SENTRON_PAC_DRV blocks from
OB1 and add these into the program code of
OB100.

Note Steps 2-11 need to be performed for each measuring point to be visualized.
Copyright Siemens AG 2015 All rights reserved

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 60
7 Acquisition of Energy Data with STEP 7 V13
7.1 Preparation

7 Acquisition of Energy Data with


STEP 7 V13
7.1 Preparation
Table 7-1
No. Action
1. Download the 86299299_E2M_TIA.zip file.
2. Unzip the file with a respective program (e.g. 7zip).
3. Open the previously unzipped library
in TIA Portal.
4. Open the project to which the application code shall be integrated.

7.1.1 Creating a hardware configuration

The following chapters discuss the acquisition of energy data of an energy meter
module for the ET 200SP module using an S7-1500.
Follow the instructions in the table below to configure the device correctly.
Copyright Siemens AG 2015 All rights reserved

Table 7-2
No. Action Remark
1. Open the network view of the TIA Portal.
2. Open the hardware catalog and select the IM
155-6 PN ST device in ET 200SP.

Note: In order to be able to configure the ET


200SP with an energy meter via the hardware
catalog, a hardware support package might
first have to be installed.
The hardware support package is available for
download under the entry ID 72341852 .

3. Add the device into the project and assign a


valid IP address.
Then connect the device to the respective bus
system of the S7 controller.

4. Open the device view of the previously


configured ET 200SP.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 61
7 Acquisition of Energy Data with STEP 7 V13
7.1 Preparation

No. Action Remark


5. Add all your existing modules into the
hardware configuration.

Note: Please ensure that a module must be


plugged on the left side of the energy meter
module which enables a new potential group.
(Identifiable by the white base unit of the
module)
In the settings of this module, the configuration
must include the possibility for a new potential
group.

6. Compile the hardware configuration.

7.1.2 Setting the WRREC version

Before copying the block into the project, the version of the WRREC block to be
used must be set.
Use the following version:
Copyright Siemens AG 2015 All rights reserved

S7-300 / S7-400: WRREC V1.0


S7-1200 / S7-1500: WRREC V1.1

Figure 7-1

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 62
7 Acquisition of Energy Data with STEP 7 V13
7.2 Creating an S7 program

7.2 Creating an S7 program


7.2.1 Copy blocks to the project

Table 7-3
No. Action Remark
1. Select the Libraries task card in the TIA
Portal.
2. Open the E2M Energy Data Monitoring
library and navigate to the Master Copies >
PLC folder via the library tree.

3. Open the S7-300 / S7-400 folder if you wish


to generate the program for one of the two
controller families.
Copyright Siemens AG 2015 All rights reserved

Open the S7-1200 / S7-1500 folder if you


wish to generate the program for one of the
two controller families.

4. Copy the blocks E2M_1500_Visu and


E2M_1500_AIEnergyMeter_DRV into the S7-
1500 block folder.
5. Compile the blocks completely.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 63
7 Acquisition of Energy Data with STEP 7 V13
7.2 Creating an S7 program

7.2.2 Calling blocks in the S7 program

Table 7-4
No. Action Remark
1. Create a new PLC tag of type INT (e.g.
Comm_Resource_Counter)

2. Open the OB100 organization block or create


it new and assign the value 0 to the
previously created
Comm_Resource_Counter PLC tag.

3. Open the OB1 organization block.


4. Call the driver block of the measuring device
from which you wish to read the data (in this
example: E2M_1500_AIEnergyMeter_DRV).
Create an instance data block for this call.
5. Call the E2M_VISU block and generate an
instance data block.
Copyright Siemens AG 2015 All rights reserved

6. Connect the parameters of the driver block.


(e.g. E2M_1500_AIEnergyMeter_DRV) as
shown in the screenshot on the right.

A description of the parameters is available in


Chapter 3.4.
7. Connect the parameters of the E2M_Visu
block as shown in the screenshot on the right.

A description of the parameters is available in


Chapter 3.1.

Note: The Add_Value_Count parameter is


optional and is only required if user-defined
measured values shall be displayed.
The calls of the blocks are now complete.
Download the program into the controller and assign a valid name to the
PROFINET components.

Note Steps 4-7 need to be repeated for each measuring point to be recorded.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 64
8 Installation

8 Installation
Installing the hardware
The figure below shows the hardware setup of the demo application for WinCC
V7.2 and STEP 7 V5.5.
Here, the energy data is recorded with a 7KM PAC3200 measuring device via
PROFINET and visualized on a PC station with WinCC V7.2.

Figure 8-1
Copyright Siemens AG 2015 All rights reserved

S7-300
172.16.78.41

PROFINET / IE

7KM PAC3200
172.16.78.54

The figure below shows the hardware setup of the demo application for WinCC
V13 and STEP 7 V13.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 65
8 Installation

Figure 8-2

SIMOCODE Pro V
S7-1500 172.16.78.51
172.16.78.40

PROFINET / IE

7KM PAC3200
172.16.78.54

COM 800
172.16.217.67
Copyright Siemens AG 2015 All rights reserved

ET200 SP Energy Meter


172.16.78.50

The S7-1500 controller takes on the data acquisition for all measuring devices.
The energy data of the 7KM PAC3200 measuring device and the SIMOCODE
pro V is visualized on the KTP900 Basic.
The energy data of the 7KM PAC3200 measuring device and the Energy Meter
module is visualized on the TP900 Comfort.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 66
9 Commissioning the Demo Application
9.1 Preparation (WinCC V7/STEP 7 V5.5)

9 Commissioning the Demo Application


9.1 Preparation (WinCC V7/STEP 7 V5.5)
Table 9-1
No. Action Remark
1. Download the
86299299_E2M_Classic_Demo.zip file.
2. Unzip the file with a respective program (e.g.
7zip).
3. Open the previously unzipped project with
STEP7 V5.5

9.2 Commissioning (WinCC V7/STEP 7 V5.5)


Table 9-2
No. Action Remark
Copyright Siemens AG 2015 All rights reserved

1. First of all, make sure that all of the used


devices are located in one physical network.
2. Then ensure that the IP address configured in Optionally, you can adjust the IP addresses in
the project has been assigned to all devices the project to your requirements.
and is unique.

PC station (WinCC V7) 172.16.78.32


S7-300 172.16.78.41
7KM PAC3200 172.16.78.54

3. Ensure that the PROFINET name configured


in the project has been assigned to all
PROFINET components.
4. Download the hardware configuration and the
control program into the S7-300.
5. Open the WinCC project in the WinCC station.
6. Adjust the computer name in the project.
7. Start WinCC Runtime.

Note Operating the example configuration is described in the document Part 3


Visualization of Energy Data.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 67
9 Commissioning the Demo Application
9.3 Preparation (WinCC V13/STEP7 V13)

9.3 Preparation (WinCC V13/STEP7 V13)


Table 9-3
No. Action Remark
1. Download the
86299299_E2M_TIA_Demo.zip file.
2. Unzip the file with a respective program (e.g.
7zip).
3. Open the previously unzipped project in TIA
Portal.

9.4 Commissioning (WinCC V13/STEP 7 V13)


Table 9-4
No. Action Remark
1. First of all, make sure that all of the used
devices are located in one physical network.
2. Then ensure that the IP address configured in Optionally, you can adjust the IP addresses in
Copyright Siemens AG 2015 All rights reserved

the project has been assigned to all devices the project to your requirements.
and is unique.

TP900 Comfort 172.16.78.31


KTP600 Basic 172.16.78.30
S7-1500 172.16.78.40
ET 200SP 172.16.78.50
SIMOCODE pro V 172.16.78.51
7KM PAC3200 172.16.78.54
COM 800 172.16.217.67
3. Assign the PROFINET name configured in the
project to all PROFINET components.
4. Download the hardware configuration and the
control program into the S7-1500.
5. Load the configuration into Basic Panel and Alternatively, you can also use the simulation
Comfort Panel. of the operator panel.

Note Operating the example configuration is described in the document Part 3


Visualization of Energy Data.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 68
10 Links & Literature

10 Links & Literature


Tabelle 10-1
Topic Title
\1\ Siemens Industry https://support.industry.siemens.com
Online Support
\2\ Download page of https://support.industry.siemens.com/cs/ww/en/view/86299299
the entry
\3\ Energy http://www.siemens.com/simatic-energy-management
management with
SIMATIC
\4\ Energy https://support.industry.siemens.com/cs/ww/en/view/68043160
management in
the Industry
Online Support

11 History
Siemens AG 2015 All rights reserved

Table 11-1
Version Date Modifications
V1.0 02/2014 First version
V1.1 07/2014 SIRIUS control devices added.
Updating to TIA Portal V13.
V2.0 10/2014 SIRIUS 3RW44 added.
nd
Visualization for Basic panels (2 generation) added.
Various changes and bug fixes
V2.1 07/2015 3VA molded case circuit breakers added.
Updating to TIA Portal V13 SP1.

Measuring and Visualizing Energy Data


Entry ID:86299299, V2.1, 07/2015 69