Professional Documents
Culture Documents
If you have any questions regarding this Application Description, please send an e-
mail to:
online-support.automation@siemens.com
Copyright Siemens AG 2010 All rights reserved
Operations Diary
2 V1.0, Entry ID: 42637128
s Automation Task 1
Automation Solution 2
Functional Mechanisms
of this Application 3
Operation of the
Application 4
SIMATIC
Operations Diary Further Notes, Tips and
Trick, etc. 5
Acquisition of power data over various periods of time
Literature 6
History 7
Copyright Siemens AG 2010 All rights reserved
Operations Diary
V1.0, Entry-ID: 42637128 3
Warranty and Liability
Operations Diary
4 V1.0, Entry ID: 42637128
Table of Contents
Table of Contents
Warranty and Liability ................................................................................................. 4
1 Automation Task................................................................................................ 6
2 Automation Solution ......................................................................................... 8
2.1 Overview of the overall solution ........................................................... 8
2.2 Description of the core functionality ..................................................... 9
2.2.1 SIMATIC S7-300 controller .................................................................. 9
2.2.2 WinCC flexible ES / operator panel...................................................... 9
2.2.3 Overview and description of the user interface.................................. 10
2.2.4 Sequence of the core functionality operations ................................... 13
2.3 Hardware and software components used......................................... 14
3 Functional Mechanisms of this Application ................................................. 15
3.1 Functionality, SPS program blocks .................................................... 17
3.1.1 Program details of function block FB100 ........................................... 17
3.1.2 Program details of function block FB102 ........................................... 18
3.1.3 Program details of function block FB210 ........................................... 19
3.1.4 Program details of the data blocks..................................................... 21
3.2 Functionality, HMI program ................................................................ 22
3.2.1 Program details of the "01_Hour" view .............................................. 22
3.2.2 Program details of the "02_Day" view................................................ 23
Copyright Siemens AG 2010 All rights reserved
Operations Diary
V1.0, Entry-ID: 42637128 5
1 Automation Task
2.1 Overview of the overall solution
1 Automation Task
Introduction
The tracing of energy consumption over various periods of time is an important
issue in many areas of the manufacturing and processing industry.
At what times did energy consumption increase?
Furthermore, the daily variations are also important for the energy generation
through solar, wind and water power plants.
How much energy has been produced at what times?
This application is suitable for both use cases.
The input and output of electrical power can be evaluated and displayed over
different periods of time.
Figure 1-1
Copyright Siemens AG 2010 All rights reserved
Operations Diary
6 V1.0, Entry ID: 42637128
1 Automation Task
2.1 Overview of the overall solution
The acquired data can also be stored on a storage medium in the form of a "CSV
file".
Operations Diary
V1.0, Entry-ID: 42637128 7
2 Automation Solution
2.1 Overview of the overall solution
2 Automation Solution
2.1 Overview of the overall solution
Scheme
The figure below shows a schematic illustration of the main components of this
solution.
Figure 2-1
Measuring device to acquire
the generated power,
e.g. SENTRON PAC3200
Copyright Siemens AG 2010 All rights reserved
Exclusion
This application does not include a description of
STEP 7
WinCC flexible
Basic knowledge of these topics is assumed.
Furthermore, this application does not stipulate the type of measuring device to be
used for power data acquisition.
One example of a suitable measuring device is the SENTRON PAC3200.
Operations Diary
8 V1.0, Entry ID: 42637128
2 Automation Solution
2.2 Description of the core functionality
The attached project includes the configuration for a SIMATIC S7-300 controller.
The generated power is continuously registered by means of a function block. In
this application, however, the value for the generated power is provided by a
simulation program and transmitted to the function block as "DINT value".
When using this application in practice, you must transmit "your" actual values to
this function block.
The function block uses the data received to calculate the power generated per
minute and transfers these values to the relevant variables.
The function block calculates a total of 60 "minute values" – one value for every
minute – and transmits them to the operator panel.
Note For the acquisition and output of the generated power to the PLC you may use
the multifunction meter PAC3200, for example.
Copyright Siemens AG 2010 All rights reserved
The project attached to this document includes a WinCC flexible project that is
integrated in STEP 7.
The "minute values" determined in STEP 7 are read-in via the operator panel.
Further calculation for the defined time periods is effected with the help of scripts.
Defined time periods:
hourly overview
daily overview
weekly overview
monthly overview
yearly overview
For each of these time periods, a separate "view" is available.
The acquired data is displayed on the HMI panel in the form of bar chart diagrams.
Furthermore, the values are stored as recipes and as a "CSV file" at hourly
intervals.
This stored data can be read out and displayed on a separate page.
Operations Diary
V1.0, Entry-ID: 42637128 9
2 Automation Solution
2.2 Description of the core functionality
The following chapter includes a brief description of the configured screen views.
Table 2-1
No. Description Display
1. "01_Hour" view:
"Current hour overview in KW"
2. "010_Hour_Details" view:
"Details to current hour overview in
KW"
3. "02_Day" view:
"Current day overview in KWh“
Operations Diary
10 V1.0, Entry ID: 42637128
2 Automation Solution
2.2 Description of the core functionality
5. "04_Month" view:
"Current month overview in KWh"
6. "05_Year_Overview" view:
"Annual survey in kWh"
Operations Diary
V1.0, Entry-ID: 42637128 11
2 Automation Solution
2.2 Description of the core functionality
8. "06_Recipe_Display":
"Recipe view"
years.
In the recipe view, single values can
be added or edited manually.
9. "07_General_Settings" view:
"Settings"
Operations Diary
12 V1.0, Entry ID: 42637128
2 Automation Solution
2.2 Description of the core functionality
No
Minute elapsed?
Copyright Siemens AG 2010 All rights reserved
Description:
The PLC continuously retrieves the generated power values.
The PLC system time is analyzed to determine when a new minute starts.
After each minute, the power generated per minute is calculated.
The calculated values are transferred to the HMI panel as parameters.
The HMI panel analyzes the calculated values and assigns them to the relevant
screen views.
Operations Diary
V1.0, Entry-ID: 42637128 13
2 Automation Solution
2.3 Hardware and software components used
Hardware components
Table 2-2
Component Qty MLFB/Order number Notes
CPU 315-2 DP 1 6S7 315-2AG10-0AB0 As an alternative, any
other 300/400
controller or a WinAC
MP may be used.
MP 277 10“ Touch 1 6AV6 643-0CD01-1AX0 As an alternative, any
operator panel
supporting scripts and
recipes may be used.
Memory card / 1 See FAQ entry For storage of the
USB stick http://support.automation.sie recipe data.
mens.com/WW/view/en/2184
7868
Copyright Siemens AG 2010 All rights reserved
Operations Diary
14 V1.0, Entry ID: 42637128
3 Functional Mechanisms of this Application
2.3 Hardware and software components used
For a detailed description of the individual blocks please refer to chapter 3.1
Operations Diary
V1.0, Entry-ID: 42637128 15
3 Functional Mechanisms of this Application
2.3 Hardware and software components used
Screen views:
The individual views display the calculated power values.
(See overview and description of the user interface in chapter 2.2.2)
Scripts:
The scripts are used to perform the following functions:
Analysis of power values
Update of text fields
Import of recipes
General calculations
Operations Diary
16 V1.0, Entry ID: 42637128
3 Functional Mechanisms of this Application
3.1 Functionality, SPS program blocks
Figure 3-3
Copyright Siemens AG 2010 All rights reserved
FB100 is solely used to simulate the "generated power" for testing the functions of
the application.
In your plant constellation, the generated power must be transferred to the
"DB22.DBD0" as a "DINT value".
(The value may be provided with the PAC3200 multimeter, for example).
Function principle of simulation:
The CPU hardware includes a configured MB10 clock memory.
The block "ADD_DI" continuously adds up the values which are then transferred to
the "DB22.DBD0".
When the counter value reaches a number of 64,000, the value will be reset to
zero, so as to avoid limit violations.
Operations Diary
V1.0, Entry-ID: 42637128 17
3 Functional Mechanisms of this Application
3.1 Functionality, SPS program blocks
Figure 3-4
Copyright Siemens AG 2010 All rights reserved
FB102 is used to generate a trigger signal which is set at the start of a new minute.
In the further course of program execution (FB210), this signal (minute change) is
used to trigger the "power per minute" measurement.
Evaluation of the CPU clock time is performed with the SFC 1 "READ_CLK". The
"5th byte" (second) of the system clock time is analyzed.
When the second's value is "0" (start of a new minute), a bit will be set.
This "bit" is defined as "output parameter".
If the second's value is greater than "0", the "bit" will be reset.
You only need to call FB102 in OB1 and to apply a variable to the "output" of the
FB.
(Trigger variable for the signal indicating a "minute change").
In the example configuration, these steps are already implemented.
Operations Diary
18 V1.0, Entry ID: 42637128
3 Functional Mechanisms of this Application
3.1 Functionality, SPS program blocks
Figure 3-5
Copyright Siemens AG 2010 All rights reserved
FB210 calculates the power produced per minute over a period of one hour.
Function principle:
The power produced is continuously acquired.
When calculation is started or at the beginning of a new minute, the current value
of the power produced will be intermediately stored (value 0 1).
After one minute, the new power generated will be intermediately stored (value 02).
The difference of these two values (value 02 – value 01) will then be transferred as
the result for the specific minute.
Over a period of one hour, a variable is configured for each minute and the values
will be transmitted to the operator panel.
In the operator panel, the calculated values are further processed in scripts.
After one hour, the calculated values will be reset via the operator panel.
Operations Diary
V1.0, Entry-ID: 42637128 19
3 Functional Mechanisms of this Application
3.1 Functionality, SPS program blocks
You only have to call FB210 in OB1 and apply the relevant variables to the "I/O
parameter" of the FB.
In the example configuration, these steps are already implemented.
Parameter details
Table 3-1
No. Parameter Description
1. Start_Measuring This parameter is used to start power
measurement.
Power measurement will start only if the signal "1"
is applied at this input.
In this example, the input is set to "1" when the
operator panel is started.
2. Minute_Changed This parameter is used to transfer the "trigger
signal" generated by FB102.
(The trigger signal indicates a "minute change"):
3. Generated_Power This parameter is used to transfer the value of the
generated or received power to the block.
In this application, the value is simulated with
FB100.
4. All_Minute_Value_Reset This parameter is used to reset the current "minute
Copyright Siemens AG 2010 All rights reserved
values".
In this application, the values will be reset after a
new startup of the PLC or after restart of the
operator panel.
5. Minute_0 ... Minute_59 These parameters are used to output the
calculated power values per minute.
The values are read in by the operator panel at
"continuous cyclic intervals".
In this example, a variable has been stored for
each minute beforehand.
Operations Diary
20 V1.0, Entry ID: 42637128
3 Functional Mechanisms of this Application
3.1 Functionality, SPS program blocks
DB2
DB2 is used to store the calculated "power values per minute" over a period of one
hour.
The PLC uses this DB for data exchange with the operator panel.
DB20
DB20 is used for the area pointer in the HMI panel for automatic clock
synchronization between the operator panel and the PLC system time.
DB22
DB22 is used for the "global" data exchange between operator panel and PLC. It is
used to read out the generated power, for example, and to transfer the calculated
power per minute to the operator panel.
SFC1
Copyright Siemens AG 2010 All rights reserved
The SFC 1 "READ_CLK" (read system clock) is used to read out the clock time
from the CPU, so as to receive the current date and time information.
Operations Diary
V1.0, Entry-ID: 42637128 21
3 Functional Mechanisms of this Application
3.2 Functionality, HMI program
Table 3-2
No. Description Display
1. A "bar chart" has been configured for
each minute.
The values are output directly to the
bar chart display via the PLC.
Copyright Siemens AG 2010 All rights reserved
3. In the display properties, two scripts are called while the view is built up.
A0_Start_Project
A4_Set_Day_Week
Operations Diary
22 V1.0, Entry ID: 42637128
3 Functional Mechanisms of this Application
3.2 Functionality, HMI program
Table 3-3
No. Description Display
1. A "bar chart" has been configured for
each hour.
The required values are calculated
by the script "A1_Calc_Minute" and
then transferred to the bar chart
display.
3. In the display properties, two scripts are called while the view is built up.
A2_Refresh_Textfield_Screen_02
A8_Total_Result
Operations Diary
V1.0, Entry-ID: 42637128 23
3 Functional Mechanisms of this Application
3.2 Functionality, HMI program
Table 3-4
No. Description Display
1. A "bar chart" has been configured for
each weekday.
The required values are calculated
by using the script "A1_Calc_Minute"
and then transferred to the bar chart
display.
3. In the display properties, two scripts are called while the view is built up.
A8_Total_Result
Operations Diary
24 V1.0, Entry ID: 42637128
3 Functional Mechanisms of this Application
3.2 Functionality, HMI program
Table 3-5
No. Description Display
1. A "bar chart" has been configured for
each day.
The required values are calculated
by using the script "A1_Calc_Minute"
and then transferred to the bar chart
display.
3. In the display properties, two scripts are called while the view is built up.
A3_Refresh_Textfield_Screen_04
A8_Total_Result
Operations Diary
V1.0, Entry-ID: 42637128 25
3 Functional Mechanisms of this Application
3.2 Functionality, HMI program
Table 3-6
No. Description Display
1. A "bar chart" has been configured for
each day.
The required values are transferred
from the "selected" recipe to the bar
chart display.
Operations Diary
26 V1.0, Entry ID: 42637128
3 Functional Mechanisms of this Application
3.2 Functionality, HMI program
A0_Start_Project
This script is called only when the HMI panel is started.
It initiates the following functions:
start of measurement
Reset of the step sequence
A1_Calc_Minute
This script is called once per minute via the variable
"Global_Data.Evaluation_MinuteChanged".
The script is used to calculate the following values:
hourly values
daily values
weekly values
monthly values
recipe values
Copyright Siemens AG 2010 All rights reserved
A2_Refresh_Textfield_Screen_02
This script is called when the "02_Day" has been selected .
It is used to update the text fields in the "02_Day" view.
A3_Refresh_Textfield_Screen_04
This script is called when the "04_Month" has been selected.
It is used to update the text fields in the "04_Month" view.
A4_Set_Day_Week
This script is called once when starting the operator panel.
It is required for evaluation to determine the current day (1 – 31) and weekday (1 -
7) when the operator panel starts.
A5_LoadDataRecord
This script is called via the symbolic I/O fields in the view "05_Year_Overview".
It is used to load the relevant recipe data record.
The recipe and data record number is defined by the symbolic I/O field.
A6_Import_Recipe
This script is called by clicking the "Import data records" button in the
"07_General_Settings" view.
Before previously exported recipe data records can be imported, the "Import data
records" function must have been configured for each individual recipe file.
The complete recipe name must be entered in the "file name" parameter.
A status request may be used to ensure that all recipes will be imported one after
another.
Operations Diary
V1.0, Entry-ID: 42637128 27
3 Functional Mechanisms of this Application
3.2 Functionality, HMI program
A7_Day_and_Recipe_Value
This script is called via the script "A0_Start_Project".
After a "restart" of the panel it is used to assign any available daily values from the
stored data record to the current month.
A8_Total_Result
This script is used for various screen views.
It adds the single values to calculate the sum total.
3.2.7 Recipes
3.2.8 Scheduler
Copyright Siemens AG 2010 All rights reserved
Operations Diary
28 V1.0, Entry ID: 42637128
4 Operation of the Application
3.2 Functionality, HMI program
Note The application configuration requires that the PLC and the operator panel
remain in continuous operation. Neither the PLC nor the operator panel should
be temporarily switched, so as to avoid data corruption
The application may only be used for example purposes. In view of the vast
number of possible plant constellations, each application needs to be adjusted
Copyright Siemens AG 2010 All rights reserved
Operations Diary
V1.0, Entry-ID: 42637128 29
4 Operation of the Application
3.2 Functionality, HMI program
Table 4-1
No. Action Display
1. After startup of the operator panel, the screen
view "Current hour overview in kW" appears
and measurement will start automatically.
The values are displayed as "green" bars.
The total of each minute is calculated over a
period of 60 minutes.
Clicking the "Details >>" button takes you to
the "Details to current hour overview in kW".
This screen view shows the "hourly values" in
a symbolic display.
Operations Diary
30 V1.0, Entry ID: 42637128
4 Operation of the Application
3.2 Functionality, HMI program
Operations Diary
V1.0, Entry-ID: 42637128 31
4 Operation of the Application
3.2 Functionality, HMI program
Operations Diary
32 V1.0, Entry ID: 42637128
5 Further Notes, Tips and Tricks, etc.
Recipes
The number of recipes can be reduced or increased.
Please note that the scripts need to be adapted accordingly.
Variables
Instead of the variables and addresses used in this application, you may also use
"your" plant-specific variables and addresses.
Please note that the scripts need to be adapted accordingly.
Most of the variables are not PLC-linked. This measure ensures that
Copyright Siemens AG 2010 All rights reserved
Operations Diary
V1.0, Entry-ID: 42637128 33
6 Literature
6 Literature
6.1 Literature
The following list is by no means complete and only provides a selection of related
references.
Table 6-1
Topic Title
/1/ STEP7 Automatisieren mit STEP7 in AWL und SCL
[Automation with STEP7 in STL and SCL]
Hans Berger
Published by Publicis MCD Verlag
ISBN 3-89578-113-4
/2/
Table 6-2
Topic Title
\1\ Reference to this http://support.automation.siemens.com/WW/view/en/42637128
document
\2\ Siemens I IA/DT http://support.automation.siemens.com
Customer Support
\3\ PAC3200 How can WinCC flexible display values of SENTRON PAC3200 /
PAC4200 via Ethernet ?
http://support.automation.siemens.com/WW/view/en/37450303
7 History
Table 7-1
Version Date Change
V1.0 30.04.2010 First issue
Operations Diary
34 V1.0, Entry ID: 42637128