Sie sind auf Seite 1von 25

Contents Page

Training aims ....................................................................................................................................... 2


Preparing for configuration .............................................................................................................. 3
Overview .......................................................................................................................................... 4
Process value archive Principle .......................................................................................................... 5
Process value archive Data storage ................................................................................................... 6
Measured value archiving and processing ........................................................................................ 7
Tag Logging editor Overview ........................................................................................................... 8
Tag Logging editor Cycle times and time series ............................................................................... 9
Tag Logging editor Archives .............................................................................................................. 10
Tag Logging editor Archive configuration ........................................................................................... 11
Tag Logging editor Archive configuration ........................................................................................... 12
Tag Logging editor Archive configuration ........................................................................................... 13
Tag Logging Editor Properties of archive tags 1/2 .............................................................................. 14
Tag Logging Editor Properties of archive tags 2/2 .............................................................................. 15
Tag Logging editor Type of archiving ................................................................................................. 16
TagLogging Runtime OnlineTrendControl and RulerControl ............................................................. 17
TagLogging Runtime OnlineTableControl ......................................................................................... 18
TagLogging Runtime Data storage .................................................................................................. 19
Exercise 1: Creating a new cycle time and new archive ..................................................................... 20
Exercise 2: Creating new archive tags ........................................................................................... 21
Exercise 3: Archive configuration ....................................................................................................... 22
Exercise 4: Creating a trend picture .................................................................................................... 23
Exercise 4: Creating a trend picture .................................................................................................... 24
Exercise 5: Function test in runtime .................................................................................................... 25

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 1 Tag Logging
The participant will:

Get to know the advantages of Tag Logging


Be able to create cycles and archives
Be able to create new archive tags
Be able to configure archives
Be able to create trend pictures

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 2 Tag Logging
Preparing for configuration
Process coupling
Defining tags for archiving

Measured value acquisition


Grouping of all measuring points and their archiving cycles
Specifying the time period for archiving
Defining the content and appearance of the trend window
Specifying trend pictures

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 3 Tag Logging
SITRAIN Training for ST-BWINCCS
Automation and Industrial Solutions Page 4 Tag Logging
General With Tag Logging, tags from the PLC are displayed in WinCC in the form of trends
and tables, possibly also archived and logged.

To allow the history to be followed as well, the measured values are stored on the
hard disk in a cyclic buffer.

Measured value WinCC fetches values from the controller cyclically. The shortest cycle for
acquisition and archiving is 500 ms. The time stamp with the PC time is added by
WinCC.

Measured value frame


Here, the cycle can be shorter than 500 ms. The values to be archived are first
collected on the controller and then sent to WinCC in a measured value frame.
The time stamps are also included in this frame.

License The basic software WinCC includes 512 free archive tags. For extensive
configurations, an extension is available with powerpacks (at a charge).

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 5 Tag Logging
Archiving To archive measured values, WinCC uses a circular archive with a configurable
size that you can configure with or without backup.
Storage of the archive files is always on the local computer in the corresponding
project.
The WinCC measured value archive consists of multiple individual segments. You
can configure both the size of the measured value archive and the size/time of the
individual segments in WinCC:
Example: The measured value archive archives all measured values that occur
within one week (1), each individual segment records the measured values that
occur within one day (2).
You can always configure both conditions at the same time. If either of the two
criteria (time or size) is exceeded, the following happens:
Criterion for measured value archive (DB) is exceeded (1)-> the oldest measured
values (in other words the oldest single segment) are deleted.
Criterion for single segment exceeded (2)-> A new single segment (SS) is created.
A new single segment is also created when you configure TagLogging data online
(when downloading changes online).

Connectivity Pack is a WinCC option that must be purchased.


With OLE-DB, it is possible to directly access archive data saved in the MS SQL
Server database by WinCC. The OPC HDA (Historical Data Access) and OPC
A&E (Alarms & Events) servers allow access to historical data of the WinCC
archive system or for forwarding / acknowledging messages.

IndustrialDataBridge is also a WinCC option that must be purchased.


Configurable connection to databases and IT systems. For the connection of
WinCC, the WinCC OLE-DB Provider is available.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 6 Tag Logging
General Measured values are acquired in the acquisition cycle by the WinCC system and
saved on hard disk in the archiving cycle. Note that only the values for the
archiving cycle are written. Values that were acquired in the acquisition cycle are
used only for the calculations mentioned above but are not stored in the archive.

Processing WinCC Tag Logging makes the following processing available for measured
values:
- Sum
- Mean value
- Minimum value
- Maximum value
- Free arithmetic with C scripts
- Difference

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 7 Tag Logging
Configuration user interface
After calling Tag Logging, the layout shown in the figure above is displayed on the
monitor:
- On the left in the navigation area, times and archives are displayed in a tree
structure. In the example above, 4 archives have already been created.
- In the middle section (table area), depending on the selection the lower-level
elements are displayed in the navigation area. Changes to properties can be
made directly in the table.
- In the right-hand window, properties can also be changed. In the
example above an archive tag was selected, so that its properties are now
displayed on the right. If, for example, the archive itself is selected, its
properties can be changed.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 8 Tag Logging
Cycle times If the existing cycles are not adequate, additional cycles can also be defined. In the
figure above, the cycle "5 seconds" was added.

Time series Time series can be daily, weekly, monthly or annually.

Examples:
- Daily, every 2 days
- Weekly every Monday
- Weekly every 2nd Monday
- Monthly, on the 5th day
- Monthly, every 2nd month, on the 5th day
- Annually on October 18

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 9 Tag Logging
Process value archives
Here, internal or external tags are written to the TagLogging runtime database
typically cyclically. Later, these archived values will be made available to the
operator in a trend display over the time or in a table display.
The storage location is typically the hard disk. As an alternative, main memory
would also be possible.

Creating several archives serves mainly to group the archive tags. The size
CANNOT be set in the properties of a process value archive.

Compressed archives
In compressed archives, values from existing process value archives are stored in
a further archive and the values are compressed. The compression time can be 1
minute, 1 hour or 1 day.
Example:
Values are archived in the process value archive every second. In the compressed
archive one value is archived per minute that is calculated, for example, from the
maximum value of the 60 second values from the process value archive.
The following functions can be used:
Mean value, sum, minimum value, maximum value, difference and weighted
average value

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 10 Tag Logging
Archive configuration
The data for TagLogging Runtime is saved either in the "TagLogging Fast" or in
the "TagLogging Slow" database. The settings relating to the size of the database
etc can be made in the properties. For details, refer to the next page.

Resetting This function is possible only when runtime has not started. With this, all the
corresponding database segments are irretrievably deleted after a warning box
has been confirmed. If all TagLogging databases need to be deleted, TagLogging
Fast and TagLogging Slow need to be reset.

Connecting an archive
If values from database segments that are no longer connected to the SQL Server,
need to be viewed in WinCC Runtime, these segments must exist on the local
hard disk. Following this, the function "Link archive" can be used.
Disconnect from archive
Only the database segments you have connected yourself can be disconnected
again with this function. The file is not deleted on the hard disk.

Functions in WinCC Runtime


Corresponding functions for linking and disconnecting are also available in WinCC
Runtime. The advantage of this is that the operator does not need to change to the
configuration. In the figure above, for example, the OnlineTrendControl is shown.
This is also possible in the AlarmControl.
After linking a segment, the data is immediately available and can be viewed, for
example, by paging in the archive.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 11 Tag Logging
Here, you specify the period for which the data is archived and as of when the data
will be overwritten. Depending on the archiving cycle a fast and slow archive are
created. The data is stored in both archives compressed.

Archive configuration
The "time period of all segments" or "Maximum size of all segments" relates to the
entire archive. If one or other limit is exceeded, old segments are deleted.

The "Time period covered by a single segment or "Max. size of a single


segment" relates to archive slices. This means that the archive can be distributed
in several database files. If one of the limits is exceeded, a new segment is
created.

The "Time of the segment change": Here, a defined start time can be entered, for
example if there is daily segmentation, each segment will start at midnight. If the
project is started the first time at 4 p.m., the first segment covers the period from 4
p.m. to midnight. Following this, each segment covers the time from midnight to
midnight.

The archive configuration can be specified separately for TagLogging Slow and
TagLogging Fast.

Note Each time there is a change in the configuration, a new segment is started in RT.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 12 Tag Logging
Backup configuration
As an option, an automatic backup can be set here. When this has been enabled,
15 minutes after a segment change, the old segment is copied to the destination
path (not shifted).
The destination path can also be a network drive.

Alternative destination path


The "Alternative destination path" setting is used when, for example the network
path for the backup is not available, for example due to network failure.

Deleting backup files


WinCC does not delete files on the backup path (destination path or alternative
destination path). Here, the user is responsible for deleting these files in good time
or archiving them. Database segments in the backup path can, for example, be
deleted with the Windows Explorer if they are not connected to the SQL Server.
Signing If signing and backup are activated, each archive backup file is signed off when it
is swapped out. If the file is then reconnected to WinCC, it is possible to recognize
whether or not the file has been changed since it was swapped out.
If you use signing of archives, the maximum size of a single segment may not
exceed 200 MB.
For archiving of signed data, the configuration limits are reduced.

Archive Contents This tab exists only with TagLogging Fast. All archive values that meet the
conditions above are archived in the TagLogging Fast database, all others in the
TagLogging Slow database.
Process-controlled measured values: The controller connects values e.g. every 50
ms and sends these with a special measured value frame to WinCC. To do this,
for example, the block AR_SEND is called on the S7-400.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 13 Tag Logging
Properties of an archive tag
Further properties are explained on the next page.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 14 Tag Logging
Properties of an archive tag
The relationship between the acquisition type (archiving type) and other properties
such as "Start tag" is explained on the next page.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 15 Tag Logging
Archiving type WinCC Tag Logging makes the following types of archiving available for measured
values:
- Cyclic - continuous
Data acquisition is started at the system start (runtime) and performed in constant
time cycles until the system is turned off. This type of archiving is used very often.

- Acyclic
In acyclic archiving, a tag is always archived when the tag stored in "Start tag"
changes or when the return value of the C function stored in "Start event" changes.
The factor for the archiving cycle can be changed.

- Cyclic-selective
Archiving is started depending on the occurrence of an event and is performed in
constant time cycles until the occurrence of a second event. With the stop signal,
the last acquired value is also saved.
This method is selected when, for example, archiving should only be active when a
machine is running (e.g. only for three hours a day).
As an option, a fixed number of leader or trailer values can be set.

- only upon change


The process values are read every 500 ms and written to the database only if a
change has occurred.
The archiving cycle can now be set.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 16 Tag Logging
Trend display in runtime
A trend display of archive tags (or also of online tags) is possible with "WinCC
OnlineTrendControl".

In the properties of this control, the following settings can be made:


- Color, line weight and if applicable dot width of the trends
- One or more time axes
- One or more value axes
- Selection of the buttons for the toolbar
- Status bar
- One or more trend windows
- etc.

To be able to display values for the read ruler or results for statistics functions, a
"WinCC RulerControl" needs to be configured. This is permanently assigned to
exactly one "WinCC Online Trend Control".

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 17 Tag Logging
Table display in runtime
A table display of archive tags is possible with the "WinCC OnlineTableControl".

In the properties of this control, the following settings can be made:


- One or more time columns
- One or more value columns
- Selection of the buttons for the toolbar
- Status bar
- etc.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 18 Tag Logging
Name RT-DB The runtime data is distributed over the master database and several runtime
databases.
The master database manages the runtime databases and references the
individual runtime databases. The master database is created in the project
directory. The name of the master database is as follows: ProjectnameRT.ldf and
ProjectnameRT.mdf
The runtime databases (also known as single segments) each contain the
archived data related to a specific period of time.

The segments of the database are located either in the subfolder of the project
ArchiveManager\TagLoggingFast or in the subfolder
ArchiveManager\TagLoggingSlow.

A database segment always consists of two files (*.ldf and *.mdf).


ldf = Database Transaction Log File (organizational file)
mdf = Database Primary Data File (File with the user data)

The file name is made up as follows:


WINCC30_CONTROL#ROOM_TLG_F_201407290727_201407290927.ldf
PCname_Projectname_TLG_F_YYYYMMDDHHMM_YYYYMMDDHHMM.ldf

TLG_F = TagLoggingFast
TLG_S = TagLoggingSlow

The time stamps show the start time and if there are two time stamps present also
the end time.

Note The time stamps indicate UTC time.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 19 Tag Logging
Objective The existing Control_Room project will be expanded with a process value archive.
The measured value archive will be visualized with an additional
picture with an Online Trend Control as a trend display.

Exercise 1. Open the Tag Logging editor.

2. In the navigation panel, select "Cycle times". In the table then add a new time
with the name "5 seconds". Define the time base as "1 second" and the time
factor as 5.

3. Then select the "Process Value Archive". Then write the name of the new
archive in the table column Archive name "Temperatures_Station1". In the
properties of the new archive, check that "Hard disk" is selected as the storage
location.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 20 Tag Logging
Exercise 1. First select the name of the new archive "Temperatures_Station1".

2. As process tags select "Temperature_R1" and "Temperature_R2". Both are


internal tags.

3. Adapt the properties (Acquisition cycle, Archiving cycle, ...) as shown above.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 21 Tag Logging
Exercise 1. Open the archive configuration of TagLogging Fast (shortcut menu of
Archive -> Archive configuration -> TagLogging Fast -> Properties) and
TagLogging Slow.

2. Adapt the settings as shown above.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 22 Tag Logging
Exercise 1. Open the Graphics Designer and create a new picture with the name
"Curves.pdl" and with the same size as your previous pictures.

2. Add a button to the start picture for selecting the picture "Curves.pdl".

3. In the trends picture, select the control "WinCC OnlineTrendControl in the


Controls palette and then drag it to the required size in the new picture.

4. In the configuration dialog of the control, make the following


settings:
Value axes tab:
- Add the New button to a second value axis
- Value axis1: Value range from 0 to 100
- Value axis2: Value range from 0 to 500
Time axes tab:
- Time axis1: Time range 5 x 1 minute
Trends tab:
- Add a second trend with the New button
-Trend1: Trend window1, Time axis1, Value axis 1, color blue,
Archive tag: Temperatures_Station1\Temperature_R1
- Trend2: Trend window1, Time axis1, Value axis 2, color gray
Archive tag: Temperatures_Station1\Temperature_R2
Toolbar tab:
- Select all key functions

5. Add two slider objects to change the process tags "Temperature_R1 (0 to 100)
and "Temperature_R2" (0 to 500).

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 23 Tag Logging
Objective The existing OnlineTrendControl has an additional window added for the output of
values (read ruler and statistics).

Exercise 5. Add a RulerControl below the OnlineTrendControl.

6. Configure the following settings in the configuration dialog of this control:


General tab:
- Source: Control1
7. Save the all open pictures (File/Save All).

Note With controls a correct preview is only shown when the zoom level for the graphics
picture is set to 100%.

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 24 Tag Logging
Exercise 1. Before you start WinCC Runtime, enable "Tag Logging Runtime" in the
computer properties.

2. Start WinCC Runtime.


Do the following in the process control in the OnlineTrendControl:

Change the values for the two process tags with the slider objects.
Stop and start the updating of the trends
Show the read line with the "Ruler" button and move this to its rough
position with the mouse. Pixel-precise movement can be achieved with
the left and right cursor keys.
When is for example "29.0 i" shown in the Y value column and when for
example is "30.0" displayed?
Zoom a window area with the "Zoom area" button.At the end, restore the
original view with "Original view".
Selection according to time period
Hide trends
Test the statistics functions. Start by clicking on the "Set statistics range"
button. Position the left and right limit line and then click on "Calculate
statistics".

SITRAIN Training for ST-BWINCCS


Automation and Industrial Solutions Page 25 Tag Logging