Contents
Page
Training Training aims ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........... ........... ........... ........... ........... ........... ........
2
Preparing Preparing for configurat configuration ion
............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........... ......... ....
3
....... .......... ...... ...... ...... ....... ....... ...... ...... ...... ..... ...... ....... ...... ...... ....... ....... ...... ...... ...... ...... ...... ...... ...... ....... ....... ....... ....... ...... ....... ....... ....... ........ ....... ....... ....... ...... ...... ...... ...... ....... ...... ..
4
Process Process value archive archive Principle Principle ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........... .....
5
Proces Process s value archive archive Data Data stora storage ge ....... .......... ...... ...... ...... ....... ....... ....... ........ ....... ....... ....... ...... ...... ...... ...... ....... ....... ...... ...... ...... ...... ...... ...... ...... ...... ....... ....... ...... ..... ..
6
Measured Measured value archiving archiving and processin processing g
............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ .......... ....
7
...... .......... ....... ...... ...... ...... ..... ...... ....... ...... ...... ....... ....... ...... ...... ...... ...... ...... ..... ...... ........ ....... ....... ....... ...... ...... ...... ...... ....... ....... ...... ...... ...... ...
8
Overview Overview
Tag Logg Logging ing edit editor or Over Overview view
Tag Logg Logging ing edit editor or Cycl Cycle e times times and and time time serie series s
....... .......... ...... ....... ....... ...... ...... ...... ...... ...... ..... ...... ........ ....... ....... ....... ...... ...... ...... ...... ....... ....... ...... ..... ..
9
Tag Logging Logging editor editor Archives Archives ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........... ......... ....
10
Tag Logging Logging editor editor Archive Archive configura configuration tion ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ....... ..
11
Tag Logging Logging editor editor Archive Archive configura configuration tion ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ....... ..
12
Tag Logging Logging editor editor Archive Archive configura configuration tion ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ....... ..
13
Tag Loggin Logging g Edito Editorr Propertie Properties s of of archive archive tags tags 1/2 1/2 ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ......
14
Tag Loggin Logging g Edito Editorr Propertie Properties s of of archive archive tags tags 2/2 2/2 ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ......
15
Tag Logging Logging editor Type of archiving archiving ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ........ ..
16
TagLog TagLoggi ging ng Runtim Runtime e Online OnlineTre TrendC ndCon ontrol trol and and RulerCo RulerContro ntroll ........ ........... ..... ...... ........ ....... ....... ........ ....... ..... ...... ....... ...... ...... ....... ....... ...... .....
17
TagLogging TagLogging Runtime Runtime OnlineTabl OnlineTableContr eControl ol ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... .....
18
TagLogging TagLogging Runtime Runtime Data storage storage
............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ......... ...
19
Exercise Exercise 1: 1: Creating Creating a new cycle time and new archive ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........ ..
20
Exercis Exercise e 2: Creat Creating ing new new archi archive ve tags tags
...... .......... ....... ....... ....... ...... ...... ...... ...... ....... ....... ...... ...... ...... ...... ...... ...... ...... ...... ....... ....... ..... ...... ....... ...... ...... ...... ...... ...
21
Exercise Exercise 3: Archi Archive ve configura configuration tion ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ............ ........ ..
22
Exercise Exercise 4: Creatin Creating g a trend trend picture picture ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ........... .....
23
Exercise Exercise 4: Creatin Creating g a trend trend picture picture ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ........... .....
24
Exercise Exercise 5: Function Function test test in runti runtime me ............ ................. ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ........... ............ ........... ........... ........... .....
25
SITRAIN Train Trainin ing g for for Automation Automation and Industrial Industrial Solutions Solutions
Page 1
ST-BWINCCS 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 archiv es
•
Be able to create trend pictures
SITRAIN Train Trainin ing g for for Automation Automation and Industrial Industrial Solutions Solutions
Page 2
ST-BWINCCS Tag Logging
Preparing for configuration
SITRAIN Training for Automation and Industrial Solutions
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
Page 3
ST-BWINCCS Tag Logging
SITRAIN Training for Automation and Industrial Solutions
Page 4
ST-BWINCCS Tag Logging
General
With Tag Logging, tags from the PLC are displayed in W inCC in the form of trends and tables, possibly also archiv ed and logged. To allow the history to be foll owed as well, the measured values are stored on the hard disk in a cyclic buffer.
Measured valu e
WinCC fetches values from the controller cyclically. The shortest cycle for acquisition and archiving is 500 ms. The time stamp with the PC tim e is added by WinCC.
Measured valu e frame Here, the cycle can be shorter than 500 ms. The values to be archiv ed 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 avai lable with powerpacks (at a charge).
SITRAIN Training for Automation and Industrial Solutions
Page 5
ST-BWINCCS Tag Logging
Arc hi vi ng
To archive measured values, WinCC uses a circular archiv e with a configurable size that you can conf igure with or without backup. Storage of the archive files is always on the local computer in t he 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 archiv es all measured values that occur within one week (1), each i ndividual segment records the measured v alues 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 archiv e (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 W inCC option that must be purchased. With OLE-DB, it is possible to directly access archiv e 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 f or forwarding / acknowledging messages.
IndustrialDataBridge is also a W inCC option that must be purchased. Configurable connection to databases and IT systems. For the connecti on of WinCC, the WinCC OLE-DB Provider is available.
SITRAIN Training for Automation and Industrial Solutions
Page 6
ST-BWINCCS Tag Logging
General
Measured values are acquired in t he acquisition cycle by the W inCC system and saved on hard disk in the archiv ing 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 av ailable for measured values: - Sum - Mean v alue - Minimum value - Maximum value - Free arithmetic with C scripts - Difference
SITRAIN Training for Automation and Industrial Solutions
Page 7
ST-BWINCCS Tag Logging
Configuration user in terface 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 nav igation 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 t hat its properties are now displayed on the right. If , for example, the archive itself is selected, its properties can be changed.
SITRAIN Training for Automation and Industrial Solutions
Page 8
ST-BWINCCS Tag Logging
Cycle times
If the existing cycles are not adequate, additional cycles can also be def ined. 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 Automation and Industrial Solutions
Page 9
ST-BWINCCS Tag Logging
Process value archives Here, internal or ex ternal tags are written to the TagLogging runtim e database typically cyclically. Later, these archiv ed values will be made available to the operator in a trend display over the time or in a table display. The storage location is typical ly the hard disk. As an alt ernative, main memory would also be possible. Creating several archives serves mainly to group the archiv e tags. The size CANNOT be set in the properties of a process val ue 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 tim e can be 1 minute, 1 hour or 1 day. Example: Values are archived in the process value archive ev ery second. In the compressed archive one value is archived per minute that is calculat ed, 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 Automation and Industrial Solutions
Page 10
ST-BWINCCS Tag Logging
Arc hi ve con fi gu ratio n The data for TagLogging Runtime is sav ed either in the "TagLogging Fast" or in the "TagLogging Slow" database. The settings relating to the size of the dat abase etc can be made in the properties. For details, refer to the next page. Resetting
This function is possible only when runtim e has not started. With this, all the corresponding database segments are irretri evably deleted after a warning box has been confirm ed. If all TagLogging databases need to be delet ed, 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 Serv er, need to be v iewed in WinCC Runtime, these segments must exist on the local hard disk. Following this, the f unction "Link archive" can be used. Disconnect from archive Only the database segments you hav e connected yourself can be disconnected again with this function. The file is not deleted on the hard di sk. Functio ns in WinCC Runtime Corresponding functions for linking and disconnecting are also available in WinCC Runtime. The advantage of this is that the operat or does not need to change to t he configuration. In the figure abov e, 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 Automation and Industrial Solutions
Page 11
ST-BWINCCS Tag Logging
Here, you specify the period for which the data is archiv ed and as of when the data will be ov erwritten. Depending on the archiving cycle a fast and slow archi ve are created. The data is stored in both archives compressed. Arc hi ve con fi gu ratio n The "time period of all segments" or "Maximum size of all segments" relates to the entire archive. If one or other lim it 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 limi ts is exceeded, a new segment is created. The "Time of the segment change": Here, a defi ned 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 cov ers 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 Automation and Industrial Solutions
Page 12
ST-BWINCCS 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 ol d segment is copied to the destinati on path (not shifted). The destination path can also be a network drive. Alternative des ti natio n path The "Alternative destination path" setting is used when, for ex ample the network path for the backup is not avai lable, for example due to network failure. Deleting b ackup fil es 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 archiv ing 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 acti vated, each archive backup file is signed of f 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 arc hives, the maximum size of a single segment may not exceed 200 MB. For archiv ing of signed data, the conf iguration limits are reduced.
Arc hi ve Cont ent s
This tab exists only with TagLogging Fast. All arc hive values that meet the conditions above are archiv ed in the TagLogging Fast database, all others in the TagLogging Slow database. Process-controlled measured values: The controller connects v alues e.g. every 50 ms and sends these with a special measured value frame to W inCC. To do this, for example, the block AR_SEND is called on the S7-400.
SITRAIN Training for Automation and Industrial Solutions
Page 13
ST-BWINCCS Tag Logging
Properties of an archive tag Further properties are ex plained on the next page.
SITRAIN Training for Automation and Industrial Solutions
Page 14
ST-BWINCCS Tag Logging
Properties of an archive tag The relationship between the acquisition type (archiv ing type) and other properties such as "Start tag" is explained on the next page.
SITRAIN Training for Automation and Industrial Solutions
Page 15
ST-BWINCCS Tag Logging
Arc hi vi ng ty pe
WinCC Tag Logging makes the following types of archiving available for measured values: - Cyclic - continuous Data acquisition is started at t he system start (runtime) and perf ormed 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 archiv ed when the tag stored in "Start tag" changes or when the return v alue of the C function stored in "Start ev ent" changes. The factor for the archiv ing 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, f or 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 Automation and Industrial Solutions
Page 16
ST-BWINCCS Tag Logging
Trend displ ay in runti me A trend display of archive tags (or also of online tags) is possible with "Wi nCC 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 f unctions, a "WinCC RulerControl" needs to be conf igured. This is permanently assigned to exactly one "W inCC Online Trend Control".
SITRAIN Training for Automation and Industrial Solutions
Page 17
ST-BWINCCS Tag Logging
Table displ ay 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 Automation and Industrial Solutions
Page 18
ST-BWINCCS 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 pr oject directory. The name of the m aster 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 eit her in the subfolder of the proj ect 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 Automation and Industrial Solutions
Page 19
ST-BWINCCS 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". Defi ne the time base as "1 second" and the ti me factor as 5. 3. Then select the "Process Value Archive". Then write the name of the new archive in the table colum n Archive name "Temperatures_Station1". In the properties of the new archiv e, check that "Hard disk" is selected as the storage location.
SITRAIN Training for Automation and Industrial Solutions
Page 20
ST-BWINCCS 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 Automation and Industrial Solutions
Page 21
ST-BWINCCS 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 Automation and Industrial Solutions
Page 22
ST-BWINCCS 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 axi s 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 Automation and Industrial Solutions
Page 23
ST-BWINCCS Tag Logging
Objective
The existing OnlineTrendControl has an additional window added for the out put 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 Automation and Industrial Solutions
Page 24
ST-BWINCCS Tag Logging
Exercise
1. Before you start W inCC 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 achiev ed with the left and right cursor keys. When is for example "29.0 i" shown in the Y v alue 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 lim it line and then click on "Calculat e statistics".
SITRAIN Training for Automation and Industrial Solutions
Page 25
ST-BWINCCS Tag Logging