+ All Categories
Home > Documents > 109477071 LongTermDataArchives en v10

109477071 LongTermDataArchives en v10

Date post: 07-Jul-2018
Category:
Upload: inslley-roberth
View: 217 times
Download: 0 times
Share this document with a friend

of 46

Transcript
  • 8/19/2019 109477071 LongTermDataArchives en v10

    1/46

     

    https://support.industry.siemens.com/cs/ww/de/view/109477071

    Application Example 08/2015 

    Long-Term Data Archiving on

    SIMATIC HMI Operator Panels

    with WinCC (TIA Portal)WinCC (TIA Portal) V13 SP1

    https://support.industry.siemens.com/cs/ww/de/view/109477071https://support.industry.siemens.com/cs/ww/de/view/109477071

  • 8/19/2019 109477071 LongTermDataArchives en v10

    2/46

    Warranty and Liability

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 2

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Warranty and Liability

    Note The application examples are not binding and do not claim to be complete withregard to configuration, equipment or any contingencies. The application

    examples do not represent customer-specific solutions. They are only intendedto provide support for typical applications. You are responsible for the correctoperation of the described products. These application examples do not relieveyou of the responsibility of safely and professionally using, installing, operatingand servicing equipment. When using these Application Examples, yourecognize that we cannot be made liable for any damage/claims beyond theliability clause described. We reserve the right to make changes to theseapplication examples at any time and without prior notice. If there are anydeviations between the recommendations provided in this Application Exampleand other Siemens publications – e.g. Catalogs – the contents of the otherdocuments shall have priority.

    We do not accept any liability for the information contained in this document.

     Any claims against us – based on whatever legal reason – resulting from the use ofthe examples, information, programs, engineering and performance data etc.,described in this Application Example shall be excluded. Such an exclusion shallnot apply in the case of mandatory liability, e.g. under the German Product Liability Act (“Produkthaftungsgesetz”), in case of intent, gross negligence, or injury of life,body or health, guarantee for the quality of a product, fraudulent concealment of adeficiency or breach of fundamental contractual obligations (“wesentlicheVertragspflichten”). The compensation for damages due to a breach of afundamental contractual obligation is, however, limited to the foreseeable damage,typical for the type of contract, except in the event of intent or gross negligence orinjury to life, body or health. The above provisions do not imply a change of theburden of proof to your detriment.

     Any form of duplication or distribution of these application examples or excerptshereof is prohibited without the expressed consent of Siemens AG.

    Securityinforma-

    tion

    Siemens provides products and solutions with industrial security functions thatsupport the secure operation of plants, solutions, machines, equipment and/ornetworks. They are important components in a holistic industrial securityconcept. With this in mind, Siemens’ products and solutions undergo continuousdevelopment. Siemens recommends strongly that you regularly check forproduct updates.

    For the secure operation of Siemens products and solutions, it is necessary totake suitable preventive action (e.g. cell protection concept) and integrate each

    component into a holistic, state-of-the-art industrial security concept. Third-partyproducts that may be in use should also be considered. For more informationabout industrial security, visit http://www.siemens.com/industrialsecurity. 

    To stay informed about product updates as they occur, sign up for a product-specific newsletter. For more information, visithttps://support.industry.siemens.com. 

    http://www.siemens.com/industrialsecurityhttp://www.siemens.com/industrialsecurityhttp://www.siemens.com/industrialsecurityhttps://support.industry.siemens.com/cs/?lc=en-DEhttps://support.industry.siemens.com/cs/?lc=en-DEhttps://support.industry.siemens.com/cs/?lc=en-DEhttp://www.siemens.com/industrialsecurity

  • 8/19/2019 109477071 LongTermDataArchives en v10

    3/46

    Table of Contents

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 3

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Table of ContentsWarranty and Liability ................................................................................................. 2 

    Task ..................................................................................................................... 4 

    Solution............................................................................................................... 5 

    2.1  Overview............................................................................................... 5 2.2  Hardware and software components ................................................... 6 2.2.1  Validity .................................................................................................. 6 2.2.2  Components used ................................................................................ 7 

    Mode of Operation ............................................................................................. 8 

    3.1  Principles of configuration .................................................................... 8 3.2  Overview............................................................................................... 9 

    Configuration and Sett ings............................................................................. 11 

    4.1  Tag archives ....................................................................................... 11 

    4.1.1 

    Names of the long-term archives ....................................................... 11 

    4.1.2 

    Creating tag archive ........................................................................... 12 

    4.1.3  Long-term tag archiving...................................................................... 15 4.2  Tags used ........................................................................................... 16 4.3  Text lists ............................................................................................. 17 4.4  Configured screens ............................................................................ 17 4.4.1  Screen 1 ............................................................................................. 19 4.4.2  Screen 2 ............................................................................................. 21 4.4.3  Screen 3 ............................................................................................. 26 4.5  Scripts................................................................................................. 27 4.5.1  Overview............................................................................................. 27 4.5.2  Short description ................................................................................ 27 4.5.3  “Copy_Archive” script ......................................................................... 28 

    4.5.4 

    “Load_Archive” script ......................................................................... 31 

    4.5.5  “Request_Load_Archive” script .......................................................... 36 4.5.6  “Create_Storage_Path” script ............................................................ 36 4.6  Other functions used .......................................................................... 37 

    5  Operat ing the App lication ............................................................................... 38 

    5.1  Configured plant screens ................................................................... 38 5.2  Error detection .................................................................................... 43 

    Links & Literature ............................................................................................ 46 

    History............................................................................................................... 46 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    4/46

    1 Task

    2.1 Overview

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 4

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    1 Task

    Long-term archiving of process variables

    Storing process tags in the form of data archives on internal drives or removablestorage media of HMI operator panels allows later evaluation of the processsequence at any time.

    However, the method is limited because system-related, data archives can onlyreach a certain size depending on the operator panel used. For example, a singlearchive can comprise a maximum of 20000 values for a TP1200 Comfort Panel. If10 process tags are to be acquired in intervals of one second, the first old valuesare already overwritten by new ones after 2000 seconds or approx. half an hour ina short-term archive. (Detailed specifications regarding the quantity structures ofthe individual SIMATIC operator panels can be found in \3\.)

    However, often large data quantities are supposed to be recorded over a longerperiod of time.

    Displaying the data archives via trend views

    The data archives are furthermore to be displayed on the operator panels foranalyzing and checking. However, a trend view that can be configured by defaulton the operator panels, only allows the display of one single data archive, meaningit is bound to the same quantity structures as that one and therefore can onlyreproduces a limited period of time.

    Trend views should also be able to reproduce the data archives whose extent isnot limited by the default quantity structures.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    5/46

    2 Solution

    2.1 Overview

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 5

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    2 Solution

    2.1 Overview

    Short description of the application

    In order to bypass the limitation of the maximum archive size (and therefore therecording time of the archives) two configurations, identical in function have beencreated for the WinCC PC Runtime and TP1200 Comfort Panel in the presentWinCC (TIA Portal) application. The scheduler cyclically calls a script that copiesthe existing data archive after the lapse of a certain amount of time and provides itwith a new name. Apar t from a user-defined root, this name also includes the timeof the current archive.

     After that the data archive is empty and it is rewritten until a further copy processtakes place after the lapse of an hour. This way, data archiving is only restricted bythe free space on the storage medium but no longer by the quantity structures of

    the operator panels.

    Note The archive names can be individual adjusted.

    Other scripts allow it to read out certain archive sections of data archives againfrom groups saved that way and to display them via a trend view. 

    Configured runtime screens

    Two screens each are included in the configurations:

    •  Screen 1 includes the trend view of the current values of a configured tag.

    •  An archive can be selected with selection fields via screen 2. In this case thearchive was read into the trend archive with the data “22.05.2015” and the time“10 o’clock” (see below).

    1 Details on the composition of the archive name can be found in chap. 4.1.1 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    6/46

    2 Solution

    2.2 Hardware and software components

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 6

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Figure 2-1

     A precise function description and configuration instruction will follow in the nextchapters.

     Advantages

    This application example on hand has the following advantages:

    •  The effective size of data archives is only limited by the available space on thestorage medium,

    •  no additional hardware or software expense required,

    •  easy adaptation to own requirements,

    •  no significant burden on computing performance or band width.

    2.2 Hardware and software components

    2.2.1 Validity

    This application is valid for

    •  WinCC (TIA Portal) Advanced V13 SP1 and above,

    •  All operator panels that support archive and script functions. An overview of the functions of the different operator panels can be found in\3\.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    7/46

    2 Solution

    2.2 Hardware and software components

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 7

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Note Please note that the VBS syntax (script commands) of an operator panel differsfrom that of the PC Runtime system. This is why the scripts stored in the TP1200Comfort project cannot be used in the RT simulation and vis-a-versa.

    2.2.2 Components used

    This application was created with the following components:

    Hardware components

    Table 2-1

    Component Qty Article number Note

    SIMATIC HMITP1200 Comfort

    1 6AV2124-0MC01-0AX0

    Software components

    Table 2-2

    Component Qty Article number Note

    WinCC (TIA Portal) Advanced

    1 6AV2102-0AA03-0AA5 V13 SP1 or higher

    SIMATIC WinCCLogging for Runtime Advanced, option f.WinCC (TIA Portal)

    1 6AV2107-0GA00-0BH0  Or comparable

    Example files and pro jects

    The following list includes all files and projects that are used in this example.

    Table 2-3

    Component Note

    109477071_LongTermDataArchives_Project_PC_Runtime.zip

    Zipped WinCC (TIA Portal) project for PCRuntime

    109477071_LongTermDataArchives_

    Project_TP1200_Comfort.zip

    Zipped WinCC (TIA Portal) project for

    TP1200 Comfort Panel109477071_LongTermDataArchives_en_v10.pdf

    This document.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    8/46

    3 Mode of Operation

    3.1 Principles of configuration

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 8

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    3 Mode of Operation

    3.1 Principles of configuration

    Long-term archiving of process values

    In order to be able save more process values then specified in the quantitystructures, the configuration copies the current archive each time into a new fileafter a fixed period (in this case: one hour).

    The date and the time are encrypted in the name and in the storage path of thenew file. (See “Copy_Archive” script) After the lapse of the copy process theoriginal archive can therefore be rewritten again.

    The duration of the possible long-term archiving is therefore only limited by theavailable storage space.

    Displaying archived process values in a trend viewTrend views are intended for the display of data archives, however, the archivename cannot be configured. The archive name has to be fixed in the configuration.

    In order to display the values of long-term archives which are actually saved in anumber of different files, the following procedure is required:

     At first the trend view is configured with a constant file name. The “real” archivename is then reconstructed from the user inputs at runtime. This archive is thencopied into the file that was configured in the trend view. (See “Load_Archive”script) 

    The user can select the time and date of the period desired to be displayed via theruntime screens.

    Locking the archive files

    Runtime itself cannot copy the files. Instead, an according process of the operatingsystem has to be triggered from the runtime script.

    However, due to operating system conditions, it is always only one process thatcan access a certain file at any time. This means that it is not possible tosimultaneously log to a file while it is copied. Instead, a certain sequence of theprocedure has to be adhered to:

    1. Interrupt logging, buffer arriving values to be archived

    2. Start copying file

    3. Wait until the copy process is completed

    4. Write buffer into archive5. Resume logging

    Each of these steps requires a period of time that is not precisely defined and therespective subsequent step may only start when the previous one has beencompleted. To guarantee this, it is required to lock the individual operations againsteach other.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    9/46

    3 Mode of Operation

    3.2 Overview

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 9

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    For the trend view of the long-term archived values this is done by using two tagarchives:

    •  “Archive_01” for the current archiving of the “TEST_Var_01” process tag

      “Data_Logs_Trend_View” for displaying the long-term archived values in thetrend view

    “Data_Logs_Trend_View” has been configured in a way that a subsequent“Data_Logs_Trend_View1” archive is already created from the second archiveentry onward. From this time on, runtime does no  longer access“Data_Logs_Trend_View” but “Data_Logs_Trend_View1”, and“Data_Logs_Trend_View” can be overwritten on operating system level by the copyprocess.

    In this application example the data from “Archive_01” is copied into the“Data_Logs_Trend_View” archive for the trend view.

    3.2 Overview

    The following figure provides an overview of the individual “functional sequences”.Details on the configuration can be found in chapter  Configuration and Settings 

    Figure 3-1

    Runtime Start "Archive_01" is started

    "TEST_Var_01" tag is archived every second in

    "Archive_01"

    "Load_Archive" script is

    started

    "Archive_01" archive  "TEST_Var_01"

    tag

    "Data_Logs_Trend_View" archive  "TempTag_Data_Logs_Trend_View„

    tag

    "Data_Logs_Trend_View" archive is started

    "Load Archive"

    button

    is pressed

    "TempTag_Data_Logs_Trend_View" tag is

    archived every second in the

    "Data_Logs_Trend_View" archive

    Number of entries > 1 => subsequent archive iscreated

     Archiving of "Data_Logs_Trend_View" archive is

    stopped

    Data of the selected archive is copied in the

    "Data_Logs_Trend_View" archive

    Data of "Archiv_01" is copied in a new archive.New name: machine + time

    Hour 

    lapsed

    „Copy_Archive“script is started

     

    Long-term archiving of process values, “ red marking”

    •  The “TEST_Var_01” is assigned to “Archiv_01”.

    •  “Archiv_01” is started with the start of runtime. The values of the

    “TEST_Var_01” tag are archived every second in this archive.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    10/46

    3 Mode of Operation

    3.2 Overview

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 10

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    •  The content of “Archiv_01” is copied every hour into a new archive via the“Copy_Archive” script. The name of the new archive is made up of “Name ofthe machine + time”. The date of the archive is encrypted in the storage path.

    Displaying the long-term archived values, “g reen marking”

    •  The “TempTag_Data_Logs_Trend_View” tag is assigned to the“Data_Logs_Trend_View” archive that is used for the output of values in thetrend view.

    •  The “Data_Logs_Trend_View” archive is not yet started.

    •  By pressing the “Load Archive” button the “Load_Archive” script is started. Thisis to be copied into the “Data_Logs_Trend_View” archive by the user-selectedarchive for the trend view.

    •  The “Data_Logs_Trend_View” archive is now started via the “Load_Archive”script.

    –  The “TempTag_Data_Logs_Trend_View” tag  is configured in a way so that

    it is archived every second into the “Data_Logs_Trend_View” archive.The archive is configured in a way so that a subsequent archive is createdas soon as the archive size exceeds one entry.This means that the subsequent “Data_Logs_Trend_View1” archive isalready created as soon as archiving starts and the first archive entry ismade. Then archiving is stopped again.

    –  As an effect runtime no  longer accesses the “Data_Logs_Trend_View”archive and the selected long-term archive can be copied into the“Data_Logs_Trend_View” archive. Its content is output via the trend view.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    11/46

    4 Configuration and Settings

    4.1 Tag archives

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 11

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4 Configuration and SettingsThis chapter includes the main configuration steps in order to create the used …

    •  Archives,

    •  Tags,

    •  Text lists,

    •  Screens,

    •  Scripts.

    Details can be found in the attached project.

    Notes •  The configuration steps described below are valid for working with PC Runtime.Operator panels have to configured slightly different in some sections. If required, thisis also explained in the respective steps.

    •  In the enclosed configuration all described settings have already been made.

    •  If there are no specifications for a configuration parameter, the default specificationsare accepted.

    4.1 Tag archives

    4.1.1 Names of the long-term archives

    Every hour a new file for the long-term archiving of process tags is created. In thisexample the name assignment of the archives is “dynamic”, this means the nameis only created at runtime.

    The archive name is made up of:

     Archive name + time

    For a better overview, the archives are stored in a folder structure that reflects therespective storage date:

    Storage location \ Year_ \ Month_ \ Day_ \ archive name + time.csv

    Remark:

    The system always automatically adds a “0” (zero) at the end of the archive name.

    Example1: Press_01_70.csv 

    The archive contains the data from 7 o’clock.

    The screen below shows the view of the newly created archives on an example.The values are from the PC runtime.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    12/46

    4 Configuration and Settings

    4.1 Tag archives

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 12

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Figure 4-1

    Storage pathC:\Storage_Data\Year_2015\Month_5\Day_22

     Archive entries Archive name + time

     

    4.1.2 Creating tag archive

    Below, two tag archives are created. Please particularly note the properties of the“Data_Logs_Trend_View” data log.

    Table 4-1

    No. Description Screens

    1. Creating tag archive 

    First of all create two new archives.

    •  “Archive_01”: Long-term archiving of process values

    •  “Data_Logs_Trend_View”: For the output of the archived values in a trend view.

    Double click “Data logs” in the “Historical data” group in the project window in order to open theeditor.

    Note The name of the archives is used in the scripts among other uses. If you are changing the name

    of the archive here, update the changes in the scripts (see "Copy Archive” script).

  • 8/19/2019 109477071 LongTermDataArchives en v10

    13/46

    4 Configuration and Settings

    4.1 Tag archives

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 13

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    2.  Ass igning propert ies for the“ Archive_01” archive 

    Open the properties of the “ Archive_01”archive.

    •  “ General” section 

    –  “Data records per archive” entryIn this application a value isarchived every second over aperiod of approx. one hour.Specify a min. of 4500 values.

    –  “Storage location” entryUse the drop-down box to selectthe“File - CSV (ASCII)” storage

    location.Specify a path, in this case“C:\Storage_Data” or

    “\Storage Card MMC\”

    •  “ Logging method” section Select “Circular log”.

    •  “ Restart behavior” section Here you can select the options“Enable logging at runtime start” and“Append data to existing log”.

    Thus the settings for the first archive arecompleted.

    General:

    Properties – Logging method:

    Properties – Restart behavior:

  • 8/19/2019 109477071 LongTermDataArchives en v10

    14/46

    4 Configuration and Settings

    4.1 Tag archives

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 14

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    3. Specifying p roperties for the“ Data_Logs_Trend_View” archive 

    Open the properties of the“Data_Logs_Trend_View” archive

    •  “ General” section

    –  “Data records per archive” entrySpecify a number of “1”.

    –  Storage locationUse the drop-down box to selectthe “File - CSV (ASCII)” storagelocation.Specify a path. In this case“C:\Storage_Data” or

    “\Storage Card MMC\”

    •  “ Logging method” section Here, select the “Segmented circularlog” option and specify “1” for the“number” of segments.

    •  “ Restart behavior” section Here, select the “Append data toexisting log” option.

    Thus the settings for the second archiveare completed.

    General:

    Properties – Logging method:

    Properties – Restart behavior

  • 8/19/2019 109477071 LongTermDataArchives en v10

    15/46

    4 Configuration and Settings

    4.1 Tag archives

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 15

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.1.3 Long-term tag archiving

    In the configuration the “TEST_Var_01” tag is archived every second into the

    “Archive_01” archive.The second “TempTag_Data_Logs_Trend_View” tag is used to create asubsequent archive from the “Data_Logs_Trend_View” archive.

    Specifying the archiving properties

    Table 4-2

    No. Description Screens

    1. “ TEST_Var_01” tag

    Open the “Logging tags” tabular area ofthe “Archive_01” data logs.

    Specify via the “Add new” entry that the

    “TEST_Var_01” tag is to be logged intothis archive.

    Specify the following parameters via thedrop-down lists or via the “Properties” ->“General” -> “Logging type” areanavigation:

    •  Acquisition mode: “Cyclic” (1)

    •  Logging cycle: “1s” (2)

    2. Tag “ TempTag_Data_Logs_Trend_View”

    Repeat step 1 in the “Data_Logs_Trend”archive for the“TempTag_Data_Logs_Trend_View” tag

    12

  • 8/19/2019 109477071 LongTermDataArchives en v10

    16/46

    4 Configuration and Settings

    4.2 Tags used

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 16

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.2 Tags used

     Apart from the tags for archiving, other tags are also used in the configuration.

    Below, only those tags are listed where supplementary properties configured.Table 4-3

    No. Description Screens

    3. Overview

    In “Screen 2” a date can be specified viatext lists.

    The tags listed below are assigned with astart value.

    •  Selection_Day

    •  Selection_Hour

      Selection_Month•  Selection_Year

    On the example of the “Selection_Day”the following setting is shown.

    Note:You can adjust the default setting to yourwishes or omit it.

    4.  Adjust ing the start values for the“ Selection_Day” tag 

    Open the properties of the

    “Selection_Day” tag.

    •  Properties  

    –  “Values” entrySpecify a value in the “Start value”input field.In this case “15”.

     At the first “Runtime Start” the value ofthe tags is preassigned with “15”.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    17/46

    4 Configuration and Settings

    4.3 Text lists

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 17

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.3 Text lis ts

     A date for accessing the archive data can be specified via text lists. The date

    specified here is processed further in the scripts.Table 4-4

    No. Description Screens

    1. Overview

    Four text lists are used in the enclosedconfiguration.

    •  Text_List_Day

    •  Text_List_Hour

    •  Text_List_Month

    •  Text_List_Year

    Below, the setting is shown on theexample of the “Text_List_Day” text list.

    Note You can adjust the text lists to yourwishes.

    2. Creating text l ists 

    Open the “Text and Graphics lists” editor. Add a new text list by double-clicking thefirst empty row in the editor.

    •  General 

    –  “Settings” entryEnter a name for the text list in the“Name” column. In this case“Text_List_Day”.Click the “Selection” column.Select “Value/Range...” via thedrop-down list.

    The respective values can now bespecified below the list entries. In thiscase 31 entries can be made – for eachday one.

    The configuration of other text lists is thesame.

    4.4 Configured screens

    In the configuration included three screens have been created:

    •  Screen 1 is used for the display of current values of the process values that areto be saved long-term (“TEST_Var_01”),

    •  Screen 2 is used for the trend view of the long-term archived process values,

    •  Screen 3 is used to avoid access conflicts during the loading of screen 2.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    18/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 18

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    The functions configured in the screens are described below.

    Permanent window

    Table 4-5

    No. Description Screens

    1. Permanent window 

    Four buttons are configured in thepermanent window.

    Via these button you can …

    •  access individual screens directly.

    •  changes the language of the userinterface (English/German).

    •  terminate Runtime.

     An animation is configured on the“Screen 1” and “Screen 2” buttons.

    When the respective screen is loaded,the background color of the button isdisplayed in green.The tag is set when the screen is loadedand is reset when the screen is cleared(see Table 4-6). 

    Permanent window:

     Animation – Appearance:

  • 8/19/2019 109477071 LongTermDataArchives en v10

    19/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 19

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.4.1 Screen 1

    Table 4-6

    No. Description Screens

    1. “ Screen 1” – Screen properties 

    Open the properties of“Screen 1”.

    •  “ Events” tab

    –  Entry loaded/cleared“SetBit”The background color of the“Screen 1” button is changedthrough an animation. Whenloading the screen, the bit of the“Screen_1_Activ” tag is set andwhen clearing the screen it is

    reset (see Description ofpermanent window).

    “SimulateTag”The values for the “TEST_Var_01”tag are created via the“SimulateTag” function.

    2. “ Screen 1” – tag output 

    The current value of the “TEST_Var_01”tag is output via an I/O field in the screen.

    The value of the tags is archived in“Archiv_01” and output via the trend view.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    20/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 20

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    3. “ Screen 1” - trend view

    In “Screen 1” a trend view is configured.The archived entries of the“TEST_Var_01” tag are output via thetrend view.

    In order to output the values from anarchive, proceed as follows.

    Open the properties of the trend view.

    •  "Properties" tab 

    –  “Trend” entry"Trend type”: 

    Here, select the “Data log” typevia the drop-down list.Select “Archiv_01” in the data logand the “TEST_Var_01” tag forthe process value for the “Sourcesettings”.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    21/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 21

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.4.2 Screen 2

    Table 4-7

    No. Description Screens

    1. “ Screen 2” – Screen properties 

    Open the “Events” in the “Properties” of“Screen 2”.

    •  “ Loaded” entry: “SetBit”;“ Cleared” entry: “ResetBit”  

    –  The background color of the“Screen 2” button is changedthrough an animation. Whenloading the screen, the bit of the“Screen_2_Activ” tag is set and

    when clearing the screen it isreset (see Description ofpermanent window).

    •  “ SimulateTag”  

    –  The values for the “TEST_Var_01”tag are created via the“SimulateTag” function.

    Events - Loaded/Cleared:

    2. “ Screen 2” – Visibility of warningmessage and trend view 

     Always only the trend view is to bedisplayed or  the warning messageindicating that no long-term archive could

    be found for the selected date. This iscontrolled via the “Visibility” animation ofthe two screen objects:

    •  Warning message

    –  Open the dialog for the screenobject of the warning message in“Properties”, “Animations”.

    –  Combine the parameters in“Visibility” as follows:“Tag”: “TrendView_Visible”“Range From”: “1”“Range To”: “1”“Visibility”: “Visible”

    •  "OK" button

    –  Repeat the steps for the warningmessage.

    •  Trend view

    –  Repeat the steps for the warningmessage, however, set the valuefor “Range From” and “Range To”to “0” respectively.

    Warning message:

    Trend view:

  • 8/19/2019 109477071 LongTermDataArchives en v10

    22/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 22

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    3. “ Screen 2” - symbolic I/O fields 

    In “Screen 2” four symbolic I/O fieldshave been configured with which the usercan specify the date and the time of thelong-term archive to be loaded anddisplayed via the trend view.The configuration is explained on theexample of the symbolic I/O field for theyear.

    Open the properties of the symbolic I/Ofield.

    •  “ General” tab 

    –  “Process” entry.Select the appropriate tag, in thiscase “Selection_Year”. The tag isprocessed in a script.“Contents” entrySelect the appropriate text list viathe drop-down list, in this case“Text_List_Year”.

    •  “ Animations” tab 

    –  “Control enable” entryThe symbolic I/O field can only beoperated when the manuallycreated message is not displayed.(The message is triggered via ascript).For this, enable the “Enabled”option and specify an appropriatetag, in this case“TrendView_Visible”.

    General:

     Animation – Control enable:

    4. “ Screen 2” - time output  

    There is a “Date time field” inscreen 2.

    The system time of the operator panel isoutput. 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    23/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 23

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    5. “ Screen 2” – “Load Archive” button 

    The “Load Archive” button accesses ascreen from which in turn the“Request_Load_Archive” script can beaccessed.

    The reason for this procedure isdescribed in the documentation of thescript.

    Open the properties of the button.

    •  “ Events” tab 

    –  “Press” entry.“Screen_3” is accessed via the“EnableScreen” function.

    •  “ Animations” tab 

    –  “Control enable” entryThe button can only be operatedwhen the manually createdmessage is not displayed. (Themessage is triggered via a script).For this, enable the “Enabled”option and specify an appropriatetag, in this case“TrendView_Visible”.

    Events – Press:

     Animation – Control enable:

    6. “ Screen 2” - message 

    In “Screen 2” a message is configured.The message is triggered via a script.

    Open the properties of the text field.

    •  “ Animations” tab 

    –  “Visibility” entryThe text field is only displayedwhen the trend view is hidden.For this, enable the “Enabled”option and specify an appropriatetag, in this case“TrendView_Visible”. 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    24/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 24

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    7. “ Screen 2” - “ OK” button 

    In “Screen 2” a message is configured.The message is acknowledged via the"OK" button.

    Open the properties of the text field.

    •  “ Events” tab 

    –  “Press” entry.The “ResetBit” functionsuccessfully resets the“TrendView_Visible” tag.

    •  “ Animations” tab 

    –  “Visibility” entry

    The button is only displayed whenthe trend view is hidden.For this, enable the “Enabled”option and specify an appropriatetag, in this case“TrendView_Visible”.

    Note Instead of the manually generatedmessage, a system message can also beconfigured in the “Load_Archive” script. 

    Properties – button:

     Animations – Visibility:

  • 8/19/2019 109477071 LongTermDataArchives en v10

    25/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 25

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    8. “ Screen 2” - trend view

    In “Screen 2” a trend view is configured.The long-term archived entries of the“TEST_Var_01” tag are output via thetrend view.

    Unlike “Screen 1”, the existing archiveshere are copied via script in“Data_Logs_Trend_View” archive andoutput via the trend view.

    To do this, proceed as follows:

    Open the properties of the trend view.

    •  "Properties" tab 

    –  “Trends”, "Trend type” entry:Here, select the “Data log” typevia the drop-down list.“Source settings”:Select “Data_Logs_Trend_View”in the data log and the“TEST_Var_01” tag for theprocess values.

    –  “Time axis” entryIn this example a tag is used forthe “External time”, in this case“TrendView_ExternalTime”. This is

    the time stamp of the long-termarchive that is to be displayed.The time for the tag is made up inthe "Load_Archive” script. 

    •  “ Animations” tab 

    –  “Display”, “Visibility” entryThe trend view is only visiblewhen the manually createdmessage is not displayed. (Themessage is triggered via a script).To do this, enable the “Visible”option in “Visibility” and specify anappropriate tag, in this case“TrendView_Visible”.

    Properties - Trends:

    Properties - Time axis:

     Animations – Visibility:

  • 8/19/2019 109477071 LongTermDataArchives en v10

    26/46

    4 Configuration and Settings

    4.4 Configured screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 26

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.4.3 Screen 3

    Table 4-8

    No. Description Screens

    1. “ Screen 3” - screen properties 

    “Screen 3” is used to access a script andto display a message.

    The reason for this procedure isdescribed in the description of the

    Request_Load_Archive script.

    Open the properties of “Screen 3”.

    •  “ Events” tab 

    –  Loaded entry

    “SimulateTag”The values for the “TEST_Var_01”tag are created via the“SimulateTag” function.Call “Script”  The “Request_Load_Archive”script is executed with the loadingof the page.

    2. “ “ Screen 3” - message 

    Executing the “Request_Load_Archive”script requires a certain amount of time.The message informs the user about the

    delay. At the end of the script processing theconfiguration automatically goes back to“Screen 2”.

    Note If script processing fails and “Screen 2” isnot automatically accessed, there is theoption to manually access “Screen 2” viathe “-- Screen 2 --” button.(This is recommended in theconfiguration phase or when the pagecannot be accessed via the permanentwindow.)

  • 8/19/2019 109477071 LongTermDataArchives en v10

    27/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 27

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.5 Scripts

    4.5.1 Overview

    In this chapter you will receive information on the following scripts.

    •  Copy_Archive

    •  Load_Archive

    •  Request_Load_Archive

    •  Create_Storage_Path

    Note In the main, the structure of scripts for the TP1200 Comfort Panel and the PCRuntime are the same. Please note that the VBS syntax between an operatorpanel and a PC Runtime system are different.

    You cannot use the TP1200 Comfort Panel project on a PC in runtimesimulation.

    4.5.2 Short description

    Copy_Archive

    The script copies the “Archive_01” archive (see Creating tag archive) and providesthe archive thus generated with a new name. The name is created at runtime andis made up of:

    Ar chi ve name + t i me

    The storage location for the new archive is transferred to the script as parameterand can therefore be quickly adjusted.

    The script is accessed hourly via the scheduler.

    In the chapters below you will find notes regarding the script configuration.

    Load_Archive

    The user specifies the data and time of the archive to be loaded via “Screen 2”.The script evaluates this specification and copies the selected archive into thearchive for the trend view.

    The storage location of the archive files is transferred to the script as parameter.

    The script is accessed from the “Request_Load_Archive” script.

    Request_Load_Archive

    The “Load_Archive” script is called from the “Request_Load_Archive” script.

     Accessing the “Request_Load_Archive” is carried out when “Screen 3” is loading.

    “Load_Archive” loads an existing archive into the trend view. If the “Load_Archive”script is carried out whilst “Screen 2” is active with the trend view, there may beaccess errors (simultaneous write and read access to the trend view). In order toprevent this, the “Request_Load_Archive” script is executed via “Screen 3”.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    28/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 28

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Create_Storage_Path

    The script checks whether a default directory is available.If the default directory is not available, the script automatically creates the missingfolder.

    The script is accessed from the “Copy_Archive” script.

    4.5.3 “ Copy_Archive” script

    Detailed description

    Table 4-9

    No. Description Screens

    1. Script, row 7

    In row 7 the name of the archive isspecified that is to be copied in the furthercourse, in this case “Archive_01”.

    Note The name has to match the name of the

    archive you used for  Creating the tagarchive .

    2. Script, row 12 to 17

    The name of the new archive includes,among others, the current date and time.

    The copy process is executed via the

    scheduler always at the full hour.For the name of the archive it isnecessary to generate the hour value ofthe “previous” hour.

    This is implemented in rows 12 to 17.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    29/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 29

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    3. Script, row 22

    In row 22 the new name of the storage path is generated.

    The storage path is made up of storage location and a path in which the storage date is encrypted.

    Storage location \ Year \ Month \ Day

    The values of the tags are from rows 14 to 17.

    The storage location can be adapted as desired.

    In row 22 the “StoragePath” parameter is used. When accessing the script the storage location isspecified via this parameter, in this case: “\Storage Card MMC\” or “C:\Storage_Card\”.

     Alternatively, you can specify a fixed storage path in row 22.

    Notes 

    The “StoragePath” parameter has to match the storage location that was specified in theProperties of the “Archive_01” archive. 

    Please note the spelling and the characters used such as, for example, a “\”. Otherwise

    misinterpretations may take place.

    4. Script, row 27

    In row 27 the “Create_Storage_Path”script is accessed.

    If the specified storage path includesseveral sub folder and they are not yetavailable on the operator panel, the scriptwill generate the required folders.

    The storage path is transferred to thescript as parameter.In this example the name of the storagepath is written in the“Name_StoragePath” tag. 

    5. Script, row 32

    In row 32 the new file name is generated.

    The name is made up of “archive name +time”.

    The “archive name” is fixed here with“Press_01”.The time is evaluated at runtime andpassed on the “Variable_Hour” tag.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    30/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 30

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    6. Script, row 37

    Data access is via row 37.

    Please note the command syntax of theoperator panel used.

    Syntax PC Runtime

    Syntax operator panel (TP1200 Comfort Panel)

    7. Script, row 42

    The archive is copied in row 42.

    The required contents have already been assigned to the tags so that you do not need to makeany changes here.

    Please note the command syntax of the operator panel used.

    Syntax PC Runtime

    Syntax operator panel (TP1200 Comfort Panel)

    Note The “StoragePath” parameter is transferred to the script when accessing it. It includes the storagepath of the archive.

    8. Script, row 47

    The storage used is freed again in row47. 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    31/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 31

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.5.4 “Load_Archive” script 

    Table 4-10

    No. Description Screens

    1. Script, row 8 to 16

    The date for the archive to be loaded is specified via “Screen 2” These values are first transferredto internal tags in rows 8 to 11.

    In row 16 the storage path of the archive is made up of the specified period of time.

    Note The “StoragePath” parameter is transferred to the script when accessing it. It includes the storagepath of the archive.

    2. Script, row 21

    In row 21 the name of the archive to beaccessed is made up of the “root archivename” and the time.

    The “root archive name” is fixed here with“Press_01”.The time is specified via “Screen 2”(symbolic I/O fields).

    3. Script, row 26

    Data access is via row 26.

    Please note the command syntax of theoperator panel used.

    Syntax PC Runtime

    Syntax operator panel (TP1200 Comfort Panel)

    4. Script, row 31

    Via row 31 it is checked whether the

    specified archive name is available.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    32/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 32

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    5. Script, row 34 to 43

    In row 34 to 43 it is evaluated whether theselected archive is available.

    If the selected archive is not available, abit is set via row 41 and a manuallycreated system message appears (see

    Message Description). The trend viewis hidden.

    Please note the command syntax of theoperator panel used.

    Syntax PC Runtime

    Syntax operator panel (TP1200 Comfort Panel)

  • 8/19/2019 109477071 LongTermDataArchives en v10

    33/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 33

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    6. Script, row 47 to 74

    For the function of the script, please also observe the notes on the configuration of the“Data_Logs_Trend_View” archive.

    •  Row 47 The “Data_Logs_Trend_View” archive is started in row 46.Note the configuration of the archive.The archive is a “Segmented circular log” and is not automatically started at the start of

    runtime.For a data record number > 1 a subsequent archive is automatically created via runtime withthe name “Data_Logs_Trend_View1”.

    •  Row 52 to 54 Script processing is interrupted until the “Data_Logs_Trend_View1” archive is created.

    •  Row 58 If the “Data_Logs_Trend_View1” archive is available, the content of the long-term archive iscopied into the “Temp_Data_Logs_Trend_View” archive.

    •  Row 63 to 65 Script processing is interrupted until the copy process is completed.

    •  Row 69 The archiving of the “Data_Logs_Trend_View” archive is stopped.

    •  Row 74 

     All archives are closed.

    This process prevents access conflicts on the “Data_Logs_Trend_View” archive.

    Please note the command syntax of the operator panel used.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    34/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 34

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    7. Script, row 81 to 103

    •  Row 81 to 85 The previously described functions require a certain amount of time. In order to preventaccess conflicts, a waiting period is configured.

    •  Row 92 to 94 Once all archives are closed, the previous temporarily created archives are deleted.

    •  Row 99 to 103 In order to prevent access conflicts, a waiting period is configured.

    Note The configured waiting period is too short if there any messages regarding access errors duringthe processing of the script. In this case increase the upper limit of the “While” loop.

    8. Script, row 108 

    Copy of the selected archive into the archive for the trend view.

    Please note the command syntax of the operator panel used.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    35/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 35

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    9. Script, row 113 to 118 

     After the copy process all archives arereopened and the “Archive_01” archive isrestarted.

    Notes

    •  The values for “Archive_01” aresaved internally between“CloseAllLogs” and “StartLogging”via the operator panel and aretherefore not lost.

    •  If you are using other archives, theyalso need to be restarted via the“StartLogging” system function.

    10. Script, row 123 to 127 

    In the trend view in “Screen 2” an “External time" is specified for the x axis, this is the time stampof the long-term archive to be displayed. Its value is made up of rows 123 to 127.

    Background The trend view shows values over a period of one hour. If a long-term archive is accessed, thetime axis (X axis) of the trend view is adjusted to its time stamp.

    It is not necessary to “scroll” or enter the time axis manually.

    11. Script, row 132

    The storage used is freed.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    36/46

    4 Configuration and Settings

    4.5 Scripts

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 36

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.5.5 “ Request_Load_Archive” script 

    Table 4-11

    No. Description Screens

    1. Script, row 15 to 29

    In row 14 the “Load_Archive” script isaccessed.Enter the storage location as parameter,in this case: “C:\Storage_Data\”.

    •  Row 20 to 24 The previously described functionsrequire a certain amount of time. Inorder to prevent access conflicts, awaiting period is configured.

      Row 29  After the configured waiting period,“Screen 2” is accessed again withthe trend view.

    Note  Also observe the note for  Configuringscreen 3. 

    4.5.6 “ Create_Storage_Path” script 

    Table 4-12

    No. Description Screen

    1. Script, row 15 Data access is via row 14.

    Please note the command syntax of theoperator panel used.

    Script, row 20 to 42 The specified storage location istransferred with the “StoragePath” (row25) parameter.Based on the “\ ” separator the scriptdetects the individual folders and thencreates them independently.

    Row 47 The storage used is freed again in row47.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    37/46

    4 Configuration and Settings

    4.6 Other functions used

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 37

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    4.6 Other functions used

    The scheduler is used for the hourly execution of the “Copy_Archive” script.

    Table 4-13

    No. Description Screen

    1. Scheduler

     Access the scheduler in the project tree.

    Create new tasks

    •  Double click the first free row of thetask table. A new “Task” is created.

    Open the “Properties” tab in the areanavigation. Make the following settings:

    •  “Task”, “Name”: Job_1•  “Starting time”, “Trigger”: 1 hour

    •  “at minute” 00=> The task is carried out every hourat minute 0.

    Go to the “Events” tab.

    •  Select the “Copy_Archive” script inthe “VB functions” column in “Addfunction”.

    •  Transfer the desired storage locationof the archives to the script as“StoragePath” parameter, e.g.“C:\Storage_Data\”

  • 8/19/2019 109477071 LongTermDataArchives en v10

    38/46

    5 Operating the Application

    5.1 Configured plant screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 38

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    5 Operating the Appl icationThis chapter explains the operation of the application.

    Prerequisite

    •  PC station

     Access to drive “C: \ ” for the archives.

    •  TP1200 Comfort PanelMMC or SD memory card for the archives.

    Note If you require a different storage location, adjust the storage location accordinglyin the configuration.

    5.1 Configured plant screensThe operation of the screens is described below on the example of WinCC (TIAPortal) runtime. The operation for the TP1200 Comfort Panel is the same.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    39/46

    5 Operating the Application

    5.1 Configured plant screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 39

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Table 5-1

    No. Description Screens

    1. Screen 1 

    “Screen” 1 is used to display the current values of the short-term “Archiv_01” archive.The current value of the “TEST_Var_01” tag is output via an I/O field and can also be changedmanually here.

    The buttons have the following functions:

    •  “Screen 2”: goes to “Screen 2” (display of “long-term archived values”)

    •  “German”/”English”: Changes the interface language of runtime

    •  “RT Stop”: Exits Runtime

  • 8/19/2019 109477071 LongTermDataArchives en v10

    40/46

    5 Operating the Application

    5.1 Configured plant screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 40

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    2. Screen 2

    In “Screen 2” the long-term archives are accessed and displayed via the trend view.

    Select the desired date and time via the respective “drop-down window”.

    •  Year

    •  Month

    •  Day

    •  Hour

    In this example the archive was accessed from 22.5.2015 and 10:00 o’clock.(The values correspond to a period from 10:00 o’clock to 11:00 o’clock.)

    Once you have set the desired date, click the “Load Archive” button. The archive is loaded.

    Navigate through the archive by means of the buttons of the trend view.

  • 8/19/2019 109477071 LongTermDataArchives en v10

    41/46

    5 Operating the Application

    5.1 Configured plant screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 41

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    3. Screen 2: Message

    If you click the “Load Archive” button and the above message appears, there is no archive filefor the set date. Check your settings if this is case.

    To confirm the message, click the “OK” button.

    Note  As long as the message is active, the other operating elements are blocked. 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    42/46

    5 Operating the Application

    5.1 Configured plant screens

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 42

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    No. Description Screens

    4. Screen 3 (cannot be accessed directl y) 

    If the “Load Archive” button is clicked, “Screen 3” is accessed.

    The “Request_Load_Archive” script is accessed via “screen 3”, this starts the “Load_Archive”script that loads the selected archive in the trend view before it is automatically returned to“screen 2”.

    Note If it is not possible to automatically return due to an error during the script processing, you canforce the return to “screen 2” via the “Screen 2” button.

    Please observe the Note on the configuration of the “Request_Load_Archive” script. 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    43/46

    5 Operating the Application

    5.2 Error detection

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 43

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    5.2 Error detection

    Below is a list of some possible error causes.

    Data is not archived on the memory card or there are access errors in the program

    sequence 

    Make sure that the storage location of the data archives (USB, SD card, MMC cardetc.) is consistently configured. Three storage paths specified in the configurationhave to match:

    •  The “Path” parameter of the “Archive_01” archive,

    •  The “StoragePath” parameter when accessing the “Copy_Archive” script in“Job_1” of the scheduler, and

    •  the parameter with which “Load_Archive” is accessed from the“Request_Load_Archive” script (row 15).

    If you are archiving the data via a network, check the network connection.

    Please also note the FAQ entries \4\ (Network Connection) and \5\ (Availability ofremovable storage media).

    No archive data can be accessed  

    Compare the configured archive name with the name to be accessed. The namesare generated at runtime via scripts.

    Check e.g. the storage location in the “Copy_Archive” script, step no.6. Have the name out that is generated via the script through an additional configuredsystem message.

    There will be access errors du ring the processing of the scripts Access errors occur when several processes try to access the same file. In order toprevent this, waiting loops are configured in the scripts that may possibly be tooshort – depending on the operator panel type used and the working speed of theoperator panels (see "Load_Archive” script).

    Gradually increase the number of loop cycles.

    The debugger script is accessed during script processing

    This is a runtime error in one of the scripts. Check the commands used in thescripts.

    Please note that the VBS syntax between an operator panel and a PC Runtimesystem differs.

    The present TP1200 Comfort Panel configuration cannot be tested in PC Runtime.

    The configured archives behave differently than described in the documentation.

    Check the configuration of the archives in detail. For this purpose, see chapter4.1.1. 

  • 8/19/2019 109477071 LongTermDataArchives en v10

    44/46

    5 Operating the Application

    5.2 Error detection

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 44

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    “ Screen 1” view

    In the trend view of “Screen 1” there are areas where no values are displayed. 

    Figure 5-1

    In “Screen 1” the values of “Archiv_01” are output via a trend view. Within this trendview gaps (1) can be detected where no values (2) are output.

    Background Long-term archive files are read in via “Screen 2” During this procedure all  archives have to be briefly closed and are then automatically reopened, also“Archiv_01”

    The closing of an archive is also logged in the archive by runtime with the“$RT_DIS$” entry. (see Figure 5-2) This message cannot be output via the trend

    view and it is shown highlighted instead as displayed in Figure 5-1. 

    Note During the time that the archive is shut, the values arising are not lost. Instead thesystem buffers the process values over a short period of time and enters themsubsequently in the archive file, as soon as the archive is restarted.

    1

    1

    2

  • 8/19/2019 109477071 LongTermDataArchives en v10

    45/46

    5 Operating the Application

    5.2 Error detection

    Langzeitarchivierung auf Bediengeräten mit WinCC (TIA Portal)Entry ID: 109477071, V1.0, 08/2015 45

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    Detail of the “Ar chi v_010. csv“ archive file.

    Figure 5-2

  • 8/19/2019 109477071 LongTermDataArchives en v10

    46/46

    6 Links & Literature

             S

       i  e  m  e  n  s

       A   G    2

       0   1   5   A   l   l  r   i  g   h   t  s  r  e  s  e  r  v  e   d

    6 Links & LiteratureTable 6-1

    Topic Title

    1. Siemens IndustryOnline Support

    https://support.industry.siemens.com

    2. Download page ofthe entry

    https://support.industry.siemens.com/cs/ww/de/view/109477071 

    3. SIOS Portal entry“What are thefunctionaldifferences betweenthe differentSIMATIC panels?“

    https://support.industry.siemens.com/cs/ww/en/view/40227286

    4. SIOS Portal entry“How do you

    integrate an HMIoperator panel intoa local network?”

    https://support.industry.siemens.com/cs/ww/en/view/13336639

    5. SIOS Portal entry“How do you use ascript to determinewhether a storagedrive withremovable media(USB stick, SD/MMcard) is ready forwriting on an HMIdevice?”

    https://support.industry.siemens.com/cs/ww/en/view/89855157

    7 History

    Table 7-1

    Version Date Modifications

    V1.0 06/2015 First version

    https://support.industry.siemens.com/cs/?lc=en-DEhttps://support.industry.siemens.com/cs/ww/de/view/109477071https://support.industry.siemens.com/cs/ww/de/view/109477071https://support.industry.siemens.com/cs/ww/en/view/40227286https://support.industry.siemens.com/cs/ww/en/view/40227286https://support.industry.siemens.com/cs/ww/en/view/13336639https://support.industry.siemens.com/cs/ww/en/view/13336639https://support.industry.siemens.com/cs/ww/en/view/89855157https://support.industry.siemens.com/cs/ww/en/view/89855157https://support.industry.siemens.com/cs/ww/en/view/89855157https://support.industry.siemens.com/cs/ww/en/view/89855157https://support.industry.siemens.com/cs/ww/en/view/13336639https://support.industry.siemens.com/cs/ww/en/view/13336639https://support.industry.siemens.com/cs/ww/en/view/40227286https://support.industry.siemens.com/cs/ww/en/view/40227286https://support.industry.siemens.com/cs/ww/de/view/109477071https://support.industry.siemens.com/cs/?lc=en-DE

Recommended