Introduction 1
Information about the library
2
Description of blocks
3
Description of
powerrate Reports
4
Configuring guide
5
Technical data
6
Service and support
information
7
Power management for PCS 7
SIMATIC PCS 7 powerrate
Programming and Operating Manual
01 / 2009
A5E02306639A-01
V3.0
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
CAUTION
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
NOTICE
indicates that an unintended result or situation can occur if the corresponding information is not taken into
account.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will
be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to
property damage.
Qualified Personnel
The device/system may only be set up and used in conjunction with this documentation. Commissioning and
operation of a device/system may only be performed by qualified personnel. Within the context of the safety notes
in this documentation qualified persons are defined as persons who are authorized to commission, ground and
label devices, systems and circuits in accordance with established safety practices and standards.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended
or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be adhered to. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of the Siemens AG. The remaining trademarks in this
publication may be trademarks whose use by third parties for their own purposes could violate the rights of the
owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
GERMANY
A5E02306639A-01
Ⓟ 02/2009
Copyright © Siemens AG 2009.
Technical data subject to change
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 3
Table of contents
1 Introduction................................................................................................................................................ 9
1.1 General ..........................................................................................................................................9
1.2 Installing the library ......................................................................................................................10
2 Information about the library .................................................................................................................... 11
2.1 Overview of the blocks.................................................................................................................11
2.2 General information about OS typicals ........................................................................................12
2.2.1 Faceplates....................................................................................................................................12
2.2.2 Symbols .......................................................................................................................................14
3 Description of blocks................................................................................................................................ 17
3.1 PRE_SYNC: Time synchronization..............................................................................................17
3.1.1 Calling OBs ..................................................................................................................................17
3.1.2 Called blocks................................................................................................................................17
3.1.3 Function .......................................................................................................................................17
3.1.4 Message behavior........................................................................................................................17
3.1.5 Error behavior ..............................................................................................................................18
3.1.6 Start-up characteristics ................................................................................................................18
3.1.7 Block parameters .........................................................................................................................18
3.2 PRE_SUM: Energy acquisition and processing...........................................................................18
3.2.1 Calling OBs ..................................................................................................................................18
3.2.2 Called blocks................................................................................................................................19
3.2.3 Function .......................................................................................................................................19
3.2.4 Message behavior........................................................................................................................22
3.2.5 Error behavior ..............................................................................................................................22
3.2.6 Start-up characteristics ................................................................................................................23
3.2.7 Block parameters .........................................................................................................................23
3.2.8 Description of icons and faceplate...............................................................................................25
3.3 PRE_FIFO_DATA: FIFO buffer....................................................................................................28
3.3.1 Calling OBs ..................................................................................................................................28
3.3.2 Called blocks................................................................................................................................29
3.3.3 Function .......................................................................................................................................29
3.3.4 Message behavior........................................................................................................................30
3.3.5 Error behavior ..............................................................................................................................30
3.3.6 Start-up characteristics ................................................................................................................30
3.3.7 Block parameter...........................................................................................................................30
3.4 PRE_AR_DATA: Data interface for sending the archive data .....................................................30
3.4.1 Calling OBs ..................................................................................................................................30
3.4.2 Called blocks................................................................................................................................30
3.4.3 Function .......................................................................................................................................31
3.4.4 Message behavior........................................................................................................................31
3.4.5 Error behavior ..............................................................................................................................32
3.4.6 Start-up characteristics ................................................................................................................32
3.4.7 Block parameter...........................................................................................................................32
Table of contents
SIMATIC PCS 7 powerrate
4 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.5 PRE_AR_SND: Archiving measured values ............................................................................... 33
3.5.1 Calling blocks .............................................................................................................................. 33
3.5.2 Called blocks............................................................................................................................... 33
3.5.3 Function....................................................................................................................................... 33
3.5.4 Message behavior....................................................................................................................... 33
3.5.5 Error behavior ............................................................................................................................. 33
3.5.6 Start-up characteristics ............................................................................................................... 34
3.5.7 Block parameter .......................................................................................................................... 34
3.6 PRE_LMGM / PRE_LMGM_x: Load management ..................................................................... 34
3.6.1 Calling blocks .............................................................................................................................. 34
3.6.2 Called blocks............................................................................................................................... 35
3.6.3 Function....................................................................................................................................... 35
3.6.4 Message behavior....................................................................................................................... 46
3.6.5 Error behavior ............................................................................................................................. 48
3.6.6 Start-up characteristics ............................................................................................................... 49
3.6.7 Block parameters ........................................................................................................................ 50
3.6.8 Description of icons and faceplate .............................................................................................. 55
3.7 PRE_AS_SEND: AS-to-AS communication ................................................................................ 68
3.7.1 Calling blocks .............................................................................................................................. 68
3.7.2 Called blocks............................................................................................................................... 68
3.7.3 Function....................................................................................................................................... 68
3.7.4 Message behavior....................................................................................................................... 69
3.7.5 Error behavior ............................................................................................................................. 69
3.7.6 Start-up characteristics ............................................................................................................... 70
3.7.7 Block parameters ........................................................................................................................ 70
3.8 PRE_AS_RECV: AS-to-AS communication................................................................................ 72
3.8.1 Calling blocks .............................................................................................................................. 72
3.8.2 Called blocks............................................................................................................................... 72
3.8.3 Function....................................................................................................................................... 72
3.8.4 Message behavior....................................................................................................................... 73
3.8.5 Error behavior ............................................................................................................................. 73
3.8.6 Start-up characteristics ............................................................................................................... 74
3.8.7 Block parameters ........................................................................................................................ 74
3.9 PRE_SND_H: AS-4xxH <> AS-4xx communication ................................................................... 75
3.9.1 Calling blocks .............................................................................................................................. 75
3.9.2 Called blocks............................................................................................................................... 76
3.9.3 Function....................................................................................................................................... 76
3.9.4 Message behavior....................................................................................................................... 77
3.9.5 Error behavior ............................................................................................................................. 77
3.9.6 Start-up characteristics ............................................................................................................... 78
3.9.7 Block parameter .......................................................................................................................... 78
3.10 PRE_RCV_H: AS-4xxH <> AS-4xx communication ................................................................... 80
3.10.1 Calling blocks .............................................................................................................................. 80
3.10.2 Called blocks............................................................................................................................... 80
3.10.3 Function....................................................................................................................................... 80
3.10.4 Message behavior....................................................................................................................... 81
3.10.5 Error behavior ............................................................................................................................. 82
3.10.6 Start-up characteristics ............................................................................................................... 82
3.10.7 Block parameter .......................................................................................................................... 82
Table of contents
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 5
3.11 PRE_BS: Calling the BSEND system function block...................................................................84
3.11.1 Calling blocks...............................................................................................................................84
3.11.2 Called blocks................................................................................................................................84
3.11.3 Function .......................................................................................................................................84
3.12 PRE_BR: Calling the BRCV system function block .....................................................................85
3.12.1 Calling blocks...............................................................................................................................85
3.12.2 Called blocks................................................................................................................................85
3.12.3 Function .......................................................................................................................................85
3.13 PRE_SUMC: Batch-related energy acquisition............................................................................85
3.13.1 Calling OBs ..................................................................................................................................85
3.13.2 Called blocks................................................................................................................................86
3.13.3 Function .......................................................................................................................................86
3.13.4 Message behavior........................................................................................................................88
3.13.5 Error behavior ..............................................................................................................................88
3.13.6 Start-up characteristics ................................................................................................................89
3.13.7 Block parameter...........................................................................................................................89
3.14 PRE_UA_S: Archive manager for writing archive data to the user archive .................................90
3.14.1 Calling OBs ..................................................................................................................................90
3.14.2 Called blocks................................................................................................................................90
3.14.3 Function .......................................................................................................................................90
3.14.4 Message behavior........................................................................................................................93
3.14.5 Error behavior ..............................................................................................................................93
3.14.6 Start-up characteristics ................................................................................................................93
3.14.7 Block parameters .........................................................................................................................94
3.15 PRE_UA_R: Archive manager for reading archive data from the user archive ...........................94
3.15.1 Calling OBs ..................................................................................................................................94
3.15.2 Called blocks................................................................................................................................95
3.15.3 Function .......................................................................................................................................95
3.15.4 Message behavior........................................................................................................................97
3.15.5 Error behavior ..............................................................................................................................97
3.15.6 Start-up characteristics ................................................................................................................97
3.15.7 Block parameters .........................................................................................................................98
3.16 PRE_SWTCH: General switch.....................................................................................................99
3.16.1 Calling OBs ..................................................................................................................................99
3.16.2 Called blocks................................................................................................................................99
3.16.3 Function .......................................................................................................................................99
3.16.4 Message behavior......................................................................................................................100
3.16.5 Start-up characteristics ..............................................................................................................100
3.16.6 Block parameter.........................................................................................................................101
3.16.7 Description of icons and faceplate.............................................................................................102
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200 ........................................................103
3.17.1 Calling OBs ................................................................................................................................103
3.17.2 Called blocks..............................................................................................................................104
3.17.3 Function .....................................................................................................................................104
3.17.4 Message behavior......................................................................................................................105
3.17.5 Error behavior ............................................................................................................................106
3.17.6 Start-up characteristics ..............................................................................................................106
3.17.7 Block parameters .......................................................................................................................106
3.17.8 Description of icon and faceplate...............................................................................................107
Table of contents
SIMATIC PCS 7 powerrate
6 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.18 PRE_CALC: Calculations.......................................................................................................... 109
3.18.1 Calling blocks ............................................................................................................................ 109
3.18.2 Function..................................................................................................................................... 109
3.18.3 Message behavior..................................................................................................................... 109
3.18.4 Error behavior ........................................................................................................................... 109
3.18.5 Start-up characteristics ............................................................................................................. 110
3.18.6 Block parameters ...................................................................................................................... 110
3.19 PRE_FIFO_IO: Organization of FIFO buffer ............................................................................. 110
3.19.1 Calling blocks ............................................................................................................................ 110
3.19.2 Called blocks............................................................................................................................. 110
3.19.3 Function..................................................................................................................................... 110
3.19.4 Message behavior..................................................................................................................... 110
3.19.5 Error behavior ........................................................................................................................... 111
3.19.6 Start-up characteristics ............................................................................................................. 111
3.19.7 Block parameters ...................................................................................................................... 111
3.20 UDT_PRE_FIFO........................................................................................................................ 111
3.20.1 Description ................................................................................................................................ 111
3.20.2 Structure.................................................................................................................................... 112
3.21 UDT_PRE_ITEM ....................................................................................................................... 112
3.21.1 Description ................................................................................................................................ 112
3.21.2 Structure.................................................................................................................................... 112
3.22 UDT_PRE_TLG......................................................................................................................... 112
3.22.1 Description ................................................................................................................................ 112
3.22.2 Structure.................................................................................................................................... 113
3.23 UDT_PRE_SND_REQ............................................................................................................... 113
3.23.1 Description ................................................................................................................................ 113
3.23.2 Structure.................................................................................................................................... 113
3.24 UDT_PRE_SND ........................................................................................................................ 114
3.24.1 Description ................................................................................................................................ 114
3.24.2 Structure.................................................................................................................................... 114
3.25 UDT_PRE_RCV_REQ............................................................................................................... 114
3.25.1 Description ................................................................................................................................ 114
3.25.2 Structure.................................................................................................................................... 115
3.26 UDT_PRE_RCV ........................................................................................................................ 115
3.26.1 Description ................................................................................................................................ 115
3.26.2 Structure.................................................................................................................................... 115
3.27 UDT_PRE_ANY ........................................................................................................................ 116
3.27.1 Description ................................................................................................................................ 116
3.27.2 Structure.................................................................................................................................... 116
4 Description of powerrate Reports .......................................................................................................... 117
4.1 Energy analyses........................................................................................................................ 117
4.1.1 Export of archived measured values......................................................................................... 117
4.1.2 Cost center report ..................................................................................................................... 117
4.1.3 Duration curve report ................................................................................................................ 118
4.2 Batch analyses.......................................................................................................................... 119
4.2.1 Export of batch values............................................................................................................... 120
4.2.2 Batch report............................................................................................................................... 120
Table of contents
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 7
5 Configuring guide................................................................................................................................... 123
5.1 General settings.........................................................................................................................124
5.2 Configuring the process tags for recording energy/power.........................................................124
5.2.1 Creating the PLC program.........................................................................................................124
5.2.2 Connection to WinCC ................................................................................................................126
5.2.3 Configuring the process value archive.......................................................................................130
5.3 Configuring communication with WinCC user archives.............................................................133
5.3.1 Configuring the connection in NETPRO ....................................................................................133
5.3.2 Creating the PLC program.........................................................................................................134
5.3.3 Configuring communication in WinCC .......................................................................................136
5.4 Configuring batch data...............................................................................................................139
5.4.1 Creating the PLC program.........................................................................................................139
5.4.2 Configuring the user archive in WinCC......................................................................................140
5.5 Configuring load management...................................................................................................141
5.5.1 Creating the PLC program.........................................................................................................141
5.5.2 Connection to WinCC ................................................................................................................142
5.5.3 Configuring the user archives in WinCC....................................................................................142
5.6 Configuring the Web Navigator..................................................................................................144
5.7 Configuring powerrate Reports..................................................................................................145
5.7.1 Calling powerrate Reports .........................................................................................................145
5.7.2 General configurations...............................................................................................................145
5.7.2.1 Configuring the server name......................................................................................................145
5.7.2.2 Configuring tariffs.......................................................................................................................146
5.7.3 Configuration of the reports .......................................................................................................148
5.7.3.1 Reports for energy analyses......................................................................................................150
5.7.3.2 Batch analyses...........................................................................................................................155
5.7.4 Configuration of the times ..........................................................................................................156
5.7.4.1 Configuration of report time and report period...........................................................................156
5.7.4.2 Configuration of the validity period ............................................................................................162
6 Technical data ....................................................................................................................................... 163
7 Service and support information ............................................................................................................ 167
Table of contents
SIMATIC PCS 7 powerrate
8 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 9
Introduction 1
1.1 General
The SIMATIC PCS 7 powerrate (pre for short) software package V3.0 can be used in PCS 7
versions V6.1 SP1/SP2 and V7.0 SP1 and contains the following components:
Block library with:
PRE_SYNC: Time synchronization
PRE_SUM: PCS 7 block for acquiring and processing energy
PRE_FIFO_DATA: Contains the FIFO data
PRE_AR_DATA: Data interface for sending the archive data
PRE_AR_SND: Archiving of measured values
PRE_LMGM: Load management for up to 100 loads
PRE_LMGM_75: Load management for up to 75 loads
PRE_LMGM_50: Load management for up to 50 loads
PRE_LMGM_25: Load management for up to 25 loads
PRE_LMGM_10: Load management for up to 10 loads
PRE_AS_SEND: Send block for AS-to-AS communication
PRE_AS_RECV: Receive block for AS-to-AS communication
PRE_SND_H: Send block for AS-4xxH to AS-400 communication
PRE_RCV_H: Receive block for AS-4xxH to AS-400 communication
PRE_BS: Calls the system block BSEND
PRE_BR: Calls the system block BRCV
PRE_SUMC: Block for batch-related energy acquisition
PRE_UA_S: Archive manager for writing archive data for load management and
energy acquisition to the user archive
PRE_UA_R: Archive manager for reading archive data from the user archive
PRE_SWTCH: Block for general switch with integration via DI/DO
PRE_PAC: Block for basic functionality of the PAC3200 / PAC4200
PRE_CALC: Calculation block
PRE_FIFO_IO: Organizes the FIFObuffer
CFC templates for using the blocks
User objects and operating blocks for operating and observing energy acquisition
data, load management, switches, and PAC3200 / PAC4200 energy acquisition
devices on the OS
Introduction
1.2 Installing the library
SIMATIC PCS 7 powerrate
10 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
powerrate Reports with the following functions
Reading the archive data from the WinCC tag logging archive and WinCC user
archives to Excel
Further processing of archive data
Output of archive data in the form of Excel reports
Creation of automatic reports
Online help in German and English
1.2 Installing the library
To start the installation, please insert the CD in the CD-ROM drive on your PG/PC and
launch the "setup.exe" program. All the other information you need will be provided during
the installation process. Please also read the information in the readme file.
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 11
Information about the library 2
2.1 Overview of the blocks
The library contains the following blocks:
Name Function Number
PRE_SYNC Time synchronization FB1060
PRE_SUM PCS 7 block for acquiring and processing energy FB1061
PRE_FIFO_DATA FIFO buffer FB1062
PRE_AR_DATA Data interface for sending the archive data FB1063
PRE_AR_SND Archiving of measured values in the WinCC tag logging archive FB1064
PRE_LMGM Load management for up to 100 loads FB1065
PRE_LMGM_75 Load management for up to 75 loads FB1066
PRE_LMGM_50 Load management for up to 50 loads FB1067
PRE_LMGM_25 Load management for up to 25 loads FB1068
PRE_LMGM_10 Load management for up to 10 loads FB1069
PRE_AS_SEND Send block for AS-to-AS communication FB1070
PRE_AS_RECV Receive block for AS-to-AS communication FB1071
PRE_SND_H Send block for AS-4xxH to AS-400 communication FB1072
PRE_RCV_H Receive block for AS-4xxH to AS-400 communication FB1073
PRE_BS Calls the BSEND system function block (used internally) FB1074
PRE_BR Calls the BRCV system function block (used internally) FB1075
PRE_SUMC Block for batch-related energy acquisition FB1077
PRE_UA_S Archive manager for writing archive data to the user archive FB1078
PRE_UA_R Archive manager for reading archive data from the user archive FB1079
PRE_SWTCH PCS 7 block for general switch FB1750
PRE_PAC PCS 7 block for basic functionality of the PAC3200 / PAC4200 FB1751
PRE_CALC Calculation block FC1061
PRE_FIFO_IO Organizes the FIFObuffer FC1062
UDT_PRE_FIFO Data type for check data for organizing the FIFO buffer UDT1060
UDT_PRE_ITEM Data type for measured value UDT1061
UDT_PRE_TLG Data type for message frame item for sending to the WinCC tag logging
archive
UDT1062
UDT_PRE_SND_REQ Data type for write data request UDT1063
UDT_PRE_SND Data type for archive manager checkback signal for writing UDT1064
UDT_PRE_RCV_REQ Data type for read data request UDT1065
UDT_PRE_RCV Data type for archive manager acknowledgment signal for reading UDT1066
UDT_PRE_ANY Data type for Any pointer UDT1067
Information about the library
2.2 General information about OS typicals
SIMATIC PCS 7 powerrate
12 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Because the FBs PRE_BR, PRE_BS, the FCs and the UDTs are used internally, their
numbers cannot be modified.
2.2 General information about OS typicals
2.2.1 Faceplates
Faceplates are configured with the Graphics Designer using the templates and PCS 7-
specific standard views (Trend, Batch, and Alarm) provided by the Faceplate Designer. If
other user objects are required, they can be added.
The faceplates described are provided as functional and tested examples and can be
adapted by the user to reflect his or her own needs.
Icons are provided for the PRE_SUM energy acquisition block, the
PRE_LMGM / PRE_LMGM_x load management blocks, the PRE_SWTCH switch block, and
the block for the PRE_PAC PAC devices, with a group display in each case with all the
necessary displays. The PRE_SUM, PRE_SWTCH and PRE_PAC blocks also have a loop
display. The relevant group display is called using the icon.
A description that allows the user to adapt the faceplates (description of interface to the
blocks, description of operating and display functions) is provided along with the faceplates.
Overview
The display forms part of the @PG_PRE_xxx_OVERVIEW.PDL /
@PL_xxx_SUM_OVERVIEW.PDL basic displays.
(1) Group display
(2) Message lock (MSG_LOCK)
(3) Message acknowledgment
(4) Message suppression (QMSG_SUP)
Trend (@PCS7_Trend.pdl)
The "ReturnPath" and "StandardTrend" properties must be parameterized on the icon to
incorporate a trend in a faceplate.
Information about the library
2.2 General information about OS typicals
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 13
StandardTrend 2 Online values with 5-min time axis
> 2 Archive values with time axis of the value entered
(in min)
ReturnPath .S Structural element name starting with a full stop
: Separator
CO_GREEN Color for trend
Add the structural element name and color to other
trends (e.g. .S:CO_GREEN,.V:CO_RED)
*asia Skip the server prefix in the archive tag name
: Separator
*archivname:pre Archive name of pre-archive
Since a dynamic selection is made for the PRE_SUM faceplate as regards whether the
online values or archive tags will be accessed, the ReturnPath_Online (for online
values)/ReturnPath_Archive (for archive tags) properties must be parameterized here.
Separate trends can be produced for other display types (e.g. comparison of a trend value
over several time domains) with the help of the "Trends online" function.
Information about the library
2.2 General information about OS typicals
SIMATIC PCS 7 powerrate
14 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
The button from the bottom strip of buttons shown below is used for calling.
2.2.2 Symbols
The process display icons are based on the process symbols provided by the Faceplate
Designer. The diagrams are schematic diagrams.
Template diagrams @PCS7Typicals_PRE.pdl / @Template_PRE.pdl
The block icons can be found in the template diagrams @PCS7Typicals_PRE.pdl and
@Template_PRE.pdl. To be able to use the "Create / update block icons" function in the
Graphics Designer, you have to copy the icons of the @Template_PRE.pdl file into
@Template.pdl.
When using the "Create/Update Block Icons" function, PCS 7 accesses the file
@PCS7Typicals_PRE.pdl.
When manually copying the icons into a process display, you must use the icons from the
@Template_PRE.pdl file. When updating the icons, PCS 7 accesses the @Template.pdl file.
Different variants of block icons
There may be several variants of block icons for one measuring point. These variants are
distinguished by the "type" attribute: The value of this attribute describes the variant. For
example, if you look at a variant of the block icon for a measuring point for energy
acquisition, you will find the value "@PRE_SUM/2". You use the part of the value displayed
after the "/" to control which variant of the block icon is produced. You therefore have to
enter this part in the object properties for the block instance. If you do not enter any
parameters in the object properties for the block instance, the standard block icon is
produced automatically: This is the block icon with the "/1" label for the "type" attribute, e.g.
"@PRE_SUM/1".
Connection to the measuring point
For the different blocks, there is one icon that is linked to the associated measuring point
using the "Connect picture block to tag structure" function.
The icons contain the following visible information:
Information about the library
2.2 General information about OS typicals
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 15
(1) Energy (work) (CUR_VAL/Unit: CUR_VAL#unit)
(2) Power (CUR_PWR/Unit: CUR_PWR#unit)
(3) Group display (EventState)
(4) Mode (QMAN_AUT)
(5) Equipment identifier (tag name)
Information about the library
2.2 General information about OS typicals
SIMATIC PCS 7 powerrate
16 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 17
Description of blocks 3
3.1 PRE_SYNC: Time synchronization
FB1060
3.1.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
3.1.2 Called blocks
The block calls the following blocks:
SFC1 READ_CLK
SFC6 RD_SINFO
FC1 AD_DT_TM
(IEC function from the STEP 7 Standard Library)
FC34 SB_DT_DT
(IEC function from the STEP 7 Standard Library)
3.1.3 Function
The block acts as the clock for time synchronization for the PRE_SUM block for energy
acquisition and other powerrate blocks.
The SYNC_OUT clock is triggered by an external synchronization signal (EXT_SYNC) or the
internal CPU time.
If the external synchronization is deactivated (EXT_EN = FALSE), REQ_PER contains the
period time for synchronization.
During external synchronization (EXT_EN = TRUE) the time stamp for the synchronization
pulse (SYNC_TS) is rounded to the next whole time value (e.g. 15-minute value) according
to the expected period time of the external synchronization signal (REQ_PER) and of the
current CPU time stamp.
3.1.4 Message behavior
The block has no message behavior.
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
18 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.1.5 Error behavior
The QPARAMF error output is set when
Synchronization period REQ_PER or synchronization pulse REQ_T ≤ 0
Synchronization period REQ_PER is less than the period of synchronization pulse
REQ_T
Synchronization period REQ_PER is greater than one hour
Synchronization period REQ_PER is not a whole second value
Synchronization period REQ_PER is not a divisor of an hour
3.1.6 Start-up characteristics
The times are restarted during start-up.
3.1.7 Block parameters
Item Data type Type Meaning HMI
CUR_TS DATE_AND_TIME O Current time stamp when block is called
EXT_EN BOOL I 1 = Release for external synchronization
EXT_SYNC BOOL I External synchronization pulse
QPARAMF BOOL O 1 = Parameterization error
REQ_PER REAL I Synchronization period in [s]
REQ_T REAL I Period of synchronization pulse in [s]
SAMPLE_T REAL I Sampling time in [s]
SYNC_OUT BOOL O Synchronization pulse
SYNC_PER REAL O Synchronization period in [s], copy of REQ_PER
SYNC_TS DATE_AND_TIME O Time stamp of synchronization pulse
3.2 PRE_SUM: Energy acquisition and processing
FB1061
3.2.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 19
3.2.2 Called blocks
The block calls the following blocks:
SFB35 ALARM_8P
SFC6 RD_SINFO
FC1 AD_DT_TM
(IEC function from the STEP 7 Standard Library)
FC14 GT_DT
(IEC function from the STEP 7 Standard Library)
FC34 SB_DT_DT
(IEC function from the STEP 7 Standard Library)
FC1061 PRE_CALC
FC1062 PRE_FIFO_IO
3.2.3 Function
The PRE_SUM block is used to acquire and process energy and it forms the interface to the
OS.
Measured value acquisition
The block does not have a driver function, i.e. it is not dependent on the measuring
instruments used.
Various types of signals are supported. They are selected using the INP_SEL switch. The
table provides an overview of the various options.
INP_SEL Signal type Parameter Quality code
parameter
Normalization
factor/calculation constants
0 Count pulse VALUE_P QC_P WEIGHT_P
1 Integer count value VALUE_D QC_D WEIGHT_A
2 Analog count value VALUE_R QC_R WEIGHT_A
3 Energy value calculated using
calculation function*
ACTUALx
(x = 1 ... 3)
QC_ACTx
(x = 1 ... 3)
CALC_Px (x = 0 ... 3),
CALC_FN*
* See calculation algorithms contained in the PRE_CALC block ("PRE_CALC: Calculations
(Page 109)")
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
20 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
For signal type 0, the energy consumed (work) is established by adding together the
weighted pulses.
At the end of the acquisition period (PER_T), the power value (CUR_PWR) is calculated
from the energy consumed (work).
For signal types 1 and 2, the difference (normalized) between the current and last count
value is the energy consumed (work).
At the end of the acquisition period (PER_T), the power value (CUR_PWR) is calculated
from the energy consumed (work).
For signal type 3, the PRE_CALC function returns the current power value (CUR_PWR)
which is converted into energy (time basis corresponds to processing cycle time of the
block).
If the power value is < ZERO_CUT, 0 is set for the value.
At the start of a synchronization period (SYNC_PER, SYNC_P = FALSE → TRUE) the
current count value CUR_VAL = 0 is set. During the synchronization period, the energy
values calculated are added to the CUR_VAL parameter in cycles.
At the end of the synchronization period (SYNC_PER), the average power value
(AVG_PWR) is calculated from the energy consumed (work).
The change to the current energy value is extrapolated to the total synchronization period
(EST_VAL). The expected, average power (EST_PWR) for the current synchronization
period is determined from this.
Mode changeover for measured value acquisition
For signal types (INP_SEL) 1 and 2, the operator can use the AUT_ON_OP input to change
over the mode for measured value acquisition if the corresponding releases (AUTOP_EN /
MANOP_EN) are present. The mode selected is displayed at the QMAN_AUT parameter.
Automatic mode
In automatic mode (QMAN_AUT = TRUE), the energy value is formed from the
corresponding VALUE_P or VALUE_R input.
Manual mode
In manual mode (QMAN_AUT = FALSE), the faceplate can be used to enter the energy
value at the V_MAN parameter.
The value is then valid when V_MAN ≥ V_MAN_L1 (last valid manual value), taking into
account the maximum counter value MAX_CNT (counter overflow) and the time stamp of the
manual value (V_MAN_DATE, V_MAN_TIME) > time stamp of the last valid manual value
(V_MAN_L1_DATE, V_MAN_L1_TIME).
The total energy consumed (CUR_VAL) and the average power values
(AVG_PWR = CUR_PWR) for the acquisition period are calculated from the difference
between the current and last manual value within the time entered (difference between
current and last time stamp).
The expected energy and power values (EST_VAL / EST_PWR) are equated with the
current values for the acquisition period (CUR_VAL / CUR_PWR).
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 21
Archiving
The parameters LAST_VAL (current saved energy value CUR_VAL at the end of the
synchronization period SYNC_PER), AVG_PWR (average power value at the end of the
synchronization period SYNC_PER) and, with signal type 1 and 2, VALUE_D or VALUE_R
(absolute count value) are used for archiving.
In manual mode, the CUR_VAL (energy consumed within the time period stated) and
AVG_PWR (average power value in time period stated) parameters are used for archiving.
The values are given the time stamp entered.
The data awaiting archiving are written to the FIFO buffer using the PRE_FIFO_IO function.
The PRE_AR_SND block is responsible for archiving.
Value archiving can be deactivated on an individual basis by setting the ARSNO_S
parameter for the energy value, ARSNO_V for the power value, or ARSNO_C for the count
value to 0.
Quality code
The QC_P, QC_D, QC_R, and QC_ACTx (x=1 ... 3) parameters contain the quality codes of
the input signals and must be connected to the QUALITY output of the associated driver
blocks when using the input signals selected.
Depending on the signal type, the corresponding inputs are used to form the quality codes
for the output side: QC_LAST_VAL, QC_CUR_VAL, QC_EST_VAL, QC_AVG_PWR,
QC_CUR_PWR, and QC_EST_PWR.
The following quality code data is evaluated:
Quality code = 16#60: Simulation on driver block active (QSIM = TRUE)
Quality code = 16#80: Valid value
Quality code <> 16#60 or <> 16#80: Invalid value, external error (QBAD = TRUE)
In the event of an error, -1 is displayed at the outputs.
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
22 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.2.4 Message behavior
PRE_SUM issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QPARAMF Parameterization error PLC pr ctrl
failure
2 QPF_FIFO FIFO parameterization error PLC pr ctrl
failure
3 QOVL FIFO buffer overflow PLC pr ctrl
failure
4 QCALCERR Error in calculation function PLC pr ctrl
failure
5 QOP_ERR Invalid manual value OS pr ctrl
failure
6 QBAD External error PLC pr ctrl
failure
7 Free
MSG_EVID
8 Free
3.2.5 Error behavior
The QPARAMF error output is set when
The acquisition period PER_T ≤ 0
The synchronization period SYNC_PER ≤ 0
Normalization factor WEIGHT_P (when INP_SEL = 0) or WEIGHT_A (when INP_SEL = 1
or 2) ≤ 0.0
The maximum counter value MAX_CNT <= 0.0
The count input of the selected signal type (VALUE_D / VALUE_R) > MAX_CNT
The limit for zero point power ZERO_CUT < 0
Subnumber for archive tag (ARSNO_V / ARSNO_S / ARSNO_C) > 16#0FFF
The QPF_FIFO error output is set when the PRE_FIFO_IO function called internally for
managing the FIFO buffer reports that
The parameterized FIFO DB is not present
The FIFO DB length is too short
The QCALCERR error output is set when the PRE_CALC calculation function called
internally reports an error in the calculation.
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 23
The QOP_ERR error output is set for 1 cycle when one of the following is entered in manual
mode
An invalid time stamp
A manual value < 0 or > maximum count value MAX_CNT
3.2.6 Start-up characteristics
During start-up, the accumulated values are reset, the times restarted, and the messages
suppressed.
3.2.7 Block parameters
Item Data type Ty
pe
Meaning HMI
ACTUALx REAL I Current value x (x = 1 ... 3) for calculation*
ARSNO_C WORD I Subnumber for archive tag of count value .C +
ARSNO_S WORD I Subnumber for archive tag of accumulated value .S +
ARSNO_V WORD I Subnumber for archive tag of average power value .V +
AUT_ON_OP BOOL IO Mode selection for measured value acquisition: 0 = Manual ,
1 = Automatic
+
AUTMAN_EN BOOL I 1 = Release for automatic changeover to manual in the event of
an external error
AUTOP_EN BOOL I 1 = Release for automatic operation
AVG_PWR REAL O Average power at end of synchronization period +
CALC_FN INT I Calculation function *
CALC_Px REAL I Parameter x (x = 0 ... 3) of calculation function *
CSF BOOL I 1 = External error
CUR_PWR REAL O Current power at end of acquisition period +
CUR_TS DATE_AND_TIME I Current time stamp when block is called
CUR_VAL REAL O Current integrated value +
EST_VAL REAL O Probable value by end of acquisition period +
EST_PWR REAL O Average power by end of acquisition period +
FIFO INT I Link to FIFO data
INP_SEL INT I Selector for signal type: 0 = Pulse input, 1 = Integer count input,
2 = Analog count input, 3 = Result from calculation
+
LAST_VAL REAL O Last archived, accumulated value +
MANOP_EN BOOL I 1 = Release for manual operation
MAX_CNT REAL I Maximum counter value for signal types 1 and 2 +
MSG_ACK WORD O Messages acknowledged, ALARM_8P block
MSG_EVID DWORD I Event ID of the ALARM_8P message block
MSG_STAT WORD O MESSAGE: STATUS output
PER_T REAL I Acquisition period for current power value in [s]
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
24 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Item Data type Ty
pe
Meaning HMI
QAUTOP BOOL O 1 = Release for automatic operation +
QBAD BOOL O 1 = External error
QC_ACTx BYTE I Quality code for ACTUALx
QC_AVG_PWR BYTE O Quality code for AVG_PWR
QC_CUR_PWR BYTE O Quality code for CUR_PWR
QC_CUR_VAL BYTE O Quality code for CUR_VAL
QC_D BYTE I Quality code for VALUE_D
QC_EST_PWR BYTE O Quality code for EST_PWR
QC_EST_VAL BYTE O Quality code for EST_VAL
QC_LAST_VAL BYTE O Quality code for LAST_VAL
QC_P BYTE I Quality code for VALUE_P
QC_R BYTE I Quality code for VALUE_R
QCALCERR BOOL O 1 = Error in calculation function
QMAN_AUT BOOL O Measured value acquisition mode: 0 = Manual , 1 = Automatic +
QMANOP BOOL O 1 = Release for manual operation +
QMSG_ERR BOOL O 1 = ALARM_8P error
QMSG_SUP BOOL O 1 = Message suppression +
QOP_ERR BOOL O Operating error
QOVL BOOL O 1 = FIFO buffer overflow
QPARAMF BOOL O 1 = Parameterization error
QPF_FIFO BOOL O 1 = Parameterization error FIFO
QSIM BOOL O 1 = Simulation active +
RESET BOOL IO 1 = Reset the accumulated value
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time in [s]
SET BOOL IO Set manual value +
SYNC_P BOOL I Synchronization pulse
SYNC_PER REAL I Synchronization period in [s]
SYNC_TS DATE_AND_TIME I Time stamp of synchronization pulse
V_MAN REAL IO Current manual value +
V_MAN_DATE DWORD IO Time stamp for date of current manual value +
V_MAN_Lx REAL IO Last manual value x (x = 1 ... 3) +
V_MAN_Lx_DATE DWORD IO Time stamp for date of last manual value x (x = 1 ... 3) +
V_MAN_Lx_TIME DWORD IO Time stamp for time of last manual value x (x = 1 ... 3) +
V_MAN_TIME DWORD IO Time stamp for time of current manual value +
VALUE_D DINT I Integer count input
VALUE_P BOOL I Pulse input
VALUE_R REAL I Analog count input
WEIGHT_A REAL I Normalization factor for integer/analog count input
WEIGHT_P REAL I Normalization factor for pulse input
ZERO_CUT REAL I Limit for zero point during calculation
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 25
* See calculation algorithms contained in the PRE_CALC block ("PRE_CALC: Calculations
(Page 109)")
3.2.8 Description of icons and faceplate
Block icon
Variant 1
Variant 2
Faceplate
The faceplate available is described in this chapter.
The following views are available:
Overview OVERVIEW
Standard STANDARD
Table TABLE
Input EDIT
Maintenance MAINTENANCE
Messages
Trend
The file name is composed as follows: @PG_PRE_SUM_<view>.PDL
The PCS 7 standard displays are used for the messages and trend views.
The structure of the individual views of faceplates is described below.
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
26 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Standard (STANDARD)
(1) QMAN_AUT / AUT_ON_OP
(2) LAST_VAL / Unit → LAST_VAL#unit
(3) CUR_VAL / Unit → CUR_VAL#unit
(4) EST_VAL / Unit → EST_VAL#unit
(5) EST_PWR / Unit → EST_PWR#unit
(6) CUR_PWR / Unit → CUR_PWR#unit
(7) AVG_PWR / Unit → AVG_PWR#unit
(8) SYNC_PER
Explanation of values
Item Signal type 0, 1 – 2
(automatic)
Signal type 1 – 2 (manual) Signal type 3
Energy:
(work)
Previous Last archived energy value
from the previous
synchronization period
Last archived energy value
from the last time period
entered
Last archived energy value
from the previous
synchronization period
Instant. Energy value accumulated
within the current
synchronization period
Energy consumption of the
time period entered
Energy value accumulated
within the current
synchronization period
Forecast Extrapolated accumulated
energy value to end of
synchronization period
See Energy (Work): Instant. Extrapolated accumulated
energy value to end of
synchronization period
Power: Prev. Avg Last archived average power
value
Average power value for the
last time period entered
Last archived average power
value
Instant. Current power value See Power: Instant. Current power value
Forecast Extrapolated average power
value to end of
synchronization period
See Power: Instant. Extrapolated average power
value to end of
synchronization period
Description of blocks
3.2 PRE_SUM: Energy acquisition and processing
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 27
Table (TABLE)
Display of archived, accumulated energy values and average power values from the
database
(1) Archive tag S: Added energy value (LAST_VAL)
(2) Archive tag V: Average power value (AVG_PWR)
Edit (EDIT)
(1) V_MAN_Lx / Unit V_MAN_Lx#unit (x = 1 ... 3)
(2) V_MAN_Lx_DATE / V_MAN_Lx_TIME (x = 1 ... 3)
(3) SET / Text → SET#string_1
(4) V_MAN_DATE / V_MAN_TIME
(5) V_MAN/Unit →V_MAN#unit
Description of blocks
3.3 PRE_FIFO_DATA: FIFO buffer
SIMATIC PCS 7 powerrate
28 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Maintenance (MAINTENANCE)
The accumulated energy values and average power values in the archive can be changed in
this view.
Note
The changed values are not checked for consistency. The user is responsible for ensuring
the values are correct.
(1) Archive tag .S: Added energy value (LAST_VAL)
(2) Archive tag .V: Average power value (AVG_PWR)
Trend (@PCS7_Trend)
If archiving of accumulated energy values is active, the S (added energy value) and V
(average power value) archive tags are shown in the trend view.
If accumulated energy values are not activated, the trend view contains the CUR_VAL
(current energy) and CUR_PWR (current power) online tags.
3.3 PRE_FIFO_DATA: FIFO buffer
FB1062
3.3.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
Description of blocks
3.3 PRE_FIFO_DATA: FIFO buffer
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 29
3.3.2 Called blocks
The block calls the following blocks:
SFC6 RD_SINFO
FC1062 PRE_FIFO_IO
3.3.3 Function
The PRE_FIFO_DATA block serves as a buffer for measured values to be archived and that
supply the PRE_SUM FB and are sent by the PRE_AR_SND FB to WinCC.
It is used as a place holder for the buffer data block in CFC and is connected with the
PRE_SUM and PRE_AR_SND blocks. Parameterization of data block numbers is therefore
transferred to PRE_SUM and PRE_AR_SND.
The PRE_FIFO_IO function is responsible for organizing the cyclic buffer.
The source of the block is contained in the library. The user can thereby adjust the length of
the buffer.
The number of elements inside the FIFO buffer can be changed in the NO_ITEMS constant.
The buffer items are of data type UDT_PRE_ITEM (see "UDT_PRE_ITEM (Page 112)").
Description of blocks
3.4 PRE_AR_DATA: Data interface for sending the archive data
SIMATIC PCS 7 powerrate
30 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.3.4 Message behavior
The block has no message behavior.
3.3.5 Error behavior
The block has no error behavior.
3.3.6 Start-up characteristics
The block initializes the PRE_FIFO_IO function during initial startup. When the CPU is
started up subsequently, the pointers are retained.
3.3.7 Block parameter
Item Data type Type Meaning HMI
FIFO INT O Number of the FIFO DB
ITEM_LEN INT O Length of an element
ITEM_NO INT O Number of elements
3.4 PRE_AR_DATA: Data interface for sending the archive data
FB1063
3.4.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
3.4.2 Called blocks
The block calls the following blocks:
FB1064 PRE_AR_SND
Description of blocks
3.4 PRE_AR_DATA: Data interface for sending the archive data
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 31
3.4.3 Function
The PRE_AR_DATA function block contains the data interface for the archive data to be sent
and calls the PRE_AR_SND block which sends the archive data to WinCC.
The memory area for telegram data is located in the instance DB.
The source of the block is contained in the library. The user can thereby adjust the length of
the telegram data.
The number of elements inside the telegram data can be changed in the NO_ITEMS
constant.
Please note the resource restrictions when using the S7 functions "AR_SEND" and "BSEND
/ BRCV" to communicate with an S7-400. No more than 16 Kbytes of data can be
simultaneously sent by the AS to WinCC using the AR_SEND and/or BSEND/BRCV
functions.
The message frame items are of data type UDT_PRE_TLG (see "UDT_PRE_TLG
(Page 112)") and are 26 bytes in length.
3.4.4 Message behavior
The message behavior is programmed in the called block PRE_AR_SND. The interface to
the messages is the PRE_AR_DATA FB.
Description of blocks
3.4 PRE_AR_DATA: Data interface for sending the archive data
SIMATIC PCS 7 powerrate
32 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
PRE_AR_DATA issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QERR Communication error PLC pr ctrl
failure
2 QPARAMF Parameterization error PLC pr ctrl
failure
3 Free
4 Free
5 Free
6 Free
7 Free
MSG_EVID
8 Free
3.4.5 Error behavior
The block has no error behavior.
3.4.6 Start-up characteristics
Messages are suppressed during startup.
3.4.7 Block parameter
Item Data type Type Meaning HMI
ACK_TEL DWORD IO Acknowledgment frame +
AR_EVID DWORD I Archive number for archive send block AR_SEND
AR_STAT WORD O AR_SEND: STATUS Output
FIFO INT I Link to FIFO data
MSG_ACK WORD O Messages acknowledged, ALARM_8P block
MSG_EVID DWORD I Event ID of the ALARM_8P message block
MSG_STAT WORD O MESSAGE: STATUS Output
QERR BOOL O 1 = Error when sending archive
QMSG_ERR BOOL O 1 = ALARM_8P Error
QMSG_SUP BOOL O 1 = Message suppression
QPARAMF BOOL O 1 = Parameterization error
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time in [s]
SEND_T REAL I Monitoring time send request
Description of blocks
3.5 PRE_AR_SND: Archiving measured values
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 33
3.5 PRE_AR_SND: Archiving measured values
FB1064
3.5.1 Calling blocks
The block is called by the PRE_AR_DATA FB.
3.5.2 Called blocks
The block calls the following blocks:
SFB35 ALARM_8P
SFB37 AR_SEND
SFC6 RD_SINFO
SFC24 TEST_DB
FC1062 PRE_FIFO_IO
3.5.3 Function
The PRE_AR_SND function block reads the values from the FIFO buffer, produces the
telegram data for writing the values to the OS, and sends them to WinCC with SFB37
AR_SEND.
3.5.4 Message behavior
See "Message behavior (Page 31)" in "PRE_AR_DATA: Data interface for sending the
archive data".
3.5.5 Error behavior
The QPARAMF error output is set when
The parameterized archive DB is not present
The archive DB length is too short
The QERR error output is set when
An error has occurred while writing to WinCC.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
34 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.5.6 Start-up characteristics
Messages are suppressed during startup.
3.5.7 Block parameter
Item Data type Type Meaning HMI
ACK_TEL DWORD IO Acknowledgment frame
AR_DB INT I DB number for archive data
AR_EVID DWORD I Archive number for the AR_SEND archive send block
AR_STAT WORD O AR_SEND: STATUS Output
FIFO_DB INT I DB number for FIFO
MSG_ACK WORD O Messages acknowledged, ALARM_8P block
MSG_EVID DWORD I Event ID of the ALARM_8P message block
MSG_STAT WORD O MESSAGE: STATUS Output
QERR BOOL O 1 = Error when sending archive
QMSG_ERR BOOL O 1 = ALARM_8P Error
QMSG_SUP BOOL O 1 = Message suppression
QPARAMF BOOL O 1 = Parameterization error
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time in [s]
SEND_T REAL I Monitoring time send request
3.6 PRE_LMGM / PRE_LMGM_x: Load management
PRE_LMGM FB1065
PRE_LMGM_75 FB1066
PRE_LMGM_50 FB1067
PRE_LMGM_25 FB1068
PRE_LMGM_10 FB1069
3.6.1 Calling blocks
The OB watchdog interrupt in which you install the block (e.g. OB32). Also in OB100 (see
start-up characteristics).
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 35
3.6.2 Called blocks
The block calls the following blocks:
FC1 AD_DT_TM
(IEC function from the STEP 7 Standard Library)
SFB31 NOTIFY_8P
SFB35 ALARM_8P
SFC6 RD_SINFO
SFC20 BLKMOV
SFC21 FILL
SFC51 RDSYSST
3.6.3 Function
In the context of power management systems, load management refers to monitoring the
power limit agreed with the power supply company for each time interval. The time interval
depends on the type of energy used; for electricity it is typically 15 minutes, for gas 1 hour.
The following general functions of the load management are implemented in powerrate:
Calculating the difference in power based on actual consumption and the trend
transferred to the PRE_SUM block at the end of the period
Monitoring the reference limit
Issuing a warning/alarm if a limit is about to be exceeded
Archiving of supplementary information in the case of limit violations
Generating a release/hold signal for every load, based on the priority list and taking the
load's min./max. disconnect times and min. connect times into account
Blocks are provided for this with different quantity structures depending on the required
number of loads:
The following blocks are available:
PRE_LMGM_10 up to 10 loads
PRE_LMGM_25 up to 25 loads
PRE_LMGM_50 up to 50 loads
PRE_LMGM_75 up to 75 loads
PRE_LMGM up to 100 loads
Only the block PRE_LMGM is listed in the remaining description. The function of the blocks
is identical apart from the number of loads.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
36 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
General information about the configuration
The load management configuration is stored in WinCC user archives. Please note that
these archives must be licensed.
Load management is configured in the faceplate. By editing and saving the parameters in
the different views, the data is loaded to the controller and also written to WinCC user
archives.
To guarantee that the actual status of the priority list in the PLC is used for the configuration,
the function "Load from PLC" in the faceplate view "Edit priolist" can be used.
Before performing a general download of the controller, it is advisable to read the program
back in CFC so that the latest configuration will remain active after a CPU restart.
If readback is not possible, or if an old configuration is to be activated, the entire
configuration can be loaded immediately from the faceplate view "Configuration" to the
controller.
The most recent configuration can be identified by means of the config ID (if known) or the
"start of configuration" and "end of configuration" time stamps (the latter will be empty).
Configuration of total energy consumption/total supply power
The PRE_SUM block is used to acquire the total energy (CUR_VAL) / the total supply power
(CUR_PWR), including calculation of trends up to the end of the period
(EST_VAL/EST_PWR) and the energy / average power value at the end of the period
(LAST_VAL / AVG_PWR). The block parameters must be connected accordingly.
Configuration of loads
The block can manage up to 100 loads. The number of the highest input to which a load will
be connected must be specified via the MAX_LOAD input. Settings can be made for each
load. The associated parameters are described below, where x represents the number of the
load and can be a value of 01 - 100.
The Px input contains the current load power. This input is only evaluated if the MODEx
input (see below) has a value of 1.
The rated power is specified at the CAPx input. The rated power always serves as the basis
for performing a calculation during connection. If MODEx = 2 or 3, it is assumed that the load
will run at rated power when enabled.
The ONx input is connected to the load's switching state (only MODEx = 2).
The type of load is set via the MODEx input:
MODEx Type of load
1 Actual power of the load is connected to the Px input
2 Switching state of the load is connected to the ONx input
3 Only the load's rated power is known
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 37
Depending on its type, a load will be considered to be disabled under the following
conditions:
Type of load Condition for "OFF"
MODEx = 1
Px < CAPx*MAX_STBY/100.0
Current load power is lower than maximum standby power
of the load
MODEx = 2
ONx = FALSE
Feedback "OFF"
MODEx = 3
QONx = FALSE
Load not released by load management
A minimum connect time, a minimum disconnect time, and a maximum disconnect time are
parameterized at the MIN_ONx, MIN_OFFx, and MAX_OFFx inputs for each load:
Minimum connect time is how long the load must remain enabled following its release
before it can be held again.
Minimum disconnect time is the minimum length of time the load must be shed before it
can be released again.
Maximum disconnect time is the maximum length of time the load may be shed before it
has to be re-enabled (MAX_OFFx = 0 means there is no max. disconnect time).
The block contains the SHED_Tx and EN_Tx output variables, which are of data type REAL,
for each load. The time in seconds since the last connect/disconnect procedure is saved in
these variables. A load cannot be held until the minimum connect time has elapsed, nor can
it be released again until the minimum disconnect time has elapsed. Once the maximum
disconnect time has elapsed without consideration of the SETTLE_T settling time, a shed
load is automatically released without any other conditions being checked, unless it is in
manual mode.
The value of the MAX_STBYx input is used to determine the maximum standby power of
every load.
The load management block generates a hold/release signal, depending on the specified
limit and the calculated trend.
A hold signal means that load management calculations have indicated that the load should
be disabled. The hold signal can either disable a load directly, if it is connected accordingly,
or the load can be linked to other conditions so that process boundary conditions can be
taken into account. The same applies to the release signal, which indicates that a load
should be enabled.
Where reference is made in the following to connection/disconnection or load shedding, it is
assumed that the release/hold signals have caused the load to be enabled/disabled directly,
but this does not necessarily have to be the case.
The difference in power is calculated from the difference between the specified power limit
and the estimated average power at the end of the period (EST_PWR). The power limit
value may take a hysteresis into account at the start of the period, if necessary. Load
shedding takes place if the difference in power is lower than 0 and both the SUPP_T
suppression time and the SETTLE_T settling time have elapsed. Released loads or groups
of loads in the priority list are shed, starting with the highest priority loads and taking the
minimum connect time into account, until the total shed power (current power Px or rated
power CAPx for loads without power feedback) is greater than the difference in power.
Loads with the same priority represent a group and will always be shed together. Following
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
38 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
load shedding, the SETTLE_T settling time is allowed to expire before a new load shedding
procedure is executed or loads are reconnected, if required.
Requirements for load shedding:
Parameter Meaning
EN_SHED = TRUE General release for load shedding
EN_SHEDx = TRUE Load is in load management mode, so is not deactivated
MANx = FALSE Load is not in manual mode
P_DIFF < 0 Negative difference in power
QSUPP_T ≤ 0 Suppression time has elapsed
QSETTLE_T ≤ 0 Settling time has elapsed
QMIN_ONx = FALSE Load's minimum connect time has elapsed
The QONx output is set to FALSE for shed loads.
Loads with status feedback
If load x does not have separate power feedback, but just ONx status feedback, and ONx =
TRUE it is assumed that the load is running at its rated power CAPx; if ONx = FALSE it is
assumed that no power is being used. A disabled load (ONx = FALSE) will also be shed, if it
is next in line according to the priority list. However, no power is added in order to reach the
difference in power.
Releasing shed loads
If loads have been shed and the P_DIFF difference in power is greater than 0 once the
SETTLE_T settling time has elapsed, loads are released again. Shed loads or groups of
shed loads are released, starting with the lowest priority loads and taking the minimum
disconnect time into account, until the total released power (CAPx rated power) is greater
than the difference in power. Loads with the same priority represent a group. Because of
this, they always will be released together, if the load management allows this. It is not
possible to release several loads within a group. Following release of a load, the SETTLE_T
settling time is allowed to expire before a new load shedding procedure or release is
executed, if required.
If a low-priority load cannot be released because its rated power is greater than the available
difference in power, no high-priority load is released either.
If the settling time and maximum disconnect time (MAX_OFFx) of disconnected load x have
elapsed, the load is released unconditionally.
The QONx output is set to TRUE for released loads.
Load control
Hysteresis
To avoid switching operations occurring too frequently, particularly at the start of the period,
a hysteresis aimed at increasing the limit at which load shedding is triggered (HYS_LIMP)
can be configured in accordance with the algorithm shown below.
The block checks whether the value entered for the end of the hysteresis (HYS_T) is greater
than zero and lower than the period time (SYNC_PER). If this is not the case, HYS_T is reset
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 39
to its previous value when a change is made. If the period time (SYNC_PER) is changed to a
value lower than HYS_T, HYS_T is set to the new period time.
6<1&B3(5+<6B7
6833B7
/,0B3
+<6B3:
/,0B3
+<6B/,03W
7LPHW
HQGRISHULRG

SRZHUYDOXHWDNLQJWKHK\VWHUHVLVLQWRDFFRXQW
W+<6B7
+<6B/,03W
W! +<6B7
+<6B/,03W /,0B3
+<6B7
&DOFXODWLRQRI+<6B/,03W
/,0B3+<6B3:ದ/,0B3
W/,0B3+<6B3:
Description of parameters
LIM_P Power limit
HYS_LIM
P
Current power limit, taking the hysteresis into account
HYS_PW Hysteresis starting value as a % of the power or work maximum at the start of
a period
HYS_T Time after start of the period after which no hysteresis is to be taken into
account any longer
t Time since start of current period
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
40 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Delay time (suppression time)
Another way of preventing unnecessary switching operations at the start of the period is to
configure a delay time (suppression time) SUPP_T, during which no load shedding will be
performed and the "limit about to be exceeded" warning/alarm messages will not be issued.
Idle time
An idle time can be configured to deal with the inertia of a load following a switching
operation.
After load shedding or the release of loads due to the difference in power, the block waits for
the SETTLE_T settling time to elapse before a new load shedding procedure or release is
executed. (SETTLE_T = 0 means that no settling time will be taken into account).
If a load is connected because of the elapsed maximum disconnect time, the settling time
does not have to elapse until another load is connected
Priority list
Assigning a priority
Each load has a PRIOx input, at which the load's priority is parameterized as a number (1 to
255). 1 is the highest priority, 0 means that the load is not participating in load management
or that no load is present. Disconnection is performed from the highest priority down to the
lowest, i.e. the load with priority 1 is disconnected first.
Loads with the same priority form a priority group.
The loads in the priority list must be deleted and reinserted by changing the connections in
the CFC plan. A load is assigned to a priority group and/or a rolling group in the "Edit prio
list" faceplate view in WinCC and loaded to the controller using "Save".
Note
If priorities (PRIOx) or assignments to rolling groups (ROLLx) have been changed in the
CFC plan, it is essential that a recalculation is performed in the faceplate. The "Load from
PLC" command must be executed in the "Edit prio list" faceplate view to transfer the
modified values from the block to WinCC.
Rolling loads
Each load has an input named ROLLx, which defines whether the load is a rolling load within
the priority group (ROLLx > 0) or not (ROLLx = 0). Rolling loads all have the same priority.
The ROLLx parameter is used to specify the sequence in which these loads are
disconnected.
This procedure means that the load disconnected for a particular priority is not always the
same one; rather, it changes each time.
Groups can also be formed in order to switch loads together. Loads with the same priority
and same ROLLx parameter form a group of loads, which are switched together. Several
load groups may exist for the same priority.
If a group of loads with the same priority (= priority group) is shed, all non-rolling loads are
shed, as are the rolling loads starting with the first ROLLx number.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 41
Behavior of rolling load groups:
If several loads have the same ROLLx number, they cannot be shed until at least one load is
in the load management and not in manual mode and its minimum connect time has
elapsed. If the minimum connect time of all loads has not elapsed, an attempt is made to
shed the next group of rolling loads.
If the maximum disconnect time of a load located within a group of rolling loads elapses, this
load is reconnected (without consideration of the settling time). The next group of rolling
loads is not disconnected until it is required due to the difference in power.
Rolling load groups are only ever connected as a group in the case of a positive difference in
power, i.e. a single load will not be connected if the difference in power is only sufficient for
it.
If the next group of rolling loads within a priority group cannot be disconnected because at
least one load of the currently disconnected group has yet to be reconnected, loads of the
next priority level will be disconnected to prevent a deadlock from occurring, if necessary.
Irrespective of that, the next group of rolling loads will be connected as soon as all loads in
the current group have been reconnected.
Tariffs
The block has three tariffs (on-peak tariff, off-peak tariff, and Sunday or holiday tariff). Either
a work limit or a power limit can be defined for each tariff.
The limit values can be defined either via the faceplate or the configurable inputs. You can
switch between the operator-controllable limit values (LIM_L = FALSE) and the configurable
limit values (LIM_L = TRUE) via the LIM_L input.
LIM_W_H: Operator-controllable work limit for on-peak tariff
LIM_W_L: Operator-controllable work limit for off-peak tariff
LIM_W_SH: Operator-controllable work limit for Sunday or holiday tariff
L_LIM_W: Configurable work limit
LIM_P_H: Operator-controllable power limit for on-peak tariff
LIM_P_L: Operator-controllable power limit for off-peak tariff
LIM_P_SH: Operator-controllable power limit for Sunday or holiday tariff
L_LIM_P: Configurable power limit
If SEL_PW = TRUE the limits must be defined as power values; if SEL_PW = FALSE , they
must be defined as work limits.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
42 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
The block receives the CPU's current UTC time via its CUR_TS input from the PRE_SYNC
block, which is internally converted to local time. The block uses the BEG_HT (start time for
on-peak tariff) and BEG_LT (start time for off-peak tariff) inputs to decide whether the limit for
the on- or off-peak tariff should be applied.
On-peak tariff applies when BEG_HT < BEG_LT and BEG_HT ≤ time ≤ BEG_LT, else off-
peak tariff
Off-peak tariff applies when BEG_LT < BEG_HT and BEG_LT ≤ time ≤ BEG_HT, else on-
peak tariff
Off-peak tariff applies, when both times are equal.
Setting the SH_ACT (Sunday or holiday active) input causes the Sunday or holiday tariff to
be used for the next day (starting at 00:00). The SH_NUM input is used to set how many
consecutive days the Sunday/holiday tariff will remain active before it is switched back to the
on-/off-peak tariff.
The current work and power limits are displayed at the LIM_W and LIM_P outputs in each
case.
Quality code
The validity of the CUR_PWR, CUR_VAL and EST_VAL parameters is monitored via their
QC_CUR_PWR, QC_CUR_VAL and QC_EST_VAL quality codes. The same applies to the
current power of the individual loads (Px)/their switching feedback (ONx), whose quality
codes are connected to the QC_Px or QC_ONx inputs.
The quality code of the current power of the individual loads does not influence the choice of
loads to be shed. In case of a bad quality code no power credit is granted for accomplishing
the difference in power.
The following quality code data is evaluated:
Quality code = 16#80: Valid value
Quality code <> 16#80: Invalid value, external error or simulation
Archiving
Loading of data from the faceplate is initiated via the inputs S_CFG (overall configuration),
S_PRIO (priority list) of the PRE_LMGM block, or when the block limit is exceeded. The
PRE_LMGM block sends a request for archiving data via its output structure QREQ_S_ST to
the block PRE_UA_S (archive manager for writing).
The archive manager informs the load management block that the job has been completed
with or without errors via the input structure SND_ST.
The output ARCH_OK is set if the job has been saved and can be transferred to the archive
manager. ARCH_OK is reset with the next archiving request.
A job is time-monitored by the PRE_LMGM block.
The number of the archive containing the configuration data of the block instance of the
PRE_LMGM is defined at the input parameter ARCH_ID. For this reason, each instance of
the PRE_LMGM block must be assigned a unique archive ID ARCH_ID > 0. (If the ARCH_ID
has the value 3, for example, the data of the instance is contained in the
PRE_LMGM_CONFIG_3, PRE_LMGM_PRIO_3 and PRE_LMGM_LIM_3 archives).
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 43
Structure of the user archives
The user archive PRE_LMGM_PRIO_x (Prioritätenliste) has the following data structure:
Field name Data type Block parameter Meaning
NAME STRING[32] NAMEx Load name
CAP FLOAT CAPx Rated power (kW)
MODUS INTEGER MODEx Mode
PRIO INTEGER PRIOx Priority
ROLL_NO INTEGER ROLL_NOx Rolling sequence
GRP INTEGER GRPx Group
MIN_ON FLOAT MIN_ONx Min. connect time [s]
MIN_OFF FLOAT MIN_OFFx Min. disconnect time [s]
MAX_OFF FLOAT MAX_OFFx Max. disconnect time [s]
MAX_STBY FLOAT MAX_STBY Max. standby power [%]
The user archive PRE_LMGM_CONFIG_x (configuration) has the following data structure:
Field name Data type Block parameter Meaning
SRT_T DATE_AND_TIME - Start time of the configuration
END_T DATE_AND_TIME - End time of the configuration
BEG_HT STRING[8] BEG_HT_S Start time on-peak tariff
BEG_LT STRING[8] BEG_LT_S Start time off-peak tariff
LIM_W_H FLOAT LIM_W_H Energy limit on-peak tariff [kWh]
LIM_P_H FLOAT LIM_P_H Power limit on-peak tariff [kW]
LIM_W_L FLOAT LIM_W_L Energy limit off-peak tariff [kWh]
LIM_P_L FLOAT LIM_P_L Power limit off-peak tariff [kW]
LIM_W_SH FLOAT LIM_W_SH Energy limit holiday tariff [kWh]
LIM_P_SH FLOAT LIM_P_SH Power limit holiday tariff [kW]
SEL_PW INTEGER SEL_PW 0 = Energy, 1 = Power
EN_SHED FLOAT EN_SHED Release for load shedding
SETTLE_T FLOAT SETTLE_T Settling time [s]
LIM_WRN FLOAT LIM_WRN Warning threshold [%]
LIM_ALM FLOAT LIM_ALM Alarm threshold [%]
HYS_PW FLOAT HYS_PW Hysteresis start value [%]
HYS_T FLOAT HYS_T Hysteresis time range [s]
SUPP_T FLOAT SUPP_T Suppression time [min]
NAME STRING[32] NAMEx Load
CAP FLOAT CAPx Rated power (kW)
MODUS INTEGER MODUSx Mode
PRIO INTEGER PRIOx Priority
ROLL_NO INTEGER ROLL_NOx Rolling sequence
GRP INTEGER GRPx Group
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
44 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Field name Data type Block parameter Meaning
MIN_ON FLOAT MIN_ONx Min. connect time [s]
MIN_OFF FLOAT MIN_OFFx Min. disconnect time [s]
MAX_OFF FLOAT MAX_OFFx Max. disconnect time [s]
MAX_STBY FLOAT MAX_STBYx Max. standby power [%]
CONFIG_ID INTEGER - Configuration ID
The user archive PRE_LMGM_LIM_x (limit violations) has the following data structure:
Field name Data type Block parameter Meaning
DATE_TIME DATE_AND_TIME LT_DT Local time
LIM_W FLOAT LT_LIM_W Work limit of last period
LIM_P FLOAT LT_LIM_P Power limit of last period
W FLOAT LT_W Work in the last period
P FLOAT LT_P Average power in the last period
SHED_POS FLOAT LT_SHED_POS Number of loads which could be shed at
end of last period
P_SHED_POS FLOAT LT_P_SHED_POS Power of loads which could be shed at
end of last period
LOAD_SHED FLOAT LT_LOAD_SHED Number of switched-off loads at the end
of the period
P_SHED FLOAT LT_P_SHED Power of the switched-off loads at the
end of the period
Archiving in the case of limit violations
When a limit is violated, an archiving request is issued at the end of the synchronization
period. The load management block calculates and saves the time of the limit violation.
The current values archived in the user archive at the time of the limit violation are copied to
their own outputs beginning with "LT_" (for LAST).
Archiving of the configuration
All the configuration data (tariffs, general parameters and priority list) is saved under a
configuration ID (CONFIG_ID) in the user archive PRE_LMGM_CONFIG_x. Every time the
configuration is saved, the configuration ID is incremented by 1 up to the value of the input
CFG_MAX. Following this, the configuration is overwritten with ID 1. Each saved
configuration contains the times at which the configuration was valid.
Saving of the configuration in the user archive is initiated either by the user from the
faceplate view "Configuration" by pressing the "Load from PLC" button, or automatically after
the tariff data, general parameters, or the priority list have been loaded into the controller.
When opening the "Configuration" faceplate view, the currently valid configuration is
selected. Older configurations that can also be loaded into the controller (see below) are
displayed by deleting or modifying the selection criterion.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 45
Downloading the configuration to the controller
Configuration data can be transferred to the controller from the faceplate views
"Parameters", "Tariffs", "Edit Priolist" and "Configuration".
With the "Save" button in the "Parameters" or "Tariffs" views, the data entered in the
faceplate is written to the user archive PRE_LMGM_CONFIG_x and transferred from there to
the controller. If the "Parameters" or "Tariffs" views are closed before saving the data,
changes made here are lost, while the data in the "Edit Priolist" and "Configuration" views in
the user archives is retained but not transferred to the controller.
Loading of data from the faceplate is initiated via the inputs R_CFG (overall configuration),
R_PARA (parameters), R_TARIFF (tariffs) or R_PRIO (priority list) of the PRE_LMGM block.
The PRE_LMGM block issues a request for reading data via its output structure
QREQ_R_ST to the PRE_UA_R block (archive manager for reading). The archive manager
informs the load management block that the job has been completed with or without errors
via the input structure RCV_ST.
The NDR output is set when new data has been received. NDR is reset with the next request
for reading data.
A job is time-monitored by the PRE_LMGM block.
The number of the archive from which the configuration data of the block instance of
PRE_LMGM is read is defined at the input parameter ARCH_ID. For this reason, each
instance of the PRE_LMGM block must be assigned a unique archive ID ARCH_ID> 0. (If the
ARCH_ID has the value 3, for example, the data of the instance is contained in the
PRE_LMGM_CONFIG_3, PRE_LMGM_PRIO_3 and PRE_LMGM_LIM_3 archives).
Every time configuration data is loaded, the current configuration is automatically saved in
the configuration archive (PRE_LMGM_CONFIG_x).
Loads and load management on different PLCs
If loads and load management are running on different PLCs, the current load power (Px,
QC_Px)/current switching state (ONx, QC_ONx) must be transferred to the controller on
which the PRE_LMGM block is running, and information relating to releasing/shedding
(QONx output) transferred to the controller on which the load is running.
The PRE_AS_SEND / PRE_AS_RECV (send/receive block for AS-to-AS communication)
and PRE_SND_H / PRE_RCV_H (send/receive block for AS-4xxH to AS-400
communication) blocks supplied can be used for communication purposes.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
46 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.6.4 Message behavior
PRE_LMGM issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QLIM_WRN Warning approaching of limit @1%.2f@ kWh/@3%.2f@
kW (limit @2%.2f@ kWh/@4%.2f@ kW)
WH
2 QLIM_ALM Alarm approaching of limit @1%.2f@ kWh/@3%.2f@
kW (limit @2%.2f@ kWh/@4%.2f@ kW)
AH
3 QLIM_ERR Exceeding of limit: @5%.2f@ kWh/@6%.2f@ kW (limit
@2%.2f@ kWh/@4%.2f@ kW)
AH
4 QSHED_IMP No load available to shed AH
5 QLMGM_OFF Load management deactivated AH
6 QELD_PARA Monitoring error while loading parameters AH
7 QLIM_E Invalid limit AH
MSG_EVID1
8 QP_ERR Invalid supply power AH
1 Reserved
2 Reserved
3 Reserved
4 Reserved
5 QPRIO_LST_E Invalid priority list AH
6 QPARAMF Parameterization error communication PLC pr ctrl
failure
7 QERR_R Invalid data from loading parameters PLC pr ctrl
failure
MSG_EVID2
8 QERR_S Invalid data archiving PLC pr ctrl
failure
1 QMONERR_S Monitoring error archiving PLC pr ctrl
failure
2 QOVL_LIM Overflow of user archive for limit exceedings PLC pr ctrl
failure
3 Free
4 Free
5 Free
6 Free
7 Free
MSG_EVID3
8 Free
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 47
Message block Message
number
Block
parameter
Message text Message
class
1 QSHED Load @1%s@ has been shed Status
PLC
2 QFREE Load @2%s@ has been shed Status
PLC
3 Free
4 Free
5 Free
6 Free
7 Free
MSG_EVID4
8 Free
The ALARM_8P auxiliary values are assigned as follows:
Message block Auxiliary value Parameter Meaning
1 EST_VAL Estimated energy value at end of synchronization
period
2 HYS_LIMW Current, work limit, taking the hysteresis into
account
3 EST_PWR Average power value at end of synchronization
period
4 HYS_LIMP Current, average power limit, taking the hysteresis
into account
5 LAST_VAL Last archived, accumulated work value
6 AVG_PWR Average power at end of period
7 Free
8 Free
9 Free
MSG_EVID1
MSG_EVID2
MSG_EVID3
10 Free
The NOTIFY_8P auxiliary values are assigned as follows:
Message block Auxiliary value Parameter Meaning
1 NAMEx Name of the load which has been held
2 NAMEx Name of the load which has been released
3 Free
4 Free
5 Free
6 Free
7 Free
8 Free
9 Free
MSG_EVID4
10 Free
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
48 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.6.5 Error behavior
Validity of input parameters
If the associated quality codes detect an invalid value at the CUR_PWR, CUR_VAL or
EST_VAL input parameters, an "Invalid supply power" message is issued and load
management is switched off.
An invalid value for load feedback will mean that, if the load is shed, no power will be used to
compensate the difference in power for this load.
Switching load management off
Behavior of the PRE_LMGM block in the event of an error, i.e. if load management needs to
be switched off:
Load control remains in its current state until the end of the period, i.e. it is not connected
or disconnected any more. However, the user can still perform a manual release/hold
operation.
If the error is still present once the period has ended, all loads are released, taking their
hold times into account.
If a trend can be calculated, this calculation is also performed and displayed. No
overshoot alarms/warnings are issued, however.
Parameterization error
A parameterization error QPARAMF is generated when
The monitoring time T_OUT_LD is ≤ 0
ID ≤ 0
ARCH_ID ≤ 0 or ARCH_ID not available, or
The archive manager block for reading or writing signals QARCHERR when the block ID
agrees
If the monitoring time is incorrect, a new request cannot be generated.
Error in communication with WinCC user archives
The QERR_R / QERR_S output is set when
A read or write request has been issued to the archive manager and the parameter IDs
JOB_ID and ARCH_ID do not agree between the request and the response of the archive
manager.
The QERR_R / QERR_S output is not reset until a new request is pending or until the
request agrees with the job data when the job is repeated (COUNT > 0).
If a valid response is not received from the archive manager within the monitoring time, the
error output QELD_PARA / QMONERR_S is set. At the COUNT input, a number of job
repetitions can be set before the occurred errors are output. If, for example, a monitoring
time of 10 seconds is set and COUNT = 1, the monitoring error is not signaled until
20 seconds have elapsed. The parameterization error is an exception to this. This error is
signaled immediately.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 49
All errors remain pending until a new request is transmitted.
A job is always repeated when one of the errors described above has occurred.
3.6.6 Start-up characteristics
After a CPU restart, the PRE_SUM block does not provide a valid supply power at its
CUR_VAL output until after the first synchronization pulse. Until this point, load management
is not performed.
The following applies between a restart and the first synchronization pulse:
All loads are released (QONx = TRUE).
The time since the loads were released (EN_Tx) starts at 0. This time forms the basis for
the minimum connect time.
The outputs for limits which take the hysteresis into account (HYS_LIMW and HYS_LIMP)
do not themselves take any hysteresis into account.
All messages have the "sent" state.
The balance time in the current period (BAL_TM and BAL_TS) is set to 0.
The differences in work and power are set to 0.
The available connection and disconnection power (P_ON and P_SHED) and the number
of loads to be disconnected and connected (EN_POS and SHED_POS) are calculated
now. The number of shed loads (LOAD_SHED) is 0.
The available connection and disconnection work (W_ON and W_SHED) is set to 0, as
the period's balance time is not known.
The average power/work of the last period (LT_P and LT_W) is set to 0.
Flags for the last rolling load (LAST_ROLLx) are set to 0.
If necessary, the processes of editing and downloading a configuration from the faceplate
are aborted (CFG_EDIT = FALSE and CFG_LOAD = FALSE).
The remaining suppression time after the start of the period and settling time after load
shedding (QSUPP_T and QSETTLE_T) are set to 0.
The following also applies after restart:
The error outputs are reset.
The output structures QREQ_R_ST and QREQ_S_ST for the read and write requests
from/to user archives are reset.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
50 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.6.7 Block parameters
General data
Item Data type Type Meaning HMI
BAL_TM INT O Period's balance time in minutes +
BAL_TS INT O Period's balance time in seconds +
CUR_TS DT I Current time stamp when block is called
DIFF_LOC REAL O Difference between UTC and local time in [h]
MAX_LOAD INT IO Number of the highest input, which is connected to a load +
MSG_ACKx WORD O Messages acknowledged, ALARM_8P block x (x = 1 ... 3)
MSG_EVIDx DWORD I Event ID x (x = 1 ... 4) of message block
ALARM_8P / NOTIFY_8P
MSG_LOCK BOOL I 1 = Message suppression active
MSG_STATx WORD O MESSAGE x (x = 1 ... 4): STATUS Output
QMSG_ERR BOOL O 1 = ALARM_8P / NOTIFY_8P Error
QMSG_SUP BOOL O 1 = Message suppression
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time in [s]
SYNC_P BOOL I Synchronization pulse
Infeed
Item Data type Type Meaning HMI
AVG_PWR REAL I Average power at end of synchronization period
CUR_PWR REAL I Current power at end of acquisition period +
CUR_PWRHR REAL I Bar graph upper limit, current power +
CUR_VAL REAL I Current integrated value +
CUR_VALHR REAL I Bar graph upper limit, current accumulated energy value +
EST_PWR REAL I Average power by end of acquisition period +
EST_VAL REAL I Probable value by end of acquisition period +
LAST_VAL REAL I Last archived, accumulated value +
P_DIFFHLR REAL I Bar graph upper limit, difference in power +
QC_AVG_PWR BYTE I Quality code for AVG_PWR
QC_CUR_PWR BYTE I Quality code for CUR_PWR
QC_CUR_VAL BYTE I Quality code for CUR_VAL
QC_EST_PWR BYTE I Quality code for EST_PWR
QC_EST_VAL BYTE I Quality code for EST_VAL
QC_LAST_VAL BYTE I Quality code for LAST_VAL
W_DIFFHLR REAL I Bar graph upper limit, difference in work +
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 51
Load data
Item Data type Type Meaning HMI
CAPx REAL I Rated power of the load x (x = 01 ... 10, 25, 50, 75 or 100)
DUMMY_IN STRUCT I Internal structure
DUMMY_PARA STRUCT I Internal structure
DUMMY_OUT STRUCT O Internal structure
EN_SHEDx BOOL I 1 = Load x (x = 01 ... 10, 25, 50, 75 or 100) is in load management
mode
EN_Tx REAL O Time elapsed since load x was released (x = 01 ... 100) +
GR_NAMEx STRING[32] I Name of load group x (x = 01 ... 20) +
GRPx BYTE I Allocation of the load x (x = 01 ... 10, 25, 50, 75 or 100) to a load
group
LAST_ROLLx BOOL I Load x (x = 01 ... 10, 25, 50, 75 or 100): 1 = Last disconnected,
rolling load
MAN_ENx BOOL I Manual mode (MANx = TRUE): 0 = Disable, 1 = Release +
MANx BOOL I 1 = Load x (x =01 ... 100) is in manual mode +
MAX_OFFx REAL I Maximum disconnect time of the load x (x = 01 ... 10, 25, 50, 75 or
100) in [s]
MAX_STBYx REAL I Maximum standby power as a percentage of rated power of the load
x (x = 01 ... 10, 25, 50, 75 or 100)
MIN_OFFx REAL I Minimum disconnect time of the load x (x = 01 ... 10, 25, 50, 75 or
100) in [s]
MIN_ONx REAL I Minimum connect time of the load x (x = 01 ... 10, 25, 50, 75 or 100)
in [s]
MODEx BYTE I Type of load x (x=01..100):
0 = No load present,
1 = Actual power of the load is connected to the Px input
2 = Switching state of the load is connected at the ONx input
3 = Only the load's rated power is known
NAMEx STRING[32] I Name of load x (x=01..100)
ONx BOOL I 1=Load x (x=01..100) is enabled with rated power CAPx +
PRIOLSTx DWORD I Priority list for load shedding entry x (x = 01 ... 10, 25, 50, 75 or 100)
PRIOx BYTE I Priority of the load x (x = 01 ... 10, 25, 50, 75 or 100) (1 = highest
priority)
Px REAL I Current power of the load x (x = 01 ... 10, 25, 50, 75 or 100) +
QC_ONx BYTE I Quality code for ONx
QC_Px BYTE I Quality code for Px
QMAX_OFFx BOOL O 1=Maximum disconnect time for load x has not yet elapsed
(x = 01 ... 100)
+
QMIN_OFFx BOOL O 1=Minimum disconnect time for load x has not yet elapsed
(x = 01 ... 100)
+
QMIN_ONx BOOL O 1=Maximum connect time for load x has not yet elapsed
(x = 01 ... 100)
+
QMSG_OFFx BOOL O 1 = Hold message is sent to WinCC (x = 01 ... 10, 25, 50, 75 or 100)
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
52 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Item Data type Type Meaning HMI
QMSG_ONx BOOL O 1 = Release message is sent to WinCC (x = 01 ... 10, 25, 50, 75 or
100)
QONx BOOL O 1=Load x is released, 0=Load x is shed (x=01..100) +
ROLLx BYTE I Load x (x=01..100): Number for rolling load
SHED_Tx REAL O Time elapsed since load x was held (x=01..100) +
Load control
Item Data
type
Typ
e
Meaning HMI
Dx BOOL I Internal tag (x = 101 ... 107 and 201 ... 207)
EN_POS INT O Number of loads which can be connected
EN_SHED BOOL I Load shedding release (loads disconnected)
HYS_LIMP REAL O Current, average power limit, taking the hysteresis into account +
HYS_LIMW REAL O Current work limit, taking the hysteresis into account: If
HYS_LIMW < EST_VAL load shedding is performed
+
HYS_PW REAL I Hysteresis starting value as a [%] of the power or work maximum at
the start of a period
HYS_T REAL I Time after start of the period after which no hysteresis is to be taken
into account any longer [min]
LIM_ALM REAL I Limit for alarm message indicating a limit is about to be exceeded as
a [%] of LIM_W/LIM_P
LIM_P REAL O Current power limit without hysteresis +
LIM_W REAL O Current work limit without hysteresis +
LIM_WRN REAL I Limit for warning message indicating a limit is about to be exceeded
as a [%] of LIM_W/LIM_P
LOAD_SHED INT O Number of shed loads by load management
LT_DT DT O Time stamp of last limit violation
LT_LIM_P REAL O Power limit of last period with limit violation
LT_LIM_W REAL O Work limit of last period with limit violation
LT_LOAD_SHED DINT O Number of shed loads at end of last period with limit violation
LT_P* REAL O Average power of last period with limit violation
LT_P_SHED* REAL O Power of shed loads at end of last period with limit violation
LT_P_SHED_POS* REAL O Power of sheddable loads at end of last period with limit violation
LT_SHED_POS* DINT O Number of sheddable loads at end of last period with limit violation
LT_W* REAL O Average work of the last period
P_DIFF REAL O Difference in power: HYS_LIMP – EST_PWR +
P_ON_POS REAL O Available connection power +
P_SHED REAL O Shed power
P_SHED_POS REAL O Available disconnection power +
QC_W_DIFF BYTE O Quality code for W_DIFF
QC_P_DIFF BYTE O Quality code for P_DIFF
QFREE BOOL O Load has been released
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 53
Item Data
type
Typ
e
Meaning HMI
QLIM_ALM BOOL O Alarm indicating a limit is about to be exceeded
QLIM_E BOOL O Invalid limit
QLIM_ERR BOOL O Limit overshoot
QLIM_WRN BOOL O Warning indicating a limit is about to be exceeded
QLMGM_OFF BOOL O 1 = Load management deactivated
QP_ERR BOOL O Invalid supply power
QPRIO_LST_E BOOL O 1 = Errored priority list
QSETTLE_T REAL O Remaining settling time after load shedding/release in [s] +
QSHED BOOL O Load has been held
QSHED_IMP BOOL O No load available to shed
QSUPP_T REAL O Remaining suppression time after start of period in [s] +
SEL_PW BOOL I Limit selector:
0=Setting of maximum average power (LIM_P_H, LIM_P_L and
LIM_P_SH) within a period,
1=Setting of maximum work (LIM_W_H, LIM_W_L, and LIM_W_SH)
within a period
SETTLE_T REAL I Settling time [s]
SHED_POS INT O Number of loads which can be switched
SUPP_T REAL I Suppression time [min]
W_DIFF REAL O Difference in work: HYS_LIMW - EST_VAL +
W_ON_POS REAL O Available connection work +
W_SHED_POS REAL O Available disconnection work +
*These parameters are not evaluated or supplied in this version.
Tariffs
Item Data type Type Meaning HMI
ADJ_D_H* DWORD I Date on which the automatic on-peak tariff adjustment ends in
[ddmmyyyy]
+
ADJ_D_L* DWORD I Date on which the automatic off-peak tariff adjustment ends in
[ddmmyyyy]
+
ADJ_D_SH* DWORD I Date on which the automatic Sunday and holiday tariff adjustment
ends in [ddmmyyyy]
+
ADJ_LIM* BOOL I Limits adjusted automatically in the event of an overshoot +
ADJ_TEOM* BOOL I 1 = The ADJ_TIME time does not start until the end of the month
following limit adjustment
+
ADJ_TIME* INT I Time in [months] for which a limit is valid following automatic
adjustment
+
ADJ_VAL* REAL I Percentage by which the limit is adjusted automatically following an
overshoot
+
BEG_HT DINT I Start time for on-peak tariff (local time) [ms]
BEG_HT_S STRING[8] I Start time for on-peak tariff (local time) [ms] as string
BEG_LT DINT I Start time for off-peak tariff (local time) [ms]
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
54 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Item Data type Type Meaning HMI
BEG_LT_S STRING[8] I Start time for off-peak tariff (local time) [ms] as string
EN_SCHEDULE* BOOL I 1= Load management active according to schedule +
L_LIM_P REAL I Configurable power limit
L_LIM_W REAL I Configurable work limit
LIM_L BOOL I 1= configurable limits (L_LIM_P/L_LIM_W) active
LIM_P_H REAL IO Power limit for on-peak tariff
LIM_P_L REAL IO Power limit for off-peak tariff
LIM_P_SH REAL IO Power limit for Sunday or holiday tariff
LIM_W_H REAL IO Work limit for on-peak tariff
LIM_W_L REAL IO Work limit for off-peak tariff
LIM_W_SH REAL IO Work limit for Sunday or holiday tariff
NT_END_D* REAL I End date for next period in [ddmmyyyy] +
NT_END_D* REAL I End time for next period in [hhmm] +
NT_P* REAL I Maximum average power for next period +
NT_SRT_D* REAL I Start date for next period in [ddmmyyyy] +
NT_SRT_T* REAL I Start time for next period in [hhmm] +
QADJ_LIM_H* BOOL O 1 = Automatic on-peak tariff adjustment executed +
QADJ_LIM_L* BOOL O 1 = Automatic off-peak tariff adjustment executed +
QADJ_LIM_SH* BOOL O 1 = Automatic Sunday and holiday tariff adjustment executed +
QNXT_LE* BOOL O No limit for next period +
SH_ACT BOOL IO 1 = Sunday or holiday tariff active +
SH_NUM INT IO Number of days for which the Sunday and holiday tariff is valid if
SH_ACT = TRUE
+
*These parameters are not evaluated or supplied in this version.
Archiving
Item Data type Type Meaning HMI
ARCH_ID INT I Archive ID
ARCH_OK BOOL O Job completion Ok
CFG_CUR INT I ID of the current configuration in the user archive +
CFG_EDIT BOOL I 1 = Configuration being processed +
CFG_MAX INT I Maximum number of configurations in the user archive +
CFG_READ INT I ID of the configuration to be read in the user archive
COUNT INT I Number of job repetitions
ID INT I Block ID; unique number for this block
NDR BOOL O Receive new data
QARCH_ID INT O Archive ID
QELD_PARA BOOL O Monitoring error while loading parameters
QERR_R BOOL O Group error – receive job
QERR_S BOOL O Group error send job
QMONERR_S BOOL O Monitoring error send job
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 55
Item Data type Type Meaning HMI
QMSG_ERR BOOL O 1 = Signal generation error
QREQ_ACT BOOL O Request pending
QREQ_R_ST UDT_PRE_REV_REQ O Request structure for receive request to archive
manager
QREQ_S_ST UDT_PRE_SND_REQ O Request structure for send request to archive manager
QOVL_LIM BOOL O Overflow user archive limit violation
QPARAMF BOOL O Parameterization error
QT_LD REAL O Remaining time for loading parameters
R_CFG BOOL IO 1 = Read all configuration data +
R_PARA BOOL IO 1 = Read parameter +
R_TARIFF BOOL IO 1 = Read tariffs +
R_PRIO BOOL IO 1 = Read priority list +
RCV_ST UDT_PRE_RCV I Checkback signals from the receive job of the archive
manager
SCHED_CUR* INT IO ID of the data record from the PRE_SCHEDULE user
archive, which contains the currently valid limits
+
S_CFG BOOL IO 1 = Send all configuration data
S_PRIO BOOL IO 1 = Send priority list
SND_ST UDT_PRE_SND I Checkback signals from the send job of the archive
manager
T_OUT_LD REAL I Timeout for loading parameters
*These parameters are not evaluated or supplied in this version.
3.6.8 Description of icons and faceplate
Block icon
The following parameters are displayed:
Item Parameter Description
Power – Trend EST_PWR The calculated trend at the end of the period
Limit HYS_LIMP The currently valid limit
Faceplate
The faceplate available is described in this chapter.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
56 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
The following views are available:
Overview OVERVIEW
Standard STANDARD
Energy ENERGY
Parameter PARAMETERS
Bar para. BAR_PARA
Tariffs TARIFFS
Priority list PRIOLIST
Edit list of prio EDITPRIOLIST
Configuration CONFIG
Limit exceedings LIM_EXCEEDINGS
Messages
The file name is composed as follows: @PG_PRE_LMGM_<view>.PDL
The PCS 7 standard display is used for the messages view.
The structure of the individual views of faceplates is described below.
Standard (STANDARD)
This view shows the current load management status, based on calculated power values.


 
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 57
The following parameters are displayed:
Item Parameter Description
(1) Power – act. CUR_PWR The current supply power, shown as a bar graph
(2) Power – Trend EST_PWR The calculated trend at the end of the period, shown as a
bar graph
(3) Limit HYS_LIMP The currently valid limit, shown as a bar graph
(4) Difference P_DIFF The difference between the trend and the current limit,
shown as a bar graph
(5) Power – Actual CUR_PWR The current supply power, shown as a value
(6) Power – Trend EST_PWR The calculated trend at the end of the period
(7) Limit HYS_LIMP The currently valid limit
(8) Difference P_DIFF The difference between the trend and the current limit,
shown as a value
Shed / add
(9) shed P_SHED The disconnect power still available according to the priority
list
(10) add P_ON The connect power still available according to the priority
list
Remaining times
(11) Period SYNC_PER Synchronization period
(12) Suppression QSUPP_T Suppression time:
Time that must elapse from the start of the period before
load management becomes active
(13) Settling QSETTLE_T Settling time:
Specifies the time which must elapse following release/hold
before a new signal is set
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
58 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Energy (ENERGY)
This view shows the current load management status, based on calculated energy (work)
values.


 
The following parameters are displayed:
Item Parameter Description
(1) Energy – act. CUR_VAL The current supply energy, shown as a bar graph
(2) Energy – Trend EST_VAL The calculated trend at the end of the period, shown as
a bar graph
(3) Limit HYS_LIMW The currently valid limit, shown as a bar graph
(4) Difference W_DIFF The difference between the trend and the current limit,
shown as a bar graph
(5) Energy – Actual CUR_VAL The current supply energy, shown as a value
(6) Energy – Trend EST_PWR The calculated trend at the end of the period
(7) Limit HYS_LIMW The currently valid limit
(8) Difference W_DIFF The difference between the trend and the current limit,
shown as a value
shed / add
(9) shed W_SHED The disconnect energy still available according to the
priority list
(10) add W_ON The connect energy still available according to the
priority list
Remaining times
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 59
Item Parameter Description
(11) Period SYNC_PER Synchronization period
(12) Suppression QSUPP_T Suppression time:
Time that must elapse from the start of the period
before load management becomes active
(13) Settling QSETTLE_T Settling time:
Specifies the time which must elapse following
release/hold before a new signal is set
Parameters (PARAMETERS)
General load management parameters can be set in this view.
Item Parameter Description
(1) Limit source SEL_PW Specifies whether the limit will be defined as energy (work) or
power.
(2) Release of load shed EN_SHED If this box is checked, loads are released/held in accordance
with the priority list.
If the box is not checked, only a trend calculation and limit
monitoring are performed, i.e. corresponding messages are
output if a limit is about to be exceeded.
(3) Stabilization delay SETTLE_T Specifies the time which must elapse following release/hold
before a new signal can be set
(4) Hysteresis starting value HYS_PW Percentage value based on the current limit for the hysteresis
starting value at the start of the period
(5) Hysteresis time window HYS_T Time until hysteresis has reached 0, i.e. until the specified
limit is used as a basis.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
60 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Item Parameter Description
(6) Suppression time SUPP_T Time which must elapse from the start of the period before
load management becomes active
(7) Period synchro. SYNC_PE
R
Time for the specified limit (for electricity, usually 15 min);
this value is configured at the PRE_SUM block.
Threshold Specifies when a warning or alarm will be output. The values
are given as percentages of the specified limit
(8) Warning limit LIM_WRN Percentage value of the limit after which a warning message
is issued indicating a limit is about to be exceeded
(9) Alarm limit LIM_ALM Percentage value of the limit after which an alarm message
is issued indicating a limit is about to be exceeded
The values in brackets are not accessed direct from the faceplate. When opening the
faceplate, the values are read from the user archive PRE_LMGM_CONFIG_x. When saving
the parameters, these values are first transferred to the user archive and then from there to
the parameters of the PRE_LMGM block.
Bar para. (BAR_PARA)
The limits for bar graphs displayed in the standard view are specified in this view.
The following parameters are displayed:
Item Parameter Description
Bar graph upper limit
(1) Power CUR_PWRHR Bar graph upper limit for power
(2) Energy CUR_VALHR Bar graph upper limit for energy
Diff. bar graph upper limit
(3) Power P_DIFFHLR Bar graph upper limit for difference in power
(4) Energy W_DIFFHLR Bar graph upper limit for difference in energy
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 61
Tariffs (TARIFFS)
This view shows the current tariff and enables the individual tariff limits to be changed.
 

Item Parameter Description
Active tariff
(1) Power LIM_P Shows the currently valid tariff as power.
(2) Energy LIM_W Shows the currently valid tariff as energy.
On-peak tariff
(3) Power LIM_P_H Power limit for on-peak tariff
(4) Energy LIM_W_H Energy limit for on-peak tariff
(5) Start time on-peak tariff BEG_HT / BEG_HT_S Start time for on-peak tariff
Off-peak tariff
(6) Power LIM_P_L Power limit for off-peak tariff
(7) Energy LIM_W_L Energy limit for off-peak tariff
(8) Start time off-peak tariff BEG_LT / BEG_LT_S Start time for off-peak tariff
Holiday tariff
(9) Power LIM_P_SH Power limit for holiday tariff
(10) Energy LIM_W_SH Energy limit for holiday tariff
(11) Tariff active SH_ACT From 00:00 of the next day, the holiday tariff applies for
"Number of days" (until 24:00)
(12) Number of days SH_NUM Number of days for holiday tariff
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
62 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
If power is selected as "type of limit" in the parameter view, only the power values can be
edited, and if "work" is selected, only the work values can be edited. The other limit in each
case is calculated on the basis of the period time when saving.
The values in brackets are not accessed direct from the faceplate. When opening the
faceplate, the values are read from the user archive PRE_LMGM_CONFIG_x. When saving
the parameters, these values are first transferred to the user archive and then from there to
the parameters of the PRE_LMGM block.
Priority list (PRIOLIST)
This view shows the current status of the individual loads in load management mode and
allows the user to remove certain loads from load management control and to release them
manually.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 63

Item Parameter Description
(1) Load name NAMEx Shows the name of the load.
(2) Available QONx Indicates whether the load is currently released via load
management or not.
(3) In load management EN_SHEDx Defines whether the load is included in load management control or
not.
(4) In manual MANx Defines whether the load can be released manually or not.
(5) Manual add MAN_ENx This manually releases the load so that it is no longer under load
management control.
(6) Nominal power Px Shows the load's calculated power, provided it exists.
(7) Connected ONx Shows the status of the load, provided the load has status
feedback.
(8) Capacity CAPx Contains the load's configured rated power.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
64 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Item Parameter Description
(9) Priority PRIOx Shows the load's priority, which is used for holding.
(10) Rolling sequence ROLLx Specifies the sequence in which loads of the same priority are
disconnected in a rolling process. If loads have the same priority
and rolling sequence, they are switched together as a group.
x = 01 to 10, 25, 50, 75 or 100
Detailed information about the load:
Detailed information is available for every load, including the configured hold times and the
type of load, i.e. whether the load features power feedback (=1), status feedback (=2), or no
feedback (=3). The window is displayed by clicking the name of the load.
Item Parameter Description
(1) Type of load MODEx Load type/mode:
0 = No load present,
1 = Actual power of the load is connected to the Px input
2 = Switching state of the load is connected at the ONx
input
3 = Only the load's rated power is known
(2) Min. connect time MIN_ONx Minimum time the load must be released before it can be
held again
(3) Min. connect time active QMIN_ONx 1 = Minimum connect time has not yet elapsed
(4) Min. disconnect time MIN_OFFx Minimum time the load must be held before it can be
released again
(5) Min. disconnect time
active
QMIN_OFFx 1 = Minimum disconnect time has not yet elapsed
(6) Max. disconnect time MAX_OFFx Maximum time the load may be held
(7) Max. disconnect time
active
QMAX_OFFx 1 = Maximum disconnect time has not yet elapsed
x = 01 to 10, 25, 50, 75 or 100
The values in brackets are not accessed direct from the faceplate. When opening the
faceplate, the values are read from the user archive PRE_LMGM_CONFIG_x.
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 65
Edit list of prio (EDITPRIOLIST)
This view allows the user to edit load parameters and to load the current configuration from
the PLC.
Item Parameter Description
(1) Load NAMEx Name of the load
(2) Capacity CAPx Load's rated power
(3) Mode MODEx Load status feedback:
0: No load present
1: Power acknowledgment signal
2: Status acknowledgment signal
3: No acknowledgement signal
(4) Priority PRIOx Shows the load priority used for holding
(5) Rolling sequence ROLLx Specifies the sequence in which loads of the same priority are
disconnected in a rolling process. If loads have the same priority and
rolling sequence, they are switched together as a group.
(6) Min. connect time MIN_ONx Minimum time the load must be released before it can be held again
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
66 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Item Parameter Description
(7) Min. disconnect time MIN_OFFx Minimum time the load must be held before it can be released again
(8) Max. disconnect time MAX_OFFx Maximum time the load may be held
(9) Max. standby MAX_STBYx Max. standby power of the load as a percentage of the rated power
x = 01 to 10, 25, 50, 75 or 100
Configuration (CONFIG)
This list contains the current and the last CFG_MAX configurations of the load management
(user archive PRE_LMGM_CONFIG_x). When openeing the faceplate view, the current
configuration (CONFIG_ID = CFG_CUR) is always selected. By entering the CONFIG_ID,
any configuration can be selected, and by entering a filter condition, all configurations can be
selected.
The configurations can be displayed, printed out, exported, imported, and loaded into the
controller. As well as the time stamp of its validity, each configuration contains the values
from the faceplate views "Parameters", "Tariffs" and "Edit Priolist".
Description of blocks
3.6 PRE_LMGM / PRE_LMGM_x: Load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 67
Violations (LIM_EXCEEDINGS)
The archived limit violations (user archive PRE_LMGM_LIM_x) are displayed in this list. The
list can be exported.
Description of blocks
3.7 PRE_AS_SEND: AS-to-AS communication
SIMATIC PCS 7 powerrate
68 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.7 PRE_AS_SEND: AS-to-AS communication
FB1070
3.7.1 Calling blocks
The OB watchdog interrupt in which you install the block (e.g. OB32). Also in OB100 (see
start-up characteristics).
3.7.2 Called blocks
The block calls the following blocks:
FB1074 PRE_BS
SFB35 ALARM_8P
SFC6 RD_SINFO
3.7.3 Function
The block uses S7 communication (BSEND) to send data to another S7 station (BRCV). A
maximum of 30 REAL values and 30 binary values can be sent. Each value also has a
binary quality code, which specifies whether the measured value is free of errors or not.
Quality code
The QC_Rx, und QC_Bx (x=1..30) parameters contain the quality codes of the input signals
and must be connected to the QUALITY output of the associated driver blocks when using
the input signals selected.
Description of blocks
3.7 PRE_AS_SEND: AS-to-AS communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 69
3.7.4 Message behavior
PRE_AS_SEND issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QERR Communication error PLC pr ctrl
failure
2 MSG_2
3 MSG_3
4 MSG_4
5 MSG_5
6 MSG_6
7 MSG_7
MSG_EVID
8 MSG_8
The auxiliary values of the message blocks are assigned as follows:
Message block Auxiliary value Parameter Meaning
1 QSTATUS Data transfer status
2 AUX_PR02 Free
3 AUX_PR03 Free
4 AUX_PR04 Free
5 AUX_PR05 Free
6 AUX_PR06 Free
7 AUX_PR07 Free
8 AUX_PR08 Free
9 AUX_PR09 Free
MSG_EVID
10 AUX_PR10 Free
The auxiliary values (AUX_PRx, x = 02 to 10) of the message block can be freely assigned.
3.7.5 Error behavior
Monitoring the send process
The connection with the partner station is monitored. When an error is detected, the QERR
output is set and a summary event is sent to the OS. The QSTATUS status is also sent as
an auxiliary value, which indicates the precise cause of the error. A message is not
generated until the SUPPTIME (suppression time) has elapsed. This parameter is
adjustable.
Description of blocks
3.7 PRE_AS_SEND: AS-to-AS communication
SIMATIC PCS 7 powerrate
70 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
The send error is reset when at least one telegram containing valid data has been
successfully sent. If SUPPTIME < SAMPLE_T, the error message is generated immediately.
3.7.6 Start-up characteristics
The RUNUPCYC parameter can be used to set for how long (number of cycles) messages
are to be suppressed.
RESTART = TRUE can be used to simulate a restart.
3.7.7 Block parameters
Item Data type Type Meaning HMI
AUX_PRx ANY IO Auxiliary value 02 - 10
BOOLx REAL I BOOL values 1 - 30
DONE BOOL O Data transfer complete
ERR_COUNT DINT IO Error counter
FIRST_VAR BOOL I Start of send data
HISTLAST_STATUS WORD O Status of the last error
HISTLAST_TIME_STAMP DATE_AND_TIME O Time stamp of the last error
HISTx_STATUS WORD O Status of errors 1 - 4
HISTx_TIME_STAMP DATE_AND_TIME O Time stamp of errors 1 - 4
ID WORD I Connection ID
L_MSGLCK BOOL I Central message suppression can be
connected
LAST_VAR BOOL I End of send data
LEN_COUNT DINT IO Integration of the sent data count
MODE BYTE I 0=Send once
1=Send cyclically
2 – 255=Send every nth cycle
MSG_ACK WORD O Messages acknowledged
MSG_EVID DWORD I MESSAGE ID/ALARM_8P event ID
MSG_STAT WORD O STATUS output
MSG_x BOOL I Message input 2 ... 8
QC_Bx BYTE I Quality code BOOL value 1 – 30
QC_Rx BYTE I Quality code REAL value 1 – 30
QERR BOOL O 1=Error during data transfer
QLEN INT O Length of the sent data
QMSG_ERR BOOL O ALARM_8P error
QMSG_SUP BOOL O Message suppression
QSTATUS INT O Data transfer status
R_ID DWORD I Request ID for connection
Description of blocks
3.7 PRE_AS_SEND: AS-to-AS communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 71
Item Data type Type Meaning HMI
REALx REAL I REAL values 1 - 30
RES_HIST BOOL IO Reset history
RESTART BOOL I Manual startup
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time in [s]
SUPPTIME REAL I Suppression time in [s]
SWITCH BOOL I 1 = Send
Description of the status
xSTATUS Description
11 Alarm: New job not active because the previous job is still busy.
25 Communication has started. The job is being processed.
1 Communication problems, e.g. connection description not loaded (local or remote), connection interrupted
(e.g. cable, CPU off, CP in STOP mode)
2 Negative acknowledgment from partner SFB. The function cannot be executed.
3 R_ID is unknown on the connection specified by the ID or the receive block has not yet been called.
4 Error in the send area pointer SD_1 regarding data length or data type, or the value 0 was transferred with
LEN.
5 Reset request was executed.
6 The status of the partner SFB is DISABLED (value of EN_R is 0).
7 The status of the partner SFB is not correct (receive block not called since last data transfer).
8 Access to remote object in the user memory was rejected: The destination area at the associated SFB13
"BRCV" is too small (ERROR = 1, STATUS = 4 is reported at the associated SFB13 "BRCV").
10 Access to local user memory not possible (for example, access to deleted DB).
12 When the SFB was called, an instance DB that does not belong to SFB12 was specified,
a shared DB was specified instead of an instance DB,
no instance DB was found (loading a new instance DB from the PG).
18 R_ID already exists in the connection.
20 Insufficient work memory
-1 Connection error FIRST_VAR and / or LAST_VAR
-2 Internal error SFC20 BLKMOV
-3 Internal error SFC20 BLKMOV: Destination area too small
-4 Internal error SFC6 RD_SINFO
Description of blocks
3.8 PRE_AS_RECV: AS-to-AS communication
SIMATIC PCS 7 powerrate
72 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.8 PRE_AS_RECV: AS-to-AS communication
FB1071
3.8.1 Calling blocks
The OB alarm in which you install the block (e.g. OB32). Also in OB100 (see start-up
characteristics).
3.8.2 Called blocks
The block calls the following blocks:
FB1075 PRE_BR
SFC6 RD_SINFO
SFB35 ALARM_8P
3.8.3 Function
The block uses S7 communication (BRCV) to receive data from another S7 station
(BSEND). A maximum of 30 REAL values and 30 binary values can be sent Each value also
has a binary quality code, which specifies whether the measured value is free of errors or
not.
Quality code
The QC_Rx and QC_Bx (x=1..30) parameters contain the quality codes of the input signals
and must be connected to the QUALITY output of the associated driver blocks when using
the input signals selected.
In addition to the quality codes received, the quality code also provides the following
information:
Quality code = 16#14: Communication error, last valid value
Quality code = 16#18: Communication error, no valid value available
Description of blocks
3.8 PRE_AS_RECV: AS-to-AS communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 73
3.8.4 Message behavior
PRE_AS_RECV issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QERR Communication error PLC pr ctrl failure
2 MSG_2
3 MSG_3
4 MSG_4
5 MSG_5
6 MSG_6
7 MSG_7
MSG_EVID
8 MSG_8
The auxiliary values of the message blocks are assigned as follows:
Message block Auxiliary value Parameter Meaning
1 QSTATUS Data transfer status
2 AUX_PR02 Free
3 AUX_PR03 Free
4 AUX_PR04 Free
5 AUX_PR05 Free
6 AUX_PR06 Free
7 AUX_PR07 Free
8 AUX_PR08 Free
9 AUX_PR09 Free
MSG_EVID
10 AUX_PR10 Free
The auxiliary values (AUX_PRx, x = 02 to 10) of the message block can be freely assigned.
3.8.5 Error behavior
Monitoring the receive process
The connection with the partner station is monitored. When an error is detected, the QERR
output is set and a summary event is sent to the OS. The QSTATUS status is also sent as
an auxiliary value, which indicates the precise cause of the error. A message is not
generated until the SUPPTIME (suppression time) has elapsed. This parameter is
adjustable. The send error is reset when at least one telegram containing valid data has
been successfully sent.
If SUPPTIME < SAMPLE_T, the error message is generated immediately.
Description of blocks
3.8 PRE_AS_RECV: AS-to-AS communication
SIMATIC PCS 7 powerrate
74 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.8.6 Start-up characteristics
The RUNUPCYC parameter can be used to set for how long (number of cycles) messages
are to be suppressed.
RESTART = TRUE can be used to simulate a restart.
3.8.7 Block parameters
Item Data type Typ
e
Meaning HMI
AUX_PRx ANY IO Auxiliary value 02 - 10
BOOLx REAL O BOOL values 1 - 30 for connection
ERR_COUNT DINT IO Error counter
FIRST_VAR BOOL IO Start of receive data
HISTLAST_STATUS WORD O Status of the last error
HISTLAST_TIME_STAMP DATE_AND_TIME O Time stamp of the last error
HISTx_STATUS WORD O Status of errors 1 - 4
HISTx_TIME_STAMP DATE_AND_TIME O Time stamp of errors 1 - 4
ID WORD I Connection ID
IN_BOOLx REAL O BOOL values 1 - 30 receive buffer
IN_QC_Bx BYTE O Quality code BOOL value 1 – 30 receive buffer
IN_QC_Rx BYTE O Quality code REAL value 1 – 30 receive buffer
IN_REALx REAL O REAL values 1 - 30 receive buffer
L_MSGLCK BOOL I Central message suppression can be connected
LAST_VAR BOOL I End of receive data
LEN_COUNT DINT IO Integration of the sent data count
MSG_ACK WORD O Messages acknowledged
MSG_EVID DWORD I MESSAGE ID/ALARM_8P event ID
MSG_STAT WORD O STATUS output
MSG_x BOOL I Message input 2 ... 8
NDR BOOL O Receive new data
QC_Bx BYTE O Quality code BOOL value 1 – 30
QC_Rx BYTE O Quality code REAL value 1 – 30
QERR BOOL O 1=Error during data transfer
QLEN INT O Length of the received data
QMSG_ERR BOOL O ALARM_8P error
QMSG_SUP BOOL O Message suppression
QSTATUS INT O Data transfer status
R_ID DWORD I Request ID for connection
REALx REAL O REAL values 1 - 30 for connection
RES_HIST BOOL IO Reset history
RESTART BOOL I Manual startup
RUNUPCYC INT I Number of startup cycles
Description of blocks
3.9 PRE_SND_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 75
Item Data type Typ
e
Meaning HMI
SAMPLE_T REAL I Sampling time in [s]
SUPPTIME REAL I Suppression time in [s]
Description of the status
xSTATUS Description
11 Alarm: New job not active because the previous job is still busy.
17 Alarm: Block receiving data asynchronously.
25 Communication has started. The job is being processed.
1 Communication problems, e.g. connection description not loaded (local or remote), connection interrupted
(e.g. cable, CPU off, CP in STOP mode)
2 The function cannot be carried out.
4 Error in the receive area pointer RD_1 regarding data length or data type (data block sent is longer than
receive area).
5 Reset request received, incomplete transfer.
8 Access error in the corresponding SFB12 "BSEND": The data packet to be sent is larger than 452 bytes
and after the first data segment is sent, ERROR = 1 and STATUS = 4 are reported.
10 Access to local user memory not possible (for example, access to deleted DB).
12 When the SFB was called, an instance DB that does not belong to SFB13 was specified.
A shared DB was specified instead of an instance DB.
No instance DB was found (loading a new instance DB from the PG).
18 R_ID already exists in the connection.
20 Insufficient work memory
-1 Connection error FIRST_VAR and / or LAST_VAR
-2 Internal error SFC20 BLKMOV
-3 Internal error SFC20 BLKMOV: Destination area too small
-4 Internal error SFC6 RD_SINFO
3.9 PRE_SND_H: AS-4xxH <> AS-4xx communication
FB1072
3.9.1 Calling blocks
The OB alarm in which you install the block (e.g. OB32). Also in OB100 (see start-up
characteristics).
Description of blocks
3.9 PRE_SND_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
76 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.9.2 Called blocks
The block calls the following blocks:
FB1074 PRE_BS
SFB35 ALARM_8P
SFC6 RD_SINFO
3.9.3 Function
The block coordinates the process of sending telegrams between a redundant and a non-
redundant automation station by means of S7 communication (BSEND). A maximum of 30
REAL values and 30 binary values can be sent. Each value also has a binary quality code,
which specifies whether the measured value is free of errors or not.
AS-4xxH
A
S-4xx
(1) Connection #1
(2) Connection #2
35(B5&9B+
35(B5&9B+
35(B61'B+
35(B61'B+
6HQGGLUHFWLRQ
6HQGGLUHFWLRQ
Quality code
The QC_Rx and QC_Bx (x=1..30) parameters contain the quality codes of the input signals
and must be connected to the QUALITY output of the associated driver blocks when using
the input signals selected.
Description of blocks
3.9 PRE_SND_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 77
3.9.4 Message behavior
PRE_SND_H issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QERR_1 Communication failure conn. 1 PLC pr ctrl
failure
2 QERR_2 Communication failure conn. 2 PLC pr ctrl
failure
3 QERR_1,
QERR_2
Complete loss of communication PLC pr ctrl
failure
4 MSG_4
5 MSG_5
6 MSG_6
7 MSG_7
MSG_EVID
8 MSG_8
The auxiliary values of the message blocks are assigned as follows:
Message block Auxiliary value Parameter Meaning
1 QSTATUS_1 Data transfer status, connection 1
2 QSTATUS_2 Data transfer status, connection 2
3 AUX_PR03 Free
4 AUX_PR04 Free
5 AUX_PR05 Free
6 AUX_PR06 Free
7 AUX_PR07 Free
8 AUX_PR08 Free
9 AUX_PR09 Free
MSG_EVID
10 AUX_PR10 Free
The auxiliary values (AUX_PRx, x = 03..10) of the message block can be freely assigned.
3.9.5 Error behavior
Monitoring the send process
The two connections to the receiving partner are monitored separately. The block usually
sends data via both connections simultaneously.
When an error is detected, the QERR_1 / QERR_2 output is set and a summary event is
sent to the OS. Following a total failure of both connections, the auxiliary value (quality code)
supplied for every value is also activated. A message is not generated until the SUPPTIME
(suppression time) has elapsed. This parameter is adjustable.
Description of blocks
3.9 PRE_SND_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
78 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
The send error is reset when at least one telegram containing valid data has been
successfully sent. If SUPPTIME < SAMPLE_T, the error message is generated immediately.
3.9.6 Start-up characteristics
The RUNUPCYC parameter can be used to set for how long (number of cycles) messages
are to be suppressed.
RESTART = TRUE can be used to simulate a restart.
3.9.7 Block parameter
Item Data type Type Meaning HMI
AUX_PRx ANY IO Auxiliary value 03 - 10
BOOLx REAL I BOOL values 1 - 30
DONE_x BOOL O Data transfer complete, connection x
ERR_CNT_x DINT O Error counter, connection x
FIRST_VAR BOOL I Start of send data
HISTLAST_STATUS WORD O Status of the last error, connection x
HISTLAST_TIME_STAMP_x DATE_AND_TIME O Time stamp of the last error, connection x
HISTx_STATUS_x WORD O Status of errors 1 - 4, connection x
HISTx_TIME_STAMP_x DATE_AND_TIME O Time stamp of errors 1 - 4
ID_1 WORD I Connection ID, connection 1
ID_2 WORD I Connection ID, connection 2
L_MSGLCK BOOL I Central message suppression can be connected
LAST_VAR BOOL I End of send data
LEN_CNT_x DINT O Integration of the sent data count, connection x
MODE BYTE I 0=Send once
1=Send cyclically
2 – 255=Send every nth cycle
MSG_ACK WORD O Messages acknowledged
MSG_EVID DWORD I MESSAGE ID/ALARM_8P event ID
MSG_STAT WORD O STATUS output
MSG_x BOOL I Message input 4 ... 8
QC_Bx BYTE O Quality code BOOL value 1 – 30
QC_Rx BYTE O Quality code REAL value 1 – 30
QERR_x BOOL O 1=Error during data transfer, connection x
QLEN_x INT O Length of the sent data, connection x
QMSG_ERR BOOL O ALARM_8P error
QMSG_SUP BOOL O Message suppression
QSTATUS_x INT O Data transfer status, connection x
R_ID_1 DWORD I Request ID for connection 1
Description of blocks
3.9 PRE_SND_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 79
Item Data type Type Meaning HMI
R_ID_2 DWORD I Request ID for connection 2
REALx REAL I REAL values 1 - 30
RES_HI_1 BOOL IO Reset history, connection 1
RES_HI_2 BOOL IO Reset history, connection 2
RESTART BOOL I Manual startup
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time in [s]
SUPPTIME REAL I Suppression time in [s]
SWITCH BOOL I 1 = Send
Description of the status
XSTATUS Description
11 Alarm: New job not active because the previous job is still busy.
25 Communication has started. The job is being processed.
1 Communication problems, e.g. Connection description not loaded (local or remote), connection
interrupted (e.g. cable, CPU off, CP in STOP mode)
2 Negative acknowledgment from partner SFB. The function cannot be executed.
3 R_ID is unknown on the connection specified by the ID or the receive block has not yet been called.
4 Error in the send area pointer SD_1 regarding data length or data type, or the value 0 was transferred with
LEN.
5 Reset request was executed.
6 The status of the partner SFB is DISABLED (value of EN_R is 0).
7 The status of the partner SFB is not correct (receive block not called since last data transfer).
8 Access to remote object in the user memory was rejected: The destination area at the associated SFB13
"BRCV" is too small (ERROR = 1, STATUS = 4 is reported at the associated SFB13 "BRCV").
10 Access to the local user memory not possible (for example, access to a deleted DB).
12 When the SFB was called, an instance DB that does not belong to SFB12 was specified,
a shared DB was specified instead of an instance DB,
no instance DB was found (loading a new instance DB from the PG).
18 R_ID already exists in the connection.
20 Insufficient work memory
-1 Connection error FIRST_VAR and/or LAST_VAR
-2 Internal error SFC20 BLKMOV
-3 Internal error SFC20 BLKMOV: Destination area too small
-4 Internal error SFC6 RD_SINFO
Description of blocks
3.10 PRE_RCV_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
80 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.10 PRE_RCV_H: AS-4xxH <> AS-4xx communication
FB1073
3.10.1 Calling blocks
The OB watchdog interrupt in which you install the block (e.g. OB32). Also in OB100 (see
start-up characteristics).
3.10.2 Called blocks
The block calls the following blocks:
FB1075 PRE_BR
SFB35 ALARM_8P
SFC6 RD_SINFO
3.10.3 Function
The block coordinates the process of receiving telegrams between a redundant and a non-
redundant automation station by means of S7 communication (BRCV). A maximum of 30
REAL values and 30 binary values can be sent. Each value also has a binary quality code,
which specifies whether the measured value is free of errors or not.
AS-4xxH
A
S-4xx
(1) Connection #1
(2) Connection #2
35(B5&9B+
35(B5&9B+
35(B61'B+
35(B61'B+
6HQGGLUHFWLRQ
6HQGGLUHFWLRQ
Description of blocks
3.10 PRE_RCV_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 81
Quality code
The QC_Rx and QC_Bx (x=1..30) parameters contain the quality codes of the input signals
and must be connected to the QUALITY output of the associated driver blocks when using
the input signals selected.
In addition to the quality codes received, the quality code also provides the following
information:
Quality code = 16#14: Communication error, last valid value
Quality code = 16#18: Communication error, no valid value available
3.10.4 Message behavior
PRE_RCV_H issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QERR_1 Communication failure conn. 1 PLC pr ctrl
failure
2 QERR_2 Communication failure conn. 2 PLC pr ctrl
failure
3 QERR_1,
QERR_2
Complete loss of communication PLC pr ctrl
failure
4 MSG_4
5 MSG_5
6 MSG_6
7 MSG_7
MSG_EVID
8 MSG_8
The auxiliary values of the message blocks are assigned as follows:
Message block Auxiliary value Parameter Meaning
1 QSTATUS_1 Data transfer status, connection 1
2 QSTATUS_2 Data transfer status, connection 2
3 AUX_PR03 Free
4 AUX_PR04 Free
5 AUX_PR05 Free
6 AUX_PR06 Free
7 AUX_PR07 Free
8 AUX_PR08 Free
9 AUX_PR09 Free
MSG_EVID
10 AUX_PR10 Free
The auxiliary values (AUX_PRx, x = 03..10) of the message block can be freely assigned.
Description of blocks
3.10 PRE_RCV_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
82 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.10.5 Error behavior
Monitoring the receive process
The two connections to the sending partner are monitored separately. If the process is
functioning without errors, the receive data is transferred from the first connection; if one
connection fails, the data is transferred from whichever of the two connections still exists.
When an error is detected, the QERR_1 / QERR_2 output is set and a summary event is
sent to the OS. Following a total failure of both connections, the auxiliary value (quality code)
supplied for every value is also activated. A message is not generated until the SUPPTIME
(suppression time) has elapsed. This parameter is adjustable.
The send error is reset when at least one telegram containing valid data has been
successfully sent. If SUPPTIME < SAMPLE_T, the error message is generated immediately.
3.10.6 Start-up characteristics
The RUNUPCYC parameter can be used to set for how long (number of cycles) messages
are to be suppressed.
RESTART = TRUE can be used to simulate a restart.
3.10.7 Block parameter
Item Data type Type Meaning HMI
AUX_PRx ANY IO Auxiliary value 03 - 10
BOOLx REAL O BOOL values 1 - 30 for connection
DUMMY WORD IO Dummy
ERR_CNT_1 DINT O Error counter
FIRST_VAR_1 BOOL IO Pointer initial value, connection 1
FIRST_VAR_2 BOOL IO Pointer initial value, connection 2
HISTLAST_STATUS_x WORD O Status of the last error, connection x
HISTLAST_TIME_STAMP_x DATE_AND_TIME O Time stamp of the last error, connection x
HISTx_STATUS_x WORD O Status of errors 1 - 4, connection x
HISTx_TIME_STAMP_x DATE_AND_TIME O Status of errors 1 - 4, connection x
ID_1 WORD I Connection ID, connection 1
ID_2 WORD I Connection ID, connection 2
IN_BOOLx_1 REAL IO BOOL values 1 - 30 for readback
IN_BOOLx_2 REAL IO BOOL values 1 - 30 for readback
IN_QC_Bx_1 BYTE IO Quality code BOOL value 1 – 30 for readback
IN_QC_Bx_2 BYTE IO Quality code BOOL value 1 – 30 for readback
IN_QC_Rx_1 BYTE IO Quality code REAL value 1 – 30 for readback
IN_QC_Rx_2 BYTE IO Quality code REAL value 1 – 30 for readback
IN_REALx_1 REAL IO REAL values 1 - 30 for readback
Description of blocks
3.10 PRE_RCV_H: AS-4xxH <> AS-4xx communication
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 83
Item Data type Type Meaning HMI
IN_REALx_2 REAL IO REAL values 1 - 30 for readback
L_ACT_CON BOOL O Last active connection: 0=Connection 1,
1=Connection 2
L_MSGLCK BOOL I Central message suppression can be connected
LAST_VAR_1 BOOL IO End ID receive buffer readback, connection 1
LAST_VAR_2 BOOL IO End ID receive buffer readback, connection 2
LEN_CNT_1 DINT O Integration of the sent data count
MSG_ACK WORD O Messages acknowledged
MSG_EVID DWORD I MESSAGE ID/ALARM_8P event ID
MSG_STAT WORD O STATUS output
MSG_x BOOL I Message input 4 ... 8
NDR_2 BOOL O Receive new data for connection 2
QC_Bx BYTE O Quality code BOOL value 1 – 30
QC_Rx BYTE O Quality code REAL value 1 – 30
QERR_2 BOOL O 1=Error during data transfer for connection
QLEN_2 INT O Length of the received data for connection
QMSG_ERR BOOL O ALARM_8P error
QMSG_SUP BOOL O Message suppression
QSTATUS_2 INT O Data transfer status for connection
R_ID_1 DWORD I Request ID for connection 1
R_ID_2 DWORD I Request ID for connection 2
REALx REAL O REAL values 1 - 30 for connection
RES_HI_x BOOL IO Reset history, connection x
RESTART BOOL I Manual startup
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time in [s]
SUPPTIME REAL I Suppression time in [s]
Description of the status
xSTATUS Description
11 Alarm: New job not active because the previous job is still busy.
17 Alarm: Block receiving data asynchronously.
25 Communication has started. The job is being processed.
1 Communication problems, e.g. connection description not loaded (local or remote), connection interrupted
(e.g. cable, CPU off, CP in STOP mode)
2 The function cannot be carried out.
4 Error in the receive area pointer RD_1 regarding data length or data type (data block sent is longer than
receive area).
5 Reset request received, incomplete transfer.
Description of blocks
3.11 PRE_BS: Calling the BSEND system function block
SIMATIC PCS 7 powerrate
84 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
xSTATUS Description
8 Access error in the corresponding SFB 12 "BSEND": The data packet to be sent is larger than 452 bytes
and after the first data segment is sent, ERROR = 1 and STATUS = 4 are reported.
10 Access to local user memory not possible (for example, access to deleted DB).
12 When the SFB was called, an instance DB that does not belong to SFB13 was specified.
A shared DB was specified instead of an instance DB.
No instance DB was found (loading a new instance DB from the PG).
18 R_ID already exists in the connection.
20 Insufficient work memory
-1 Connection error FIRST_VAR and/or LAST_VAR
-2 Internal error SFC20 BLKMOV
-3 Internal error SFC20 BLKMOV: Destination area too small
-4 Internal error SFC6 RD_SINFO
3.11 PRE_BS: Calling the BSEND system function block
FB1074
3.11.1 Calling blocks
The block is called internally.
3.11.2 Called blocks
The block calls the following blocks:
SFB12 BSEND
SFC1 READ_CLK
SFC6 RD_SINFO
SFC20 BLKMOV
3.11.3 Function
The block forms the internal interface for communication in the send direction.
Description of blocks
3.12 PRE_BR: Calling the BRCV system function block
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 85
3.12 PRE_BR: Calling the BRCV system function block
FB1075
3.12.1 Calling blocks
The block is called internally.
3.12.2 Called blocks
The block calls the following blocks:
SFB13 BRCV
SFC1 READ_CLK
SFC6 RD_SINFO
SFC20 BLKMOV
3.12.3 Function
The block forms the internal interface for communication in the receive direction.
3.13 PRE_SUMC: Batch-related energy acquisition
FB1077
3.13.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
Description of blocks
3.13 PRE_SUMC: Batch-related energy acquisition
SIMATIC PCS 7 powerrate
86 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.13.2 Called blocks
The block calls the following blocks:
SFB35 ALARM_8P
SFC6 RD_SINFO
SFC20 BLKMOV
SFC21 FILL
SFC51 RDSYSST
FC1 AD_DT_TM
(IEC function from the STEP 7 Standard Library)
FC28 NE_DT
(IEC function from the STEP 7 Standard Library)
3.13.3 Function
The PRE_SUMC block adds the energy consumption for 5 energy types from each of 10
loads (VALx_y) with the same unit and allocates the entire energy consumption (CUR_VALx,
LASTVALx) to one batch.
Recording of energy consumption is started and stopped with an input signal. The energy
consumption recorded in this period is archived in WinCC user archives (PRE_SUMC_x)
with the start and end point and information about the batch. Archiving is carried out with the
archive manager block for writing PRE_UA_S.
The input signal for energy recording is independent of the synchronization pulse.
The PRE_SUM block supplies the work values of the individual loads.
Structure of the user archives
The user archive has the following data structure:
Field name Data type Block parameter Meaning
BA_NA STRING[32] BA_NA Batch name
STARTTIME DATE_AND_TIME - Start time
ENDTIME DATE_AND_TIME - End time
UNIT STRING[24] UNIT System
BA_ID INT BA_ID Batch ID
REC_NA STRING[32] REC_NA Recipe name
VALUEx REAL CUR_VALx Total work value x (x = 1 ... 5)
VAL_UNITx STRING[8] VALUNITx Unit x (x = 1 ... 5)
TYPEx STRING[32] TYPEx Energy type x (x = 1 ... 5)
Description of blocks
3.13 PRE_SUMC: Batch-related energy acquisition
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 87
The PRE_SUMC block combines the consumption data pending at the inputs, with the
exception of the start and end point. These data points are derived from the Boolean input
signal ACTIVE.
The user archives have the name PRE_SUMC_x (x corresponds to the archive ID). A more
meaningful name can be entered in the alias. This name can contain, for example, the
designation of the PCELL that you can use as the filter criterion for export.
Archiving
In the case of a positive edge of ACTIVE, a start request is issued to the archive manager,
and saved in the internal buffer if another job is still active. This is necessary to ensure no
data is lost when jobs follow each other in quick succession. Only one job can be buffered.
The PRE_SUMC block calculates and saves the start time. The default end time is
01.01.1990 (corresponding to "0").
The archive manager informs the PRE_SUMC block that the job has been completed with or
without errors via the input structure SND_ST.
The START_OK output is set if the job has been saved and can be transferred to the archive
manager. START_OK is reset when the ACTIVE input returns to "0".
An end request is issued to the archive manager with a negative edge at the ACTIVE input.
The block calculates the end time. The saved value of the start job is taken as the start time.
The previously created data set is overwritten with the current data.
Further execution is identical to ACTIVE with a positive edge.
The data is written to the PRE_SUMC_x archive.
If you detect in WinCC that a change of month has taken place at the start of a batch and
there are already 13 months available in the user archive, the data sets of the first month
available in the user archive are deleted in the user archive. Archiving then continues. The
data for the last 12 months + the current month is thus always available for analysis.
If the max. limit of 320,000 fields (corresponding here to 13,333 data sets) defined by WinCC
is reached within one user archive, the block generates a message. No further archiving can
be carried out until the user data sets have been deleted from the user archive.
To back up the old data, the reporting function integrated in powerrate can be used to
execute cyclic exporting of the data to Excel before overwriting.
The ARCH_OK output is set if the job has been saved and can be transferred to the archive
manager. ARCH_OK is reset with a positive edge on ACTIVE.
A job is time-monitored by the PRE_SUMC block.
Description of blocks
3.13 PRE_SUMC: Batch-related energy acquisition
SIMATIC PCS 7 powerrate
88 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.13.4 Message behavior
PRE_SUMC issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QPARAMF Parameterization error PLC pr ctrl failure
2 QMON_ERR Monitoring error PLC pr ctrl failure
3 QERR Invalid data PLC pr ctrl failure
4 QOVL Overflow of user archive PLC pr ctrl failure
5 - Free -
6 - Free -
7 - Free -
MSG_EVID
8 - Free -
3.13.5 Error behavior
A parameterization error QPARAMF is generated when
The monitoring time TIME_MON is ≤ 0
ID ≤ 0
ARCH_ID ≤ 0 or ARCH_ID not available, or
The archive manager block signals ID QARCHERR if the block ID agrees
If the monitoring time is incorrect, a new request cannot be generated.
The QERR output is set when
A request has been issued to the archive manager and the parameters ID, JOB_ID and
ARCH_ID do not agree between the request and the response of the archive manager.
The QERR output is not reset until a new request is pending or until the request agrees with
the job data again when the job is repeated (COUNT > 0).
If a valid response is not received from the archive manager within the monitoring time, the
QMON_ERR error output is set. At the COUNT input, a number of job repetitions can be set
before the occurred errors are output. If, for example, a monitoring time of 10 seconds is set
and COUNT = 1, the monitoring error is not signaled until 20 seconds have elapsed. The
parameterization error is an exception to this. This error is signaled immediately.
All errors remain pending until a new request is transmitted.
A job is always repeated when one of the errors described above has occurred.
Description of blocks
3.13 PRE_SUMC: Batch-related energy acquisition
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 89
3.13.6 Start-up characteristics
During startup, the QREQ_ST output structure and the user data are reset and no job is
executed.
3.13.7 Block parameter
Item Data type Type Meaning HMI
ACTIVE BOOL I Batch active
ARCH_ID INT I Archive ID
ARCH_OK BOOL O Job completion OK
BA_ID DWORD I Batch ID
BA_NA STRING[32] I Batch name
COUNT INT I Number of job repetitions
CUR_TS DT I Current time stamp when block is called
CUR_VALx REAL O Current total work value x (x = 1 ... 5)
ID INT I Block ID; unique number for this block
LASTVALx REAL O Last archived, accumulated total work value x (x = 1 ... 5)
MAX_VAL REAL I Maximum number of work values
MSG_ACK WORD O Acknowledge status of the ALARM_8P block
MSG_EVID DWORD I Event ID for ALARM_8P block
MSG_STAT WORD O Status of the ALARM_8P block
QARCH_ID INT O Archive ID
QERR BOOL O Group error
QMON_ERR BOOL O Monitoring error
QMSG_ERR BOOL O 1 = Signal generation error
QMSG_SUP BOOL O 1 = Message suppression
QOVL BOOL O Overflow of user archive
QPARAMF BOOL O Parameterization error
QREQ_ACT BOOL O Request pending
QREQ_ST UDT_PRE_SND_REQ O Request structure for request to archive manager
REC_NA STRING[32] I Recipe name
RUNUPCYC INT I Number of startup cycles
SAMPLE_T REAL I Sampling time [s]
SND_ST UDT_PRE_SND I Acknowledgment signals from archive manager
START_OK BOOL O Batch start OK
TIME_MON REAL I Monitoring time [s]
TYPEx STRING[32] I Energy type x (x = 1 ... 5)
UNIT STRING[24] I System name
VALUNITx STRING[8] I Unit of the value of the energy type x (x = 1 ... 5)
VALx_y REAL I Current work value of the energy type of the load y (x = 1 ... 5,
y = 1 ... 10)
Description of blocks
3.14 PRE_UA_S: Archive manager for writing archive data to the user archive
SIMATIC PCS 7 powerrate
90 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.14 PRE_UA_S: Archive manager for writing archive data to the user
archive
FB1078
3.14.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
3.14.2 Called blocks
The block calls the following blocks:
SFB12 BSEND
SFB35 ALARM_8P
SFC6 RD_SINFO
SFC20 BLKMOV
3.14.3 Function
The PRE_UA_S block (archive manager for writing) writes batch-related energy data for the
PRE_SUMC archive block and detailed information on limit violations and configuration data
for the PRE_LMGM archive blocks to WinCC user archives.
The blocks PRE_SUMC and PRE_LMGM send a request to the archive manager to write
data to a WinCC user archive. The user data is transferred to the archive manager as a data
array. For this, a pointer is transferred to the archive manager block. The pointer then copies
the data with this information to its own instance data block. Only one archive manager block
is provided per AS.
The archive manager block can process up to 128 jobs with up to 8 KB of user data.
Mode of operation
Data request from archive block
The archive block issues a request to the archive manager block. The data is available in the
archive manager block in the form of an input structure.
Description of blocks
3.14 PRE_UA_S: Archive manager for writing archive data to the user archive
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 91
Description of the structure:
ID Block ID;
used to assign the job data to the archive block.
JOB_ID Job ID;
specifies the job type:
1 = Append new data set to archive,
2 = Overwrite existing data set
RECORD_NO Data set number;
JOB_ID = 1:
Number of the month of the last year of the data sets
to be deleted
JOB_ID = 2:
Number of the data set to be overwritten
ARCH_TY Archive type
ARCH_ID Archive ID
REQ Request for job
MON_ERR Monitoring error
DATA Pointer to the user data
After the archive data has been successfully written to the WinCC user archive, the
successful execution of the job and the ID of the written data set is signaled to the archive
block with JOB_ID = 1. The archive block then cancels the REQ request to the archive
manager. When WinCC completes execution, a script sets the REQ_FIN parameter (job
completed).
REQ_FIN is also set if the active job signals a runtime error, or if a positive edge is detected
at the RESET parameter.
With this, the archive manager block is ready for a new job.
Requests to WinCC user archives
The archive manager block continuously scans its 128 request inputs for a pending request.
If a request is pending and no other job is in progress, the user data is accepted and written
to WinCC. Only one job can be processed at any time.
Request confirmation of WinCC
After a request has been sent to its WinCC transfer interface, the archive manager block
expects confirmation that the data has been successfully written.
For this purpose, a check is made to see if the parameters ID, RECORD_NO and ARCH_ID
of the request are identical with the sent data. If the result is positive, this is reported to the
archive block with QDONE = TRUE, and the request to WinCC is canceled. In the event of
an error, the outputs QERR, QARCHERR or QMON_ERR are set, enabling the archive block
to repeat the job immediately or to cancel it.
Description of blocks
3.14 PRE_UA_S: Archive manager for writing archive data to the user archive
SIMATIC PCS 7 powerrate
92 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
In the case of JOB_ID = 1, the information RECORD_NO from WinCC is forwarded to the
archive block. If the job has been completed, the achive block confirms this with the
parameter REQ=FALSE.
If the REQ_FIN parameter from WinCC has been set to TRUE, a new job can be initiated.
This parameter indicates that WinCC has detected the falling edge of REQ and execution of
the job has been completed.
Mode of operation in WinCC
Requests and data from the archive manager block
For each archive manager block there is a global C action (PRE_UA_S.pas) in WinCC that
responds to a request (status change of the REQ parameter) of the associated archive
manager block.
Using the JOB_ID, either a new data set is appended to the user archive (JOB_ID = 1) or an
existing data set is overwritten with the RECORD_NO (JOB_ID = 2). If JOB_ID = 1, the
newly generated data set number is saved in RECORD_NO and transferred to the archive
manager.
If the data set has been written to the user archive, the job data is written to the transfer
interface of the archive manager block.
Preprocessing of the archive data
There is a user archive for each type of archive block. The following nomenclature applies
for the archive:
ARCH_TY = 0: General archive
PRE_+"ARCH_ID" e. g. PRE_1, PRE_2 to PRE_10
The meaning of the archives can be fixed here in the alias.
ARCH_TY = 1: Load management configuration
PRE_LMGM_CONFIG_+"ARCH_ID" e. g. PRE_LMGM_CONFIG_1
ARCH_TY = 2: Load management priority list
PRE_LMGM_PRIO_+"ARCH_ID" e. g. PRE_LMGM_PRIO_1
ARCH_TY = 3: Load management limit violation
PRE_LMGM_LIM_+"ARCH_ID" e. g. PRE_LMGM_LIM_1
ARCH_TY = 4: Batch-related energy recording
PRE_SUMC_+"ARCH_ID" e. g. PRE_SUMC_1
Return value for archive manager block
After the Write data set, the information ID, JOB_ID, RECORD_NO and ARCH_ID is written
to the WinCC transfer interface of the archive manager block.
Description of blocks
3.14 PRE_UA_S: Archive manager for writing archive data to the user archive
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 93
3.14.4 Message behavior
PRE_UA_S issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QPARAMF Parameterization error PLC pr ctrl failure
2 QMON_ERR Communication error PLC pr ctrl failure
3 QERR Invalid data PLC pr ctrl failure
4 - Free -
5 - Free -
6 - Free -
7 - Free -
MSG_EVID
8 - Free -
3.14.5 Error behavior
If an error occurs in the C functions and WinCC cannot write the archive data (archive or
data set not available, or the length of the user data of the archive manager does not agree
with the actual length of the user archive), the QARCHERR error is set. This error is reported
to the archive block. An error message is generated by the archive block.
If a request is issued to WinCC and the parameters ID, JOB_ID, ARCH_ID do not agree
between the request and the reply from WinCC, QERR is set.
If ID, JOB_ID and ARCH_ID = 0, QARCHERR is set.
QERR and QARCHERR are not reset until no more requests are pending, or the request
agrees with the job again, or valid data are available.
The QMON_ERR error is set if the internally called SFB BSEND cannot establish a
connection to WinCC. The error is reset when it is again possible to establish the connection.
The status of the system block is evaluated to monitor the connection via BSEND.
A parameterization error QPARAMF exists if the ID parameter in the REQx_ST input
structures is not unique, or if no valid ID_1 / ID_2, and R_ID parameters (<>0) are available.
No new job is executed while QMON_ERR or QPARAMF are pending.
3.14.6 Start-up characteristics
The block has start-up characteristics. No job is executed during OB100 startup including
RUNUPCYC.
Description of blocks
3.15 PRE_UA_R: Archive manager for reading archive data from the user archive
SIMATIC PCS 7 powerrate
94 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.14.7 Block parameters
Item Data type Type Meaning HMI
ARCH_ID INT IO Archive ID +
ARCH_TY INT IO Archive type +
ID INT IO Block ID; +
ID_1 WORD I Connection ID for BSEND_1
ID_2 WORD I Connection parameter ID for BSEND_2
JOB_ID INT IO Job ID 1 = Append, 2 = Overwrite +
MSG_ACK WORD O Acknowledge status of the ALARM_8P block
MSG_EVID DWORD I Event ID for ALARM_8P block
MSG_STAT WORD O Status of the ALARM_8P block
QARCH_ID INT O Active archive ID
QARCH_TY INT O Archive type
QARCHERR BOOL O Error while writing the archive
QERR BOOL O Error
QID INT O Active ID
QJOB_ID INT O Active job ID
QMON_ERR BOOL O Monitoring error
QMSG_ERR BOOL O 1 = Signal generation error
QMSG_SUP BOOL O 1 = Message suppression
QPARAMF BOOL O Parameterization error
QREC_NO DINT O Active data set number
QSND_ST UDT_PRE_SND O Return value archiving
R_ID WORD I Connection parameter R_ID for BSEND
RECORD_NO DINT IO Data set number for overwriting +
REQ BOOL IO Request for archiving +
REQ_FIN BOOL IO 1 = Job from OS completed +
REQx_ST UDT_PRE_SND_REQ I x. request (x = 001 ... 128)
RESET BOOL IO 1 = Reset job +
RUNUPCYC INT I Number of startup cycles
3.15 PRE_UA_R: Archive manager for reading archive data from the user
archive
FB1079
3.15.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
Description of blocks
3.15 PRE_UA_R: Archive manager for reading archive data from the user archive
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 95
3.15.2 Called blocks
The block calls the following blocks:
SFB13 BRCV
SFB35 ALARM_8P
SFC6 RD_SINFO
SFC20 BLKMOV
3.15.3 Function
The PRE_UA_R block (archive manager for reading) receives configuration data from
WinCC user archives for the PRE_LMGM receive block.
The PRE_LMGM block sends a request to the archive manager to fetch data from the
WinCC user archive. The data is provided as a data array for the receive block. For this, a
pointer is transferred to the receive block, which then copies the data with this information to
its own instance data block. Only one archive manager block is provided per AS.
The archive manager block can process up to 128 requests and can provide up to 8 KB of
data.
Mode of operation
Data request from receive block
The receive block requests data from the archive manager block. The data is available in the
archive manager block in the form of an input structure.
Description of the structure:
ID Block ID;
used to assign the job data to the archive block.
JOB_ID Job ID
RECORD_NO Data record number
ARCH_TY Archive type
ARCH_ID Archive ID
REQ Data is requested
MON_ERR Monitoring error
After the receive block has received the data, the REQ request is reset. WinCC confirms
resetting of the request by setting the REQ_FIN parameter (job completed) in a script.
REQ_FIN is also set by the archive manager block if the active job reports a runtime error or
a positive edge is detected at the RESET parameter.
This deletes the output structure and the archive manager block is ready for a new job.
Description of blocks
3.15 PRE_UA_R: Archive manager for reading archive data from the user archive
SIMATIC PCS 7 powerrate
96 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Data request to WinCC user archives
The archive manager block continuously scans its 128 request inputs for a pending request.
If a request is pending and no other job is in progress, the job data is accepted and
transferred to WinCC. Only one job can be processed at any time.
Data from WinCC user archives
If a request has been issued to WinCC, WinCC sets the REQ_ACC parameter and writes the
data to the transfer interface for the AS. The block waits until new data has arrived at the
associated BRCV. To avoid jobs being lost, the request parameter REQ is not reset until
REQ_ACC = TRUE is returned.
A check is then made to see if the parameters ID, RECORD_NO and ARCH_ID of the job
are identical with the received data. If the result is positive, the user data is written to a static
data area and the request to WINCC is canceled. The receive block is informed of the
presence of new data via the outputs NDR, ID, RECORD_NO and ARCH_ID. In the event of
an error, the outputs QERR, QARCHERR or QMON_ERR are set, enabling the receive block
to repeat the job immediately or to cancel it.
If the data transfer is successful, the receive block can fetch the data from the archive
manager with the transferred pointer. The data is not deleted until the receive block has
acknowledged receipt of the data (parameter REQ → FALSE).
If the REQ_FIN parameter from WinCC has been set to TRUE, a new job can be initiated.
This parameter indicates that WinCC has detected the falling edge of REQ and execution of
the job has been completed.
Mode of operation in WinCC
Requests and data return from the archive manager block
For each archive manager block there is a global C action (PRE_UA_R.pas) in WinCC that
responds to a request (status change of the REQ parameter) of the associated archive
manager block.
Preprocessing of the data
There is a user archive for each type of receive block. The following nomenclature applies
for the archive:
ARCH_TY = 0: General archive
PRE_+"ARCH_ID" e. g. PRE_1, PRE_2 to PRE_10
The meaning of the archives can be fixed here in the alias.
ARCH_TY = 1: Load management configuration
PRE_LMGM_CONFIG_+"ARCH_ID" e. g. PRE_LMGM_CONFIG_1
ARCH_TY = 2: Load management priority list
PRE_LMGM_PRIO_+"ARCH_ID" e. g. PRE_LMGM_PRIO_1
ARCH_TY = 3: Load management limit violation
PRE_LMGM_LIM_+"ARCH_ID" e. g. PRE_LMGM_LIM_1
Description of blocks
3.15 PRE_UA_R: Archive manager for reading archive data from the user archive
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 97
ARCH_TY = 4: Batch-related energy recording
PRE_SUMC_+"ARCH_ID" e. g. PRE_SUMC_1
3.15.4 Message behavior
PRE_UA_R issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QPARAMF Parameterization error PLC pr ctrl failure
2 QMON_ERR Communication error PLC pr ctrl failure
3 QERR Invalid data PLC pr ctrl failure
4 - Free -
5 - Free -
6 - Free -
7 - Free -
MSG_EVID
8 - Free -
3.15.5 Error behavior
If an error occurs in the C functions and WinCC cannot read out the requested archive data
(archive or data set not available), only the parameters ID, RECORD_NO and ARCH_ID are
sent to the the AS with the value 0. The block signals the QARCHERR error in this case.
This error is reported to the receive block that generates an error message.
If a request is issued to WinCC and the parameters ID, RECORD_NO and ARCH_ID do not
agree between the request and the response from WinCC, QERR is set and the received
data is not forwarded.
If ID, RECORD_NO and ARCH_ID = 0, QARCHERR is set.
QERR and QARCHERR are not reset until no more requests are pending, or the request
agrees with the job again, or valid data are available.
The QMON_ERR error is set if the internally called SFB BRCV cannot establish a connection
to WinCC. The error is reset when it is again possible to establish the connection. The status
of the system block is used to monitor the connection via BRCV.
A parameterization error QPARAMF exists if the ID parameter in the REQx_ST input
structures is not unique, or if no valid ID_1 / ID_2, and R_ID parameters (<>0) are available.
No new job is executed while QMON_ERR or QPARAMF are pending.
3.15.6 Start-up characteristics
The block has start-up characteristics. During OB100 startup including RUNUPCYC, the
RCV_ST output structure and the user data are reset and no job is executed.
Description of blocks
3.15 PRE_UA_R: Archive manager for reading archive data from the user archive
SIMATIC PCS 7 powerrate
98 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.15.7 Block parameters
Item Data type Ty
pe
Meaning HMI
ARCH_ID INT IO Archive ID +
ARCH_TY INT IO Archive type +
ID INT IO Block ID; +
ID_1 WORD I Connection parameter ID for BRCV_1
ID_2 WORD I Connection parameter ID for BRCV_2
JOB_ID INT IO Job ID +
MSG_ACK WORD O Acknowledge status of the ALARM_8P block
MSG_EVID DWORD I Event ID for ALARM_8P block
MSG_STAT WORD O Status of the ALARM_8P block
QARCH_ID INT O Archive ID
QARCH_ID INT O Active archive ID
QARCH_TY INT O Archive type
QARCHERR BOOL O Error while reading out the archive
QERR BOOL O Error
QID INT O Active ID
QJOB_ID INT O Job ID
QMON_ERR BOOL O Monitoring error
QMSG_ERR BOOL O 1 = Signal generation error
QMSG_SUP BOOL O 1 = Message suppression
QPARAMF BOOL O Parameterization error
QRCV_ST UDT_PRE_RCV O Recipe data
QREC_NO DINT O Active data set number
R_ID WORD I Connection parameter R_ID for BRCV
RECORD_NO DINT IO Data record +
REQ BOOL IO Data request +
REQ_ACC BOOL IO 1 = Data accepted from OS +
REQ_FIN BOOL IO 1 = Data completed by OS +
REQx_ST UDT_PRE_RCV_REQ I x. request (x = 001 ... 128)
RESET BOOL IO 1 = Reset job +
RUNUPCYC INT I Number of startup cycles
Description of blocks
3.16 PRE_SWTCH: General switch
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 99
3.16 PRE_SWTCH: General switch
FB1750
3.16.1 Calling OBs
The OB watchdog interrupt in which the block is installed (e.g. OB32). Also in OB100 (see
start-up characteristics).
3.16.2 Called blocks
The block calls the following blocks:
SFB31 NOTIFY_8P
SFB35 ALARM_8P
SFC6 RD_SINFO
3.16.3 Function
The PRE_SWTCH function block is used to display and operate a switch via digital inputs
and outputs.
Status
The input parameters ON, OFF, TRIP and UNPLUG are used to generate the switch status.
The input parameters TRIP and UNPLUG are not evaluated if EN_TRIP or EN_UNPLUG =
FALSE.
The following switch statuses are generated dependent on the inputs and displayed on the
faceplate and icon:
Status Output
QSTATUS
Input
ON
Input
OFF
Input
TRIP
Input
UNPLUG
On Bit 0 TRUE FALSE FALSE FALSE
Off Bit 1 FALSE TRUE FALSE FALSE
Tripped Bit 2 X X TRUE FALSE
Unplugged Bit 3 X X X TRUE
Cells indicated with X are irrelevant in this status and are not evaluated. Statuses not
available in the table are regarded as undefined and the QERR output is set.
Description of blocks
3.16 PRE_SWTCH: General switch
SIMATIC PCS 7 powerrate
100 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Activation
Dependent on the status of the switch and the input parameter for operator control enabling
(ON_OP_EN, OFFOP_EN) switching can be carried out via the faceplate (QON_OP,
QOFFOP).
The output signals QON and QOFF are set in accordance with the operator input and then
reset after the requested status has been reached or after the monitoring time has expired.
Monitoring
The QMON_ERR output parameter is set if the requested switching status has not been
reached within the monitoring time set using TIME_MON. This monitoring is switched off with
TIME_MON = 0 or MONITOR = FALSE.
The issued command is revoked.
QMON_ERR is reset if RESET or L_RESET is set.
3.16.4 Message behavior
PRE_SWTCH issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QBAD External error PLC pr ctrl failure
2 QSTATUS Tripped AH
3 QSTATUS Unplugged WH
4 QSTATUS Undefined status AH
5 QMON_ERR / QON Monitoring error On AH
6 QMON_ERR / QOFF Monitoring error after Off AH
7 - Free -
MSG_EVID1
8 - Free -
1 QSTATUS On Status PLC
2 QSTATUS Off Status PLC
3 QSTATUS Operation On successful Status PLC
4 QSTATUS Operation Off successful Status PLC
5 - Free -
6 - Free -
7 - Free -
MSG_EVID2
8 - Free -
3.16.5 Start-up characteristics
After startup, the messages are suppressed for the number of cycles parameterized in the
RUNUPCYC value.
Description of blocks
3.16 PRE_SWTCH: General switch
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 101
3.16.6 Block parameter
Item Data type Ty
pe
Meaning HMI
CSF BOOL I External error
EN_TRIP BOOL I 1 = TRIP input available +
EN_UNPLUG BOOL I 1 = UNPLUG input available +
L_RESET BOOL I Configurable input for resetting QMON_ERR
MAN_ON BOOL IO Control input: 0 = Off, 1 = On +
MONITOR BOOL I 1 = Monitoring on +
MSG_ACK1 WORD O Acknowledge status of the ALARM_8P block
MSG_EVID1 DWORD I Event ID for ALARM_8P block
MSG_EVID2 DWORD I Event ID for NOTIFY_8P block
MSG_STAT1 WORD O Status of the ALARM_8P block
MSG_STAT2 WORD O Status of the NOTIFY_8P block
MT_TYPE BOOL I Type of installation: 0 = Fixed installation, 1 = Withdrawable +
OFF BOOL I Switch off
OFFOP_EN BOOL I Operator authorization for off
ON BOOL I Circuit breaker CLOSED
ON_OP_EN BOOL I Operator authorization for on
QBAD BOOL O 1 = External error
QC_OFF BYTE I Quality code for OFF
QC_ON BYTE I Quality code for ON
QC_QOFF BYTE O Quality code for QOFF
QC_QOFF_I BYTE I Quality code for QOFF input
QC_QON BYTE O Quality code for QON
QC_QON_I BYTE I Quality code for QON input
QC_QSTATUS BYTE O Quality code for QSTATUS output
QC_TRIP BYTE I Quality code for TRIP
QC_UNPLUG BYTE I Quality code for UNPLUG
QERR BOOL O 1=Error
QMON_ERR BOOL O Monitoring error
QMSG_ERR BOOL O 1 = Signal generation error
QMSG_SUP BOOL O 1 = Message suppression +
QOFF BOOL O Control output for off
QOFF_OP BOOL O Operator authorization for off +
QON BOOL O Control output for on
QON_OP BOOL O Operator authorization for on +
QSIM BOOL O 1 = Simulation active +
QSTATUS BYTE O Status of the switch +
RESET BOOL IO Control input for resetting QMON_ERR +
RUNUPCYC INT I Number of initial run cycles after CPU restart
SAMPLE_T REAL I Sampling time in [s]
Description of blocks
3.16 PRE_SWTCH: General switch
SIMATIC PCS 7 powerrate
102 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Item Data type Ty
pe
Meaning HMI
STYPE INT I Type of switch +
TIME_MON REAL I Monitoring time in [s] +
TRIP BOOL I Switch is tripped
UNPLUG BOOL I Switch withdrawn
3.16.7 Description of icons and faceplate
Block icon
Variant 1
Variant 2
Variant 3
Faceplate
The faceplate available is described in this chapter.
The following views are available:
Overview OVERVIEW
Standard STANDARD
Messages
The file name is composed as follows: @PG_PRE_SWTCH_<view>.PDL
Description of blocks
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 103
The PCS 7 standard display is used for the messages view.
The structure of the individual views of faceplates is described below.
Standard (STANDARD)
The following parameters are displayed:
Item Parameter Description
(1) Status QSTATUS Circuit breaker state
(2) Command MAN_ON 0 = Off, 1 = On
(3) Monitoring – Reset RESET Reset monitoring error
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200
FB1751
3.17.1 Calling OBs
The block must be installed in the processing sequence in the following OBs:
OB1 Cyclic program
OB82 Diagnostic interrupt
OB83 Insert/remove interrupt
OB85 Program execution error
OB86 Rack failure
OB100 Warm restart
Description of blocks
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200
SIMATIC PCS 7 powerrate
104 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.17.2 Called blocks
The block calls the following blocks:
SFB35 ALARM_8P
SFC6 RD_SINFO
3.17.3 Function
The function block PRE_PAC is used to display selected measured values and to report
status information of the PAC3200 and PAC4200 Power Monitoring Devices.
Measured value display
Data of the basic type 1 and 2 can be selected for displaying measured values. However,
when parameterizing the PAC in HW Config, you must make sure that the basic types whose
data is to be displayed are configured in each case.
The parameters BASADR1 and BASADR2 must each be supplied with the logical basic
address of the basic types 1 and 2, if used.
The measured value type is determined with the TYPE_x parameter.
Measured value
TYPE_x
Basic type Meaning Unit
1 1 Current a A
2 1 Current b A
3 1 Current c A
4 1 Total active power W
5 2 Voltage PH-PH a-b V
6 2 Voltage PH-PH b-c V
7 2 Voltage PH-PH c-a V
8 2 Total power factor -
The active energy is read out and displayed dependent on the EN_ACENER parameter.
Description of blocks
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 105
Status information
The status information is output in the STATDIAG parameter. The bits relevant for the
messages are also output at binary output parameters (see table).
Assignment of the status doubleword STATDIAG
Byte Bit Binary status information Block parameter
0 0 No synchronization pulse -
0 1 Local configuration active -
0 2 Voltage overload QE_VOLTOVER
0 3 Current overload QE_CUROVER
0 4 ... 7 Reserved -
1 0 Reserved -
1 1 Maximum pulse rate exceeded QE_PULSOVER
1 2 ... 7 Reserved -
2 0 Relevant parameter changes -
2 1 Upper/lower limit exceeded -
2 2 Maximum pulse rate exceeded QE_PULSOVER
2 3 Restart of the device -
2 4 Resetting of energy counter by user -
2 5 ... 7 Reserved -
3 0 ... 7 Reserved -
3.17.4 Message behavior
PRE_PAC issues the following messages:
Message block Message
number
Block
parameter
Message text Message
class
1 QBAD External error PLC pr ctrl failure
2 QPARAMF Parameterization error PLC pr ctrl failure
3 QE_VOLTOVER Voltage out of range PLC pr ctrl failure
4 QE_CUROVER Current out of range PLC pr ctrl failure
5 QE_PULSOVER Maximum pulse rate exceeded PLC pr ctrl failure
6 - Free -
7 - Free -
MSG_EVID
8 - Free -
Description of blocks
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200
SIMATIC PCS 7 powerrate
106 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.17.5 Error behavior
The QPARAMF error output is set when
A measured value TYPE_x < 1 or > 8 is entered or
One of the UNITx parameters is set to an invalid value
(see "Description of the icon and faceplate")
The VALUE_x measured value is set to 0 if the associated measured value type is invalid.
3.17.6 Start-up characteristics
After startup, the messages are suppressed for the number of cycles parameterized in the
RUNUPCYC value.
3.17.7 Block parameters
Item Data type Typ
e
Meaning HMI
AEIT1DW1 DWORD O Active energy import tariff 1 DWORD 1 +
AEIT1DW2 DWORD O Active energy import tariff 1 DWORD 2 +
BASADR1 INT I Basic address of the basic type 1
BASADR2 INT I Basic address of the basic type 2
CSF BOOL I External error
EN_ACENER BOOL I 1 = Active energy available +
MSG_ACK WORD O Acknowledge status of the ALARM_8P block
MSG_EVID DWORD I Event ID for ALARM_8P block
MSG_STAT WORD O Status of the ALARM_8P block
QBAD BOOL O 1 = External error
QE_CUROVER BOOL O Current out of range
QE_PULSOVER BOOL O Maximum pulse rate exceeded
QE_VOLTOVER BOOL O Voltage out of range
QMSG_ERR BOOL O 1 = Signal generation error
QMSG_SUP BOOL O 1 = Message suppression +
QPARAMF BOOL O 1 = Parameterization error
RUNUPCYC INT I Number of initial run cycles after CPU restart
STATDIAG DWORD O Device diagnostics and status
TYPE_x INT I Measured value type of VALUE_x (x = 1 ... 3) +
UNITACENER BYTE I Active energy units +
UNITACPOW BYTE I Active power units +
UNITVOLT BYTE I Voltage units +
VALUE_x REAL O Measured value x (x = 1 ... 3) +
Description of blocks
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 107
3.17.8 Description of icon and faceplate
Block icon
Faceplate
The faceplate available is described in this chapter.
The following views are available:
Overview OVERVIEW
Standard STANDARD
Parameter PARAMETERS
Messages
The file name is composed as follows: @PG_PRE_PAC_<view>.PDL
The PCS 7 standard display is used for the messages view.
The structure of the individual views of faceplates is described below.
Standard (STANDARD)
(1) VALUE_1
(2) UNITVOLT / UNITACPOW
(3) VALUE_2
(4) VALUE_3
(5) AEIT1DW1 / AE1T1DW2
(6) UNITACENER
Description of blocks
3.17 PRE_PAC: Basic functionality of the PAC3200/PAC4200
SIMATIC PCS 7 powerrate
108 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
The following parameters are displayed:
Item Parameter Description
VALUE_x
TYPE_x
Depending on the TYPE_x measured value, the relevant value is displayed
with a description.
Values 1 ... 3
UNITVOLT / UNITACPOW The format and unit of the measured value can be set in the Parameters
view.
AEIT1DW1 / AE1T1DW2 The active energy is displayed
if the parameter EN_ACENER = TRUE.
Active energy
import tariff 1
UNITACENER The format and unit of the measured value can be set in the Parameters
view.
Parameters (PARAMETERS)
The format (integer place/decimal place) and unit can be parameterized for the different
measured value types.
Item Parameter Description
(1) Active power UNITACPOW 0 ≙ 2 / 2 [W]
1 ≙ 3 / 1 [kW]
2 ≙ 4 / 0 [kW]
3 ≙ 4 / 0 [MW]
(2) Active energy UNITACENER The selection box for the active energy is displayed if the parameter
EN_ACENER = TRUE.
0 ≙ 7 / 2 [kWh]
1 ≙ 9 / 0 [kWh]
2 ≙ 9 / 0 [MWh]
3 ≙ 9 / 0 [GWh]
(3) Voltage UNITVOLT 0 ≙ 3 / 1 [V]
1 ≙ 2 / 2 [kV]
2 ≙ 3 / 1 [kV]
Description of blocks
3.18 PRE_CALC: Calculations
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 109
3.18 PRE_CALC: Calculations
FC1061
3.18.1 Calling blocks
The block is called by the PRE_SUM FB.
3.18.2 Function
The PRE_CALC function contains the calculation algorithms which can be used when
producing measured values for the FB PRE_SUM FB.
The function is a source in the library and the user can therefore add other calculations to it.
The function interface must not be changed.
The following algorithms are implemented:
Function CALC_FN Algorithm
0 OUT = P0 + P1*IN1 + P2*IN2 + P3*IN3
1 Calculation of heat quantity for liquids
OUT = P0*IN1*P1*IN2
with:
P0 = specific heat capacity c
P1 = density p
IN1 = flow V
IN2 = difference in temperature ΔT
Assignment input parameters PRE_CALC to input parameters PRE_SUM:
PRE_CALC PRE_SUM
CALC_FN CALC_FN
INx ACTUALx
Px CALC_Px
3.18.3 Message behavior
The block has no message behavior.
3.18.4 Error behavior
The QERR error output is set when
An error is established during the calculation (e.g. division by 0)
Description of blocks
3.19 PRE_FIFO_IO: Organization of FIFO buffer
SIMATIC PCS 7 powerrate
110 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.18.5 Start-up characteristics
The block has no start-up characteristics.
3.18.6 Block parameters
Item Data type Type Meaning HMI
CALC_FN INT I Calculation function
INx REAL I Input value x (x = 1 ... 3)
Px REAL I Constant x (x = 0 ... 3)
QERR BOOL O 1=Error
OUT REAL O Results
3.19 PRE_FIFO_IO: Organization of FIFO buffer
FC1062
3.19.1 Calling blocks
The block is called by the PRE_SUM, PRE_FIFO_DATA and PRE_AR_SND FBs.
3.19.2 Called blocks
The block calls the following blocks:
SFC24 TEST_DB
3.19.3 Function
The PRE_FIFO_IO function organizes reading and writing access on the FIFO buffer, which
is represented by the PRE_FIFO_DATA FB.
The FIFO contains the functionality of a cyclic buffer. Old data are overwritten when the
buffer overflows.
The status of the FIFO buffer is displayed at the QEMPTY (buffer empty) and QFULL (buffer
full) outputs.
3.19.4 Message behavior
The block has no message behavior.
Description of blocks
3.20 UDT_PRE_FIFO
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 111
3.19.5 Error behavior
The QPARAMF error output is set when
the parameterized FIFO-DB is not present
the FIFO-DB length is too short
3.19.6 Start-up characteristics
During initial startup, the block initializes the check data of the FIFO buffer. This call takes
place in the PRE_FIFO_DATA FB.
When the CPU is started up subsequently, the pointers are retained.
3.19.7 Block parameters
Item Data type Type Meaning HMI
DONE BOOL O 1 = Job complete
FIFO_DB INT I DB number for FIFO
FIFO_INIT BOOL I 1 = Initialize FIFO
ITEM_LEN INT I Length of element
ITEM_MAX INT I Maximum number of elements in FIFO
ITEM_PTR POINTER I Pointer to element
ITEM_RD BOOL I 1=Read request
ITEM_WR BOOL I 1 = Write request
QEMPTY BOOL O 1 = FIFOBlank
QFULL BOOL O 1 = FIFO full
QPARAMF BOOL O 1 = Parameterization error
3.20 UDT_PRE_FIFO
UDT1060
3.20.1 Description
The UDT_PRE_FIFO user data type contains internal check data for organizing the FIFO
buffer.
The UDT is used internally.
Description of blocks
3.21 UDT_PRE_ITEM
SIMATIC PCS 7 powerrate
112 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.20.2 Structure
Item Data type Meaning
FIFO_ST DWORD Pointer at start of FIFO
FIFO_END DWORD Pointer at end of FIFO
WR_POS DWORD Pointer at current write position
RD_POS DWORD Pointer at current read position
ITEM_CNT INT Counter for elements
LOCKED BOOL 1=Access locked
SPARE ARRAY[1 ... 4] of BYTE Spare
3.21 UDT_PRE_ITEM
UDT1061
3.21.1 Description
The UDT_PRE_ITEM user data type contains the storage structure of a measured value.
The UDT is used internally.
3.21.2 Structure
Item Data type Meaning
TS DATE_AND_TIME Time stamp of measured value
VALUE REAL Measured value
AR_SNO WORD Subnumber for archive tag
3.22 UDT_PRE_TLG
UDT1062
3.22.1 Description
The UDT_PRE_TLG user data type contains the structure of a telegram element for sending
into the WinCC Tag Logging archive.
The UDT is used internally.
Description of blocks
3.23 UDT_PRE_SND_REQ
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 113
3.22.2 Structure
Item Data type Meaning Default
HEAD_TYPE WORD Header type 8 : With time stamp
CYCLE TIME Cycle 0 : Not relevant
U_TYPE BYTE Unit (type) 2 : Each process value has a time
stamp
U_AREA BYTE Units (range) 0 : Not relevant
AR_SNO WORD Subnumber of archive tag
DT_TYPE INT Data type of element 5 : Analog value
NO_ITEMS INT Number of elements to be sent 1
TS DATE_AND_TIME Time stamp of element
VALUE REAL Measured value
3.23 UDT_PRE_SND_REQ
UDT1063
3.23.1 Description
The user data type UDT_PRE_SND_REQ contains the structure for the request to write data
to a WinCC user archive.
3.23.2 Structure
Item Data type Meaning
ID INT ID of the requesting function
JOB_ID INT Requested job number
ARCH_TY INT Requested archive type
ARCH_ID INT Requested archive ID
RECORD_NO DINT Data record number
REQ BOOL Request to write data to the archive
MON_ERR BOOL Monitoring error
DATA UDT_PRE_ANY Pointer to user data
Description of blocks
3.24 UDT_PRE_SND
SIMATIC PCS 7 powerrate
114 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.24 UDT_PRE_SND
UDT1064
3.24.1 Description
The user data type UDT_PRE_SND contains the acknowledgment of the archive manager
for the request to write data to a WinCC user archive.
3.24.2 Structure
Item Data type Meaning
ID INT ID of the requesting function
JOB_ID INT Requested job number
ARCH_TY INT Requested archive type
ARCH_ID INT Requested archive ID
RECORD_NO DINT Data record number
QERR BOOL Error
QARCHERR BOOL Error while writing to the archive
QMON_ERR BOOL Monitoring error
QDONE BOOL Archiving takes place
3.25 UDT_PRE_RCV_REQ
UDT1065
3.25.1 Description
The user data type UDT_PRE_RCV_REQ contains the structure for the request to read data
from a WinCC user archive.
Description of blocks
3.26 UDT_PRE_RCV
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 115
3.25.2 Structure
Item Data type Meaning
ID INT ID of the requesting function
JOB_ID INT Requested job number
ARCH_TY INT Requested archive type
ARCH_ID INT Requested archive ID
RECORD_NO DINT Data record number
REQ BOOL Request to read data from the archive
MON_ERR BOOL Monitoring error
3.26 UDT_PRE_RCV
UDT1066
3.26.1 Description
The user data type UDT_PRE_RCV contains the archive manager acknowledgment of the
request to read data from a WinCC user archive.
3.26.2 Structure
Item Data type Meaning
ID INT ID of the requesting function
JOB_ID INT Requested job number
ARCH_TY INT Requested archive type
ARCH_ID INT Requested archive ID
RECORD_NO DINT Data record number
QERR BOOL Error
QARCHERR BOOL Error while writing to the archive
QMON_ERR BOOL Monitoring error
NDR BOOL New data present
DATA UDT_PRE_ANY Pointer to user data
Description of blocks
3.27 UDT_PRE_ANY
SIMATIC PCS 7 powerrate
116 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
3.27 UDT_PRE_ANY
UDT1067
3.27.1 Description
The user data type UDT_PRE_ANY contains the structure of the Any pointer. It is used as a
transfer pointer to the send/receive areas for the archive manager.
3.27.2 Structure
Item Data type Meaning
SYNC BYTE Syntax ID
TYP BYTE Data type
LENGTH WORD Length
DB_NR WORD DB number
P DWORD Range pointer
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 117
Description of powerrate Reports 4
powerrate Reports offers functions for energy analysis and analysis for batch-related energy
recording. In doing so, selected energy data is read from the tag logging archive and from
user archives from the WinCC runtime database, and generated on the basis of Microsoft
Excel reports.
4.1 Energy analyses
The following energy analyses can be carried out:
Export of archived
measured values
Export of energy values from the Tag Logging archive to Excel
without creating a report
Cost center report Assigns energy values/costs to cost centers
Duration curve report Represents average power values as a duration curve
Due to the system characteristics of WinCC, it is not currently possible to access swapped
archives.
4.1.1 Export of archived measured values
The energy, power and counter values archived in the WinCC Tag Logging archive, and the
values calculated from them, are exported as raw data to Excel using the function "Export of
archived measured values".
The values from the tag logging archive are stored in the "Archive data" sheet, and
calculated values (virtual process tags) are stored in the "Virtual process tags" sheet.
The generated export file can be used for further processing of the data by other
applications.
4.1.2 Cost center report
The reports "Cost center report table" and "Cost center report diagram" are generated to
analyze energy values (.S tags in the Tag Logging). These reports are used to assign
consumption data and costs to the relevant cost centers. When a report is created, the
reporting period over which the evaluation is to be performed must be specified.
Description of powerrate Reports
4.1 Energy analyses
SIMATIC PCS 7 powerrate
118 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
"Cost center report table" sheet
"Cost center report diagram" sheet
4.1.3 Duration curve report
The "Duration curve report" contains the average power values (.V tags in the Tag Logging
archive). It shows the frequency with which particular average power values occur. This
graphic can then be used to deduce whether temporary power peaks are present.
Description of powerrate Reports
4.2 Batch analyses
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 119
"Duration curve report" sheet
4.2 Batch analyses
powerrate Reports contains the following analyses of batch-related energy values:
Export of batch values Export of the batch-related energy values from user archives to
Excel without creating a report
Batch report
(sorted acc. to time)
Sorting of the batch-related energy values according to start
time
Batch report: (sorted
acc. to name)
Sorting of the batch-related energy values according to batch
name
Description of powerrate Reports
4.2 Batch analyses
SIMATIC PCS 7 powerrate
120 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
4.2.1 Export of batch values
The data assigned to batches and archived in WinCC PRE_SUMC_x user archives is
exported as raw data to Excel using the "Batch value export" function.
The generated export file can be used for further processing of the data by other
applications.
4.2.2 Batch report
To analyze batch-related energy values (data from the PRE_SUMC_x user archives), a
report with data sorted according to time (batch report (sorted acc. to time)) and a report with
data sorted according to batches (batch report (sorted acc. to name)) can be generated.
These reports are used to assign consumption data to the relevant batches. When a report is
created, the reporting period over which the analysis is to be made must be specified.
"Batch report (time)" sheet
Description of powerrate Reports
4.2 Batch analyses
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 121
"Batch report (name)" sheet
A detailed description of powerrate Reports follows in "Configuring powerrate Reports
(Page 145)".
Description of powerrate Reports
4.2 Batch analyses
SIMATIC PCS 7 powerrate
122 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 123
Configuring guide 5
The library contains pre-produced CFC templates, which can be used as templates. The
CFC plans relevant in each case and the procedure for writing the program are described in
the subsequent chapters.
Since blocks whose numbers are covered by the CFC by default are used, the settings for
Compile/Download have to be adjusted in the CFC prior to compiling the program. These
changes are carried out in the menu Options > Customize > Compile/Download.
Configuring guide
5.1 General settings
SIMATIC PCS 7 powerrate
124 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.1 General settings
For correct archiving, use and calculation of times, the CPU time-of-day must be set to UTC
time.
5.2 Configuring the process tags for recording energy/power
5.2.1 Creating the PLC program
The CFC chart "SYSTEM" contains on the first sheet the superordinate blocks that are
responsible for time synchronization, data buffering and data archiving.
Installation of PRE_SYNC block for different synchronization times
Parameterization of type of synchronization (internal/external)
Parameterization of synchronization periods
Parameterization of synchronization pulse periods
Installation of PRE_FIFO_DATA block for FIFO buffer
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 125
Installation of PRE_AR_DATA block for communication with WinCC Tag Logging archive
Connection with PRE_FIFO_DATA
Parameterization of the monitoring time for the send operation SEND_T:
The monitoring time must be at least as long as the necessary power-up time of
WinCC Runtime.
There is one CFC for each signal type:
Pulse input: PULSE_INPUT
Integer counter: INTEGER_COUNTER
Analog counter: ANALOG_COUNTER
Calculation function: CALCULATION
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
126 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Installation of PRE_SUM block for measuring point
Connection with measured value
Connection with PRE_SYNC block
Connection with PRE_FIFO_DATA
Parameterization of signal type/calculation parameter
Parameterization of subnumbers of archive tags
5.2.2 Connection to WinCC
The "Create/Update Block Icons" function
In the properties dialog box of the WinCC display, select "Derive the block icons from
the plant hierarchy", and then generate the block icons manually or automatically
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 127
Manually create/update in the SIMATIC Manager/Plant view by selecting the plant
folder, menu Plant Hierarchy, then Create/Update Block Icons or
Automatically create/update when compiling the OS
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
128 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Manually copy the user object from file @Template_PRE.pdl to process display and run
the "Connect picture block to tag structure" Dynamic Wizard
Creation of one raw data variable per PRE_AR_DATA block for archiving in WinCC tag
management with
the following tag name structure:
WinCC tag name of the block PRE_AR_DATA + Suffix "/DATA"
of the type Archive Data Link
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 129
Create C action for acknowledging the archiving:
Copy C action PRE_AR_SND.pas from the folder \WinCC\powerrate\archives to
Projectdirectory\computer name\PAS of the project (for multi-user systems of the
server project)
Adapt tag trigger to raw data variable for archiving
Adapt the tag connection in the C script to the tag name of the PRE_AR_DATA block
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
130 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.2.3 Configuring the process value archive
Create a process value archive with the name pre
Create two or three process-controlled archive tags for the PRE_SUM block
Assignment of the raw data variable of the associated block for archiving
PRE_AR_DATA
The names of the archive tags have the following structure:
Accumulated work value (LAST_VAL): tagname.S
Average power value (CUR_PWR): tagname.V
Absolute counter value (VALUE_D / VALUE_R)
optional tagname.C
tagname matches the tag name of the PRE_SUM block.
The names of the archive tags have to be unique throughout the project.
Enter the unit in [] in the comments box (e.g. [kWh])
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 131
Parameterization of AR_ID with AR_EVID parameter of associated PRE_AR_DATA
archiving block
Parameterization of subnumbers with parameters ARSNO_S (for work value) and
ARSNO_V (for average power value) and ARSNO_C (for the absolute counter value, if
available) of the associated energy recording block PRE_SUM
Configuration of Tag Logging Fast:
Configuring guide
5.2 Configuring the process tags for recording energy/power
SIMATIC PCS 7 powerrate
132 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Process-controlled archive tags are saved by WinCC in Tag Logging Fast. When configuring
Tag Logging Fast it has to be taken into account that the application only accesses the
runtime archive and archives which have not been swapped out.
The memory requirement of a process-controlled archive tag depends on the archiving cycle.
For a 15-minute archiving cycle, it is approx. 1 MB per year for one archive tag.
Configuring guide
5.3 Configuring communication with WinCC user archives
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 133
5.3 Configuring communication with WinCC user archives
5.3.1 Configuring the connection in NETPRO
Communication with the WinCC user archives is implemented via BSEND / BRCV. For this,
a connection must be configured in NETPRO for each WinCC server. The same connection
must be used here as when compiling the OS.
The marked ID is written to the parameters ID_1 / ID_2 of the archive manager block
PRE_UA_S and PRE_UA_R.
Configuring guide
5.3 Configuring communication with WinCC user archives
SIMATIC PCS 7 powerrate
134 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.3.2 Creating the PLC program
The CFC chart "SYSTEM" contains on the second sheet the call of the PRE_UA_S block
(archive manager for writing), and on the third sheet, the call of the PRE_UA_R block
(archive manager for reading).
Integration of the PRE_UA_S block for communication with WinCC in the write direction
Parameterization of the connection IDs ID_1 / ID_2 (ID_2 only has to be
parameterized when using redundant WinCC servers) with the local ID of the
connection created in NETPRO (see figure in "Configuring the connection in NETPRO
(Page 133)")
Parameterization of the request ID R_ID (unique ID for identifying the communication
job)
Configuring guide
5.3 Configuring communication with WinCC user archives
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 135
Integration of the PRE_UA_R block for communication with WinCC in the read direction
Parameterization of the connection IDs ID_1 / ID_2 (ID_2 only has to be
parameterized when using redundant WinCC servers) with the local ID of the
connection created in NETPRO (see figure in "Configuring the connection in NETPRO
(Page 133)")
Parameterization of the request ID R_ID (unique ID for identifying the communication
job)
Configuring guide
5.3 Configuring communication with WinCC user archives
SIMATIC PCS 7 powerrate
136 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.3.3 Configuring communication in WinCC
Creation of one raw data variable per archive manager block PRE_UA_S / PRE_UA_R in
WinCC tag management for the configured connection with
the following tag name structure:
WinCC tag name of the archive manager block PRE_UA_S / PRE_UA_R + suffix "/DATA"
of the type BSEND / BRCV
R_ID of the associated archive manager block PRE_UA_S / PRE_UA_R (see
"Creating the AS program (Page 134)")
Configuring guide
5.3 Configuring communication with WinCC user archives
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 137
Creation of one C action per archive manager block PRE_UA_S
Copy C action PRE_UA_S.pas from the folder \WinCC\powerrate\archives to
Projectdirectory\computer name\PAS of the server project
Adapt tag connection to tag name of the archive manager block PRE_UA_S
Adapt tag trigger to associated raw data variable and the .REQ tag
Configuring guide
5.3 Configuring communication with WinCC user archives
SIMATIC PCS 7 powerrate
138 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Creation of one C action per archive manager block PRE_UA_R
Copy C action PRE_UA_R.pas from the folder \WinCC\powerrate\archives to
Projectdirectory\computer name\PAS of the server project
Adapt tag connection to tag name of the archive manager block PRE_UA_R
Adapt tag trigger to REQ tag
Configuring guide
5.4 Configuring batch data
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 139
5.4 Configuring batch data
5.4.1 Creating the PLC program
The CFC chart "UNIT" contains the call of the PRE_SUMC block that collects the data for
batch-related energy recording, combines that data for archiving in the WinCC user archive,
and forwards it.
Integration of the PRE_SUMC block for batch-related energy acquisition
Interconnection of the CUR_TS input with the CUR_TS output of the PRE_SYNC
block
Interconnection of the SND_ST input structure with the QSND_ST output structure of
the PRE_UA_S block (archive manager for writing)
Interconnection of the QREQ_ST output structure with a REQx_ST input structure of
the PRE_UA_S block (archive manager for writing)
Parameterization of the ID (unique identifier of the block)
Parameterization of the ARCH_ID (archive ID)
Configuring guide
5.4 Configuring batch data
SIMATIC PCS 7 powerrate
140 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Parameterization/interconnection of the parameters UNIT, BA_ID, BA_NA and
REC_NA for the batch data
Parameterization/interconnection of the parameters VALUNITx, TYPEx, VALx_y
5.4.2 Configuring the user archive in WinCC
Configuration files are provided for the user archives. The batch-related energy data can be
stored in these files.
The files are located in the installation directory of WinCC in the powerrate\Config folder.
Different files are available for English and German. Only one language can be used.
Importing the configuration
Please use the following files:
German: UserArchiveKonfigurationDeutsch.uap
English: UserArchiveConfigurationEnglish.uap
Configuring guide
5.5 Configuring load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 141
A user archive is created:
PRE_SUMC_1: user archive with batch-related energy data (1 corresponds to the
archive ID (ARCH_ID parameter in the PRE_SUMC block, can be changed)
5.5 Configuring load management
5.5.1 Creating the PLC program
The library contains a pre-produced "LMGM" CFC template, which can be used as a
template. The CFC plans and the procedure for writing the load management program are
provided below.
Installation of PRE_LMGM block for load management
Connection of CUR_VAL, CUR_PWR, EST_VAL, EST_PWR, LAST_VAL, AVG_PWR
with PRE_SUM block for supply
Connection with PRE_SYNC block
Connection of load inputs with status (ONx)/power (Px), if these are present
Connection of load release signal outputs (QONx) with load's switching logic
Interconnection of the SND_ST input structure with the QSND_ST output structure of
the PRE_UA_S block (archive manager for writing)
Interconnection of the QREQ_S_ST output structure with a REQx_ST input structure
of the PRE_UA_S block (archive manager for writing)
Interconnection of the RCV_ST input structure with the QRCV_ST output structure of
the PRE_UA_R block (archive manager for reading)
Interconnection of the QREQ_R_ST output structure with a REQx_ST input structure
of the PRE_UA_R block (archive manager for reading)
Parameterization of the ID (unique identifier of the block)
Parameterization of the ARCH_ID. . The ARCH_ID determines the number of the user
archive in WinCC in which the data of the block instance is stored. Each block
instance must be assigned a unique ARCH_ID.
Configuring guide
5.5 Configuring load management
SIMATIC PCS 7 powerrate
142 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
In the example, a PRE_SUM block is available in the "LMGM" CFC for acquiring the supply
power. This block can also be installed in a separate CFC plan.
5.5.2 Connection to WinCC
See "Connection to WinCC (Page 126)"
Loads and limits are parameterized in WinCC (see "Description of icon and faceplate
(Page 55)").
5.5.3 Configuring the user archives in WinCC
Configuration files are provided for the user archives required by load management.
The files are located in the WinCCinstallation directory, in the powerrate\Config folder, and
are available in English and German. Only one language can be used.
Configuring guide
5.5 Configuring load management
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 143
Importing the configuration
Please use the following files:
German: UserArchiveKonfigurationDeutsch.uap
English: UserArchiveConfigurationEnglish.uap
Three user archives are created:
PRE_LMGM_CONFIG_1: List of previous configurations
PRE_LMGM_PRIO_1: Priority list
PRE_LMGM_LIM_1: Limit violations
(1 corresponds to the archive ID (ARCH_ID parameter in the PRE_LMGM block, can
be changed)
Configuring guide
5.6 Configuring the Web Navigator
SIMATIC PCS 7 powerrate
144 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Importing runtime data for making priority list default settings
A file (PRE_LMGM_PRIO_Deutsch.csv / PRE_LMGM_PRIO_English) containing archive
default settings is provided for the PRE_LMGM_PRIO_1 archive.
This file can be edited in Excel, if desired, then imported.
5.6 Configuring the Web Navigator
Adaptation of all WinCC projects (server and client projects) for use on the Web
Navigator:
Moving the C functions from the folder \WinCC\aplib\powerrate to
Projectdirectory\library
Generation of header files in the global script editor
Installation of the powerrate Web plug-in on the Web client
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 145
5.7 Configuring powerrate Reports
The detailed description of configuring powerrate Reports contains the following:
Calling powerrate Reports
General configurations
Configuration of the reports
Configuration of the times
5.7.1 Calling powerrate Reports
There are two methods of starting powerrate Reports.
Calling via the Start menu via SIMATIC > powerrate > Reports or
using a button in WinCC. This button is found on the @Template_pre.pdl template
display. It must be incorporated in a display on the computer on which the application has
been installed.
Incorporating call button in process display
Pressing the button
A check is made to determine whether or not powerrate is installed. If this is not the case, an
error message appears.
5.7.2 General configurations
5.7.2.1 Configuring the server name
On first opening powerrate Reports from the start menu, the computer name of the WinCC
server must be entered. The name of the WinCC server can be changed using the menu
item Settings > WinCC Server.
When opening powerrate Reports from WinCC, the computer name of the server is
automatically transferred to the application and does not have to be configured.
If a connection to the database of a WinCC project cannot be established, or if there is no
license for powerrate on the WinCC server, an error message appears.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
146 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.7.2.2 Configuring tariffs
To calculate costs when creating cost center reports, different tariffs can be defined that are
each assigned to a physical variable. The tariffs are assigned to the cost center report when
they are created (see "Cost center report (Page 150)" in "Reports for energy analyses").
They are defined using the menu item Settings > Tariffs.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 147
A maximum of 6 tariffs can be defined. These can be assigned to a time-of-day and to
weekdays/holidays. Only whole hours can be entered for time specifications.
You must ensure that the times of the defined tariffs have no gaps or overlaps.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
148 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.7.3 Configuration of the reports
Manual and automatic reports can be created in the start window of powerrate Reports.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 149
The report wizard is started using the menu item Report > Add.
The type, method of creation (manual/automatic), name, and storage location of the report
are defined in the first window.
Automatic reports can only be generated on a WinCC computer (client or server).
Note
Automatic reports are initiated using C actions. To prevent the C actions from being deleted
when loading the OS, they must be copied to the relevant WinCC project on the ES.
Note
After creating or changing automatic reports, the new C actions must be compiled and saved
in the Global Script Editor so that they can be activated.
When continuing the wizard, different data content will be offered for selection for reporting
purposes, depending on the type of report.
For reports that are generated, the template file pre_Reports.xlt is available in the directory
\Siemens\powerrate\bin\config. This file can be edited with standard Excel resources and
adapted without any problem to existing requirements .
Note:
Assignment of the cells within the report is fixed.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
150 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.7.3.1 Reports for energy analyses
When selecting a report for energy analyses (export of archived measured values, cost
center report, duration curve report), the archive tags available in the process value archive
with the name "pre" are read out of the WinCC Tag Logging archive.
The archive tags for which the type of report selected is meaningful are offered for reading
out.
The following types of archive tags are analyzed:
Archive tag name extension Meaning
.C Absolute counter value
.S Energy value
.V Power demand
The archive tags can be read out of the WinCC Tag Logging archive again using the update
button.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 151
Virtual process tags
For energy analyses, formulas can also be edited for the archived tags. These formulas can
be used, for example, for converting the unit, or for distributing the energy value across
different cost centers.
A tag is created by right-clicking on the form and selecting Virtual process tag > Add.
A screen form appears in which the name, unit and calculation formula for the virtual process
tag can be entered.
In the formula, the existing archive tags can be selected in the combobox for the operands.
When naming the virtual process tags, you must note that depending on the value, the
extensions ".C", ".S" and ".V" must be used so that they can be correctly taken into account
in the different report types (see above and the descriptions of the different report types).
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
152 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
The formula entered is displayed in the preview field as a support.
An incorrect formula will be rejected at transfer.
Export of archived measured values
All archive tags stored in the WinCC Tag Logging pre archive are offered for exporting
archived measured values.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 153
Cost center report
The cost center report only takes energy values into account. The application identifies such
values by the ".S" extension added to the archive tag name.
The following configurations and settings must be made:
Definition and assignment of a tariff (see "Configuring tariffs (Page 146)"). The tariff also
defines the unit for the energy values to be analyzed.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
154 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Definition of virtual process tags, if relevant (see "Virtual process tags (Page 150)" in
"Reports for energy analyses")
Definition of cost centers
Note
The cost centers are not present in the WinCC data storage.
Assignment of the cost centers to the archive tags (right-click on the archive tag and
select the cost center with "Assign cost center")
Tags which are not assigned to a cost center are not taken into account in the report.
Since in the case of virtual process tags the archive tags used in the formula must also
be read, these archive tags must not be assigned a cost center if they are not to appear
in the report.
Selection of the archive tags for reading
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 155
Duration curve report
The duration curve report only takes power values into account. The application identifies
such values by the ".V" extension added to the archive tag name.
Only 1 tag may be selected. This tag must have been archived during the reporting period
with a uniform archiving cycle.
5.7.3.2 Batch analyses
When selecting a report for batch analyses (export of batch values, batch report (sorted
according to time), batch report (sorted according to name)), the names and aliases of the
user archives whose names begin with PRE_SUMC_ are displayed from the WinCC
database.
The names of the user archives can be read out of the WinCC database again using the
update button.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
156 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.7.4 Configuration of the times
5.7.4.1 Configuration of report time and report period
Depending on the type of the report and the setting for execution, different settings can be
made for the report time and the report period.
Manual report
For manual reports, the start and end times of the archive data are specified as the report
period.
Manual reports are initiated either direct in the wizard or in the main window using the menu
item Report > Generate.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 157
Automatic report
Automatic reports can only be created on a WinCC computer (client or server).
The following report cycles are available:
Daily
The start time of report creation is specified by the time-of-day (hour, minute and
second).
The following can be set as the time range for the report period:
Time range: Start time - End time
Last day: The time is counted backwards from the report time.
Expired day (00:00 – 24:00): The entire last day prior to generation of the report is
taken.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
158 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Weekly
The time of report generation is specified by the weekday and the time-of-day.
The following can be set as the time range for the report period:
Last week: The time is counted backwards from the report time.
Expired week (Mon – Sun): The entire last week prior to generation of the report is
taken.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 159
Monthly
The time of report generation is specified by the day and time-of-day.
The following can be set as the time range for the report period:
Last month: The time is counted backwards from the report time.
Expired month (1st – end of the month): The entire last month prior to generation of
the report is taken.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
160 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Export counter values
If only absolute counter values (archive tags with the extension ".C") have been selected
when exporting archived measured values, the time of readout must be specified.
The following setting options are available for the readout time:
Daily
The time stamp of the value to be read out is specified by the time-of-day (hour, minute
and second).
Weekly
The time stamp of the value to be read out is specified by the weekday and time-of-day.
Monthly
The time stamp of the value to be read out is specified by the end of the month – number of
days and time-of-day.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 161
Aggregation
Aggregation times can be entered for reports for energy analyses. The export of counter
values (archive tags ".C") and the duration curve report are exceptions to this.
Note:
The aggregation time must not be less than the archiving cycle of the archive tags,
otherwise invalid values could be displayed. This applies in particular to energy values
which are entered manually.
The aggregation time must not be greater than 1 hour, so that the different tariffs can be
accurate to one hour in the cost center report.
Configuring guide
5.7 Configuring powerrate Reports
SIMATIC PCS 7 powerrate
162 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
5.7.4.2 Configuration of the validity period
The period of validity of a report is only relevant for automatic reports.
The period within which the reports are generated is defined here.
When the validity period has expired, the C actions in WinCC that initiate reporting are
deleted from the WinCC project.
If generation of the report is to continue, the validity period must be adapted.
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 163
Technical data 6
The following meanings apply:
Block type name
The symbolic identifier in the library's icon table for the relevant FB. It must be unique to the
project.
Object name
Consists of the type of block (FB) and the number.
Block length in load/work memory
Memory requirement of program code, once per block type.
Length of instance data in load/work memory
Memory requirement of an instance DB.
Temporary memory
The local data memory needed when calling the block in an execution level. This is limited
depending on the CPU. If exceeded, you must check this in the CPU configuration and, if
necessary, redistribute to OBs of the size actually needed.
Called blocks
The blocks stated here are used by the block in question and must be located in the user
program. They are saved in the same library.
Technical data
SIMATIC PCS 7 powerrate
164 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Block (type name) Number Block length in the
load/
work memory (bytes)
Length of instance
data in the load/
work memory
(bytes)
Temporary
memory (bytes)
Called blocks
PRE_SYNC FB1060 1302 / 1100 238 / 92 70 FC1
FC34
SFC1
SFC6
PRE_SUM FB1061 6766 / 5882 912 / 456 92 FC1
FC14
FC34
FC1061
FC1062
SFB35
SFC6
PRE_FIFO_DATA* FB1062 470 / 322 14206 / 14066 54 FC1062
SFC6
PRE_AR_DATA* FB1063 528 / 244 796 / 518 22 FB1064
PRE_AR_SND FB1064 1866 / 1518 480 / 210 102 FC1062
SFB35
SFB37
SFC6
SFC24
PRE_LMGM FB1065 33370 / 25312 16902 / 9874 310 FC1
SFB31
SFB35
SFC6
SFC20
SFC21
SFC51
PRE_LMGM_75 FB1066 26448 / 19814 13478 / 7874 310 FC1
SFB31
SFB35
SFC6
SFC20
SFC21
SFC51
PRE_LMGM_50 FB1067 25022 / 19814 10052 / 5874 310 FC1
SFB31
SFB35
SFC6
SFC20
SFC21
SFC51
Technical data
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 165
Block (type name) Number Block length in the
load/
work memory (bytes)
Length of instance
data in the load/
work memory
(bytes)
Temporary
memory (bytes)
Called blocks
PRE_LMGM_25 FB1068 23558 / 19774 6628 / 3874 310 FC1
SFB31
SFB35
SFC6
SFC20
SFC21
SFC51
PRE_LMGM_10 FB1069 22672 / 19774 4202 / 2334 310 FC1
SFB31
SFB35
SFC6
SFC20
SFC21
SFC51
PRE_AS_SEND FB1070 2174 / 1430 1878 / 1156 44 FB1074
SFB35
SFC6
PRE_AS_RECV FB1071 5616 / 4334 3008 / 1996 46 FB1075
SFB35
SFC6
PRE_SND_H FB1072 3010 / 2070 2692 / 1782 44 FB1074
SFB35
SFC6
PRE_RCV_H FB1073 9820 / 7806 4592 / 3460 44 FB1075
SFB35
SFC6
PRE_BS FB1074 2052 / 1758 792 / 594 38 SFB12
SFC1
SFC6
SFC20
PRE_BR FB1075 1846 / 1590 1374 / 1192 36 SFB13
SFC1
SFC6
SFC20
PRE_SUMC FB1077 11810 / 11012 514 / 226 362 FC1
FC28
SFB35
SFC6
SFC20
SFC21
SFC51
Technical data
SIMATIC PCS 7 powerrate
166 Programming and Operating Manual, 01 / 2009, A5E02306639A-01
Block (type name) Number Block length in the
load/
work memory (bytes)
Length of instance
data in the load/
work memory
(bytes)
Temporary
memory (bytes)
Called blocks
PRE_UA_S FB1078 8618 / 4310 26994 / 22804 84 SFB12
SFB35
SFC6
SFC20
PRE_UA_R FB1079 6814 / 4160 22778 / 20254 80 SFB13
SFB35
SFC6
SFC20
PRE_SWTCH FB1750 2312 / 1836 676 / 326 44 SFB31
SFB35
SFC6
PRE_PAC FB1751 2052 /1702 450 / 212 64 SFB35
SFC6
PRE_CALC* FC1061 358 / 270 12 -
PRE_FIFO_IO FC1062 1070 / 914 22 SFC24
* The technical data relate to the condition of the blocks on delivery. If modified by the user, the data may differ from those
provided.
SIMATIC PCS 7 powerrate
Programming and Operating Manual, 01 / 2009, A5E02306639A-01 167
Service and support information 7
Up-to-the-minute information
You can obtain further assistance by calling the following numbers:
Technical Assistance:
Telephone: +49 (0) 911-895-5900 (8°°--- 17°° CET)
Fax: +49 (0) 911-895-5907
Internet: (http://www.siemens.de/lowvoltage/technical-assistance)
Email: (mailto:technical-assistance@siemens.com)
Service and support information
SIMATIC PCS 7 powerrate
168 Programming and Operating Manual, 01 / 2009, A5E02306639A-01