show the entry list

Mobile Panels -- Creating HMI configurations -- Using archives  
How can you safely copy or move archives in WinCC flexible? 
How can you safely copy or move archives in WinCC Comfort V11/WinCC Advanced V11? 
How can you output batch data or archived data via an HMI operator panel? 
How do you do long-term archiving with WinCC flexible? 
What special points are there in the WinCC flexible function "Archive log file" in the "Move" mode? 
How are tags and alarms logged in WinCC flexible? 
How can you store tags/data records event-triggered with date and time in a CSV file? 
How can you have data from a tag log displayed in table form for panels or the WinCC flexible PC Runtime? 
Which external storage locations are available on the various operator panels (TIA Portal/WinCC flexible/ProTool) for archiving data? 

How can you safely copy or move archives in WinCC flexible?Go to beginning
Part number:

Description
The function list below in the WinCC flexible manual is recommended for copying/moving archives.

CloseAllArchives
ArchiveLogFile
OpenAllArchives

This function list does not enable you to ensure that the archives have been copied successfully, because the next function does not wait until the previous function has finished.

Solution
Each function is executed only once the previous function has been completed successfully.

Note
This method does not work with a segmented archive, because the "ArchiveLogFile" function only copies a file and not segments.

Copy or move an archive
 
No. Procedure
1 Close All Archives
Configure the "CloseAllArchives" function for the "Release" event of a button.
2 Archive Log File
If the "CloseAllArchives" function is completed successfully, the system message number 80019 is output.
Configure the "ArchiveLogFile" for the "Arrived" event of this system message.

Note
How to display the system messages of WinCC flexible during configuration is explained in Entry ID: 18973361.

3 Open All Archives 
After the "ArchiveLogFile" function is completed successfully, the system message number 80048 is output.
Configure the "OpenAllArchives" function for the "Arrived" event of this system message.
Table 01

Copy or move multiple archives
 
No. Procedure
1 Close All Archives
Configure the "CloseAllArchives" function for the event of a button.
2 Archive Log File
If the "CloseAllArchives" function is completed successfully, the system message number 80019 is output.
Configure the script below for the "Arrived" event of this system message.
The example shows the copying of 5 archives.


Fig. 01

3 Open All Archives
If the "ArchiveLogFile" function is completed successfully, the system message number 80048 is output.
Configure the script below for the "Arrived" event of this system message.


Fig. 02

Function of the script
This system message "80048" appears once for each copied or moved archive. The number of system messages "80048" is counted by the internal "Counter" tag. Once all the archives have been copied/moved (5 in this example), the "IF query" has been fulfilled and the "OpenAllArchives" function is executed.
The internal "Counter" tag starts with the value 0.

Table 02

Change the two scripts in Fig. 02 as required.

Note
If you archive approx. 300 values in a short time (over all the archives to be copied), it is recommended that you use the "StopArchiving" function to stop the archives before the copying procedure. After the "OpenAllArchives" function is completed successfully, start the archives again separately using the "StartArchiving" function.
When the "StopArchiving" function is executed, no more values are archived.

Note on security
Caution
The functions and solutions described in this article confine themselves predominantly to the realization of the automation task. Furthermore, please take into account that corresponding protective measures have to be taken in the context of Industrial Security when connecting your equipment to other parts of the plant, the enterprise network or the internet. More information is available in Entry ID: 50203404.

How can you safely copy or move archives in WinCC Comfort V11/WinCC Advanced V11?Go to beginning
Part number:

Description
The function list below in the WinCC Advanced V11 SP2 manual is recommended for copying/moving archives.

CloseAllArchives
ArchiveLogFile
OpenAllArchives

More information is available in the manual under "WinCC Advanced V11 SP2 > Visualize Processes (Advanced) > Working with system functions and Runtime scripting > Reference > Function List > System Functions > ArchiveLogFile".

This function list does not enable you to ensure that the archives have been copied successfully, because the next function does not wait until the previous function has finished.

Solution
Each function is executed only once the previous function has been completed successfully.

Note
This method does not work with a segmented archive, because the "ArchiveLogFile" function only copies a file and not segments.

Copy or move an archive
 
No. Procedure
1 Close All Archives
Configure the "CloseAllArchives" function for the "Release" event of a button.
2 Archive Log File
If the "CloseAllArchives" function is completed successfully, the system message number 80019 is output.
Configure the "ArchiveLogFile" for the "Arrived" event of this system message.

Note
The system messages are in the project navigation under "HMI messages" and there in the "System Messages" tab.

3 Open All Archives 
After the "ArchiveLogFile" function is completed successfully, the system message number 80048 is output.
Configure the "OpenAllArchives" function for the "Arrived" event of this system message.
Table 01

Copy or move multiple archives
 
No. Procedure
1 Close All Archives
Configure the "CloseAllArchives" function for the event of a button.
2 Archive Log File
If the "CloseAllArchives" function is completed successfully, the system message number 80019 is output.
Configure the script below for the "Arrived" event of this system message.
The example shows the copying of 5 archives.


Fig. 01

3 Open All Archives
If the "ArchiveLogFile" function is completed successfully, the system message number 80048 is output.
Configure the script below for the "Arrived" event of this system message.


Fig. 02

Function of the script
This system message "80048" appears once for each copied or moved archive. The number of system messages "80048" is counted by the internal "Counter" tag. Once all the archives have been copied/moved (5 in this example), the "IF query" has been fulfilled and the "OpenAllArchives" function is executed.
The internal "Counter" tag starts with the value 0.

Table 02

Change the two scripts in Fig. 02 as required.

Note
If you archive approx. 300 values in a short time (over all the archives to be copied), it is recommended that you use the "StopArchiving" function to stop the archives before the copying procedure. After the "OpenAllArchives" function is completed successfully, start the archives again separately using the "StartArchiving" function.
When the "StopArchiving" function is executed, no more values are archived.

Note on security
Caution
The functions and solutions described in this article confine themselves predominantly to the realization of the automation task. Furthermore, please take into account that corresponding protective measures have to be taken in the context of Industrial Security when connecting your equipment to other parts of the plant, the enterprise network or the internet. More information is available in Entry ID: 50203404.

How can you output batch data or archived data via an HMI operator panel?Go to beginning
Part number:

Description
There is often the requirement to archive and document process data.

The aim of this entry is to show a way of how to archive batch data or do long-term archiving with WinCC flexible.

In addition, the entry shows you how to export and save the archived entries in a "*.csv file".

In order also to be able to use operator panels that do not support scripts, we have not used scripts in this sample application.

Which operator panels are supported?
The instructions below apply for all operator panels that support the following functions:

  • Recipes
  • Export data records
  • Slot for a memory card

An overview of the functions of the various operator panels is available in
Entry ID: 40227286.
In this sample application we have used a TP177B PNDP 4".

Please refer to the attached documentation and configuration for details.
The attached download contains a WinCC flexible project integrated in STEP 7 with the functions described in the document.

Creation environment
The figures and download in this FAQ were created with STEP 7 2010 Professional and
WinCC flexible 2008 SP2.

Contents of the documentation
1 Introduction
2 Automation Solution
   2.1 How Configuration Works
   2.2 Overview
3 Configuration
   3.1 HMI Configuration
         3.1.1 Configured Pictures
         3.1.2 Variables
         3.1.3 Recipes
         3.1.4 Other Functions Used
   3.2 STEP 7 Configuration
4 Operation of the Sample Application
   4.1 Example 1
   4.2 Example 2
   4.3 Tips and Tricks

Downloads
Contents of the downloads

Download

Documentation
The documentation includes all the necessary configuration steps perform the example in the FAQ.
( 855 KB )
Code
The packed file contains the sample WinCC 2008 project integrated in STEP 7.
( 3872 KB )

Additional information
Title

Link

How do you do long-term archiving with WinCC flexible (using scripts)? Entry ID: 48015332

Note on security
The functions and solutions described in this article confine themselves predominantly to the realization of the automation task. Furthermore, please take into account that corresponding protective measures have to be taken in the context of Industrial Security when connecting your equipment to other parts of the plant, the enterprise network or the Internet. Further information can be found in Entry ID: 50203404.

Keywords
Batch log, Mass data, Log, Batch data, Batch report, Batch files

How do you do long-term archiving with WinCC flexible?Go to beginning
Part number:

Description
The system limits for archiving tag values on operator panels and PC Runtime systems permit only restricted long-term archiving.
In the case of an MP 277 Touch, the limit is 10,000 items per archive (including all the archive segments).

Furthermore, there are restrictions to the output of archived tag values by means of a trend display over a long period of time.
The period depends on the maximum number of process values that can be stored in the tag archive.

This present entry describes how you might be able to use WinCC flexible to

  • Do long-term archiving (Fig. 1).
  • Create tag archives whose names are created first at "Runtime".
    The tag archives created can then be selected via a selection field and output by means of a trend display (Fig. 2).

The figure below shows an example of how the archived entries are displayed. The names of the archives and the "folder structure" are created automatically via scripts.


Fig. 01

Fig. 02 shows a trend display. You select the separate archives by date and time.
When the archive is downloaded, the archive contents are output in a trend display.


Fig. 02

The PDF document available for downloading describes the main configuration steps for creating the relevant

  • Archives
  • Tags
  • Text lists
  • Pictures
  • Scripts

Please refer to the attached project for details.

The attached download contains the archived WinCC flexible projects with the functions described in the document.

Downloads
 
Contents of the downloads

Download

Documentation 
WinCC flexible long-term archiving
( 1298 KB )
Code 
Project MP 277 Touch / PC Runtime
( 5965 KB )

Runnability and test environment
The following table lists the components that have been used to create this entry and verify the functions described.
 
Components Product and version designation
PC operating system Microsoft Windows XP SP3
HMI software WinCC flexible 2008 SP2 Update 3
HMI system MP277 Touch and PC Runtime

What special points are there in the WinCC flexible function "Archive log file" in the "Move" mode?Go to beginning
Part number:

Description
The "Archive log file" function moves or copies an archive to the long-term archiving to a different storage location.

General information on this is available in the WinCC flexible Information System > Working with WinCC flexible > Reference > System functions.

Special feature of "Move" mode
You must delete the job files to stop the "Archive log file" function from being executed.
The job files are created in the archive path in the Archiv.csv*D/Y*_*time_stamp* format.

You must also delete the job files when you 

  • Remove the function from the project
  • Do an OS update/Restore/Project download

Keywords
Archive type, Archive log file, Archiving

How are tags and alarms logged in WinCC flexible?Go to beginning
Part number:

The full content of this FAQ is in the PDF document attached and is as follows:

Contents
1. Creating logs
    1.1 Creating tag logs
    1.2 Creating alarm logs
2. Information on logging   
    2.1 System limits when logging
    2.2 Released storage media
    2.3 Write access to and service life of storage media
    2.4 Activating the checksum when logging
    2.5 Runtime load during logging
3. Information on storage locations
    3.1 CSV file (ASCII)
    3.2 RDB file
    3.3 TXT file (Unicode)
    3.4 Database

Download

26190515_flexible_archiving_e.pdf ( 1550 KB )

 

How can you store tags/data records event-triggered with date and time in a CSV file?Go to beginning
Part number:

Instructions:
You can store tags/data records in CSV file via a script that is executed event-triggered (e.g. by clicking a button).

At the end of this entry is a sample project in which the functionality is implemented. An MP277 Touch operator panel and PC Runtime were used.

The example can be used on all operator panels that support script functions.
 
No. Procedure
1

Description of scripts used:

"Storage_Tag_V1" script
The script automatically prefixes the archive with the current date.  
The name of the CSV file is "Archive_Date.csv".

The script is structured so that the storage path configured is created automatically at Runtime. Therefore, the storage path does not have to be created manually beforehand on the memory card. The "Script_Storage_Path" script executes this function.

The script is called by a certain trigger event (e.g. clicking a button).
The script first checks whether a memory card (with MP277) is available. If no memory card is available, a system message is issued.
If the file to be archived does not already exist on the data carrier, a new file is created.
An existing file is opened, the data attached and then the file is closed again.

"Script_Storage_Path" script
The "Script_Storage_Path" script splits the specified storage path with the "\" character into separate "subfolders" and writes these one after the other to the storage medium.
The function is executed until there are no more "\" characters in the storage path.
The storage path is transferred as parameter to the "Script_Storage_Path" script
(see Script "Storage_Tag_V1" Lines 29 and 21).

Note:
Do not use the internal memory of the operator panel as storage path. This is not allowed.

The VBS functionality gives you a wide range of options for influencing the display and parameterization. You can change the scripts as you wish to suit your requirements.

The scripts have "comments" that give brief descriptions of the individual steps. Please refer to the WinCC flexible Online Help or relevant specialist literature for detailed information on the functions and commands used.

2 Program extension/modification:
If you wish to change the storage path, for example, or add more tags to application, then make the following changes to the "Storage_Tag_V1" script. You do not have to make any changes to the "Script_Storage_Path" script.

Storage path:
Line 5: You specify the storage path in Line 5.

Extend the table header:
Line 13: You extend the "table header" in Line 13.

System message:
Lines 24 and 43: You change the system message text in Line 24 (MP 277) and Line 43 (PC Runtime).

Change/add tags:
Lines 51 and 57: You change tags and add more tags in Line 51 (MP 277) and Line 57 (PC Runtime).

There is no need for any more changes in the scripts for this application.

3 Function description:


Fig. 01

Assign the relevant values via the IO fields (1).
Click on the button (2) to execute the "Storage_Tag_V1" script and store the data in a CSV file.

General note:
Note the difference in VBS syntax in Windows CE-based devices and PC Runtime. The commands are sometimes different in these operating systems.
Thus the scripts stored in MP277 Touch cannot be tested in the RT Simulation. 
For this, refer to the information in Entry ID 13408815.

Runnability and test environment:
The following table lists the components that have been used to create this entry and verify the function described.
 
Components Product and version designation
PC operating system Microsoft Windows XP SP2
Standard tools -
Engineering tools -
HMI software WinCC flexible 2007
HMI devices MP277 Touch 10"; PC Runtime
Controllers -
Table 1: Creation environment of the download attached

The attached download contains the archived WinCC flexible project for an MP277 Touch operator panel and a PC Runtime configuration with the functions described above.

Attachment 1: Project_01.zip ( 3078 KB )

How can you have data from a tag log displayed in table form for panels or the WinCC flexible PC Runtime?Go to beginning
Part number:

Instructions:
Using the projects prepared for downloading, you can read out data from the tag log created by the system and transfer it into a table.
The solution is based on scripts.

The following navigation properties and functions are implemented in the sample project:

  • You can scroll entries up and down in single steps in the log.
  • You can scroll entries up and down in steps of 10 in the log.
  • You can jump from the beginning to the end of the log.
  • You can specify the log name in a text field.
  • The tag name, time stamp and value are read out of the log entry.
  • The entry numbers in the log are displayed.

Description of functions and operating instructions:
 
No. Configuration
1 General information:
The project consists of a PC Runtime and an MP 277 Touch configuration. Both projects are structured in the same way and contain the same functions.
The projects only differ in the command syntax used for the scripts.

The PC Runtime source code cannot be used for operator panels with Windows CE because access to the file system from Windows CE with this source code is not possible.
The same applies in the opposite case if you use the MP 277 Touch source code.

2

Description of functions and operating instructions:
The following gives you an overview of the configuration.


Fig. 01

  • Log name:
    Here you enter the relevant tag name that you defined previously in the configuration (see 2). In this example, Log_1 or Log_2.


Fig. 02

  • Control buttons:
    You use the control buttons next to the table to scroll through the logged tag values.
  • Stopping / starting logging:
    Via the "StopLogging" buttons, you can stop the logging of logs 1 and 2 respectively.
    Via the "StartLogging" buttons you can start logging of logs 1 and 2 respectively.

If, for example, a log with 50000 entries is used (max. number of log entries for panels), a "jump" to the end of the log file might take several seconds. This comes from simultaneous read and write access.
It is therefore recommended to stop the logs in order to improve performance.

Note that Windows CE operator panels are not primarily designed for logging data cyclically. They are more intended for logging acyclic error states.
The operator panels are not designed for extensive logging tasks with high quantity frameworks or with high performance requirements.

  • Simulating tag values:
    The values for "Variable_1" and "Variable_2" are obtained through simulations that are stored in the properties in "Screen_01". These values would normally be "process values" that are stored in the corresponding log.


Fig. 03

  • Scripts:
    The function for reading out log data is based on scripts. A description of the functions used is available in the Online Help of WinCC flexible and in the relevant specialist literature.
    The individual sections in the scripts have the corresponding headers.
3 Extending and changing the configuration:
You can change and extend the configuration as you wish.
If you want to use another storage path or file name or want to use another picture name, for example, you must change the parts of the script listed below.

Script "Button_Visible":

Line 7   -> Name of the picture
Line 11 -> Storage path

Script "Read_Line":

Line 7   -> Name of the picture
Line 16 -> Storage path

Script "Scroll_To_End":

Line 7   -> Name of the picture
Line 16 -> Storage path

The attached downloads contain the archived WinCC flexible 2007 project with the functions described above.

Runnability and test environment
The examples can be used on operator panels that support script functions or can be used with WinCC flexible PC Runtime.
Scripts are used in the WinCC flexible configuration. When copying pictures (e.g. into your own project), make sure that "Transfer name information" is checked in the device settings.
The following table lists the components that have been used to create this entry and verify the functions described.
 
Component Product and version designation
PC operating system Microsoft Windows XP SP2
Standard tools -
Engineering tools -
HMI software WinCC flexible 2007 HF4
HMI devices PC Runtime; MP 277 Touch
Controllers -
Table 1: Creation environment of the download attached

Attachment 1: Project_01_V1.0.zip ( 2036 KB ) (MP 277 Touch)

Attachment 2: Project_02_V1.0.zip ( 1994 KB ) (PC-Runtime)

Which external storage locations are available on the various operator panels (TIA Portal/WinCC flexible/ProTool) for archiving data?Go to beginning
Part number:

Configuration Notes
Depending on the operator panel there are different external storage locations to
save recipes, messages and variables, for example.
The table in attachment lists all the operator panels that you can configure with ProTool or WinCC flexible or in the TIA Portal. The list includes the relevant storage locations and the functions/data to be stored.

Note
Cyclic write access is not permissible for the internal flash memory, because this reduces the service life of the flash memory and therefore the service life of the operator panel. For the sake of the service life of the device and better performance you should as far as possible use external memory cards for storing data records and for archives.

Notes on performance with memory cards
No statement can be given at this point on the performance when using memory cards. Refer here to the manual for the operator panel concerned in each case.

Storage media is recommended in the FAQ: Which external storage media can you use with the SIMATIC panels and which memory card interfaces do they have? in Entry ID: 21847868.

Switching off operator panel with memory card slotted
In order to avoid possible loss of data, you must always close down the Runtime software before switching off the power supply. For this you operate the control that is linked to the "Terminate_Runtime" function in your configuration. Wait until the Start menu is displayed and only then switch off the power supply. If you cut the power supply by mistake during running operation, the operator panel checks the memory card after restart and repairs any defective areas. A description of how to restore the file system of a memory card is available in the MP377 manual under "MP377, MP377 PRO (WinCC flexible) > Configure operating system > Change operator panel setting > Backing up Registry entries"

Automatic repair of the memory card can be enabled in the Control Panel under OP in the "Persistent Storage" tab.


Fig. 01

In the TIA Portal you can use the "SafelyRemoveHardware" function to check whether you have read or write access to the storage media.
The function is described in the WinCC TIA Portal manual under "WinCC Advanced V11 SP1 > Visualizing processes (Advanced) > Working with system functions and Runtime scripting > Reference > VB scripting > SafelyRmoveHardware"

Note
You can safely close down the Runtime of the operator panel by using an uninterruptible power supply (UPS). More information on the UPS in combination with an operator panel is available in Entry ID 21633613.
(This note does not apply to the Comfort Panels. With a SIMATIC HMI Memory Card the Comfort Panels support the consistency of the stored data in the case of a power failure. More information on the topic of data consistency of the memory card for Comfort Panels is available in the manual.
"Comfort Panels manual > Commissioning the Panel > Overview > Memory Concept > Note on the data consistency of the memory card")

Removing the memory card
Before you remove the memory card, you must either operate the control that is linked to the "Close_Archive" function in your configuration or terminate the "Runtime" software. For this you operate the control that is linked to the "Terminate_Runtime" function in your configuration. Closing the archives or terminating the Runtime software might take a few minutes depending on the size and number of the archives created.
If you remove the memory card during archiving, the data to be archived is temporarily buffered in the main memory of the operator panel.

Note
If the following message appears: "RT could not be terminated; do you want to wait?", then you acknowledge this query with YES.

Attachment 01: 20681208_HMI_Speichermedien_e.pdf ( 70 KB )

Example
The following example shows the selection of an external storage location for a recipe. 
"Storage Card", "Storage Card2" and "Storage Card SD" have been chosen as the storage locations.


Fig. 02 Setting in ProTool


Fig. 03 Setting in WinCC flexible


Fig. 04 Setting in WinCC TIA Portal

 Entry ID:35841205   Date:2012-10-17 
I regard this article....as helpfulas not helpful                                 






























mySupport
My Documentation Manager 
Newsletter 
CAx-Download-Manager 
Support Request
To this entry
Print
Create PDF 
Send to a friend
QuickLinks
Compatibility tool 
Help
Online Help
Guided Tour