show the entry list

WinCC -- Configuring Tag Logging -- Displaying Tag Logging 
How do you calculate the difference between local time and UTC time in WinCC and how do you convert UTC time into an SQL statement? 
Displaying and exporting alarms and tag values on a Dat@View client with Windows NT 4.0 
What does the SIMATIC WinCC/DataMonitor options package contain? 
How can you display archives of other WinCC projects in Runtime? 
How can you create a database user in the WinCC Runtime database for access via the MS OLE DB provider? 
How can you access archived WinCC data with a C# Windows application? 
How can you convert a time stamp (date and time) of the local computer time into coordinated world time (UTC)? 
What options are there in WinCC for read and write access to TagLogging/AlarmLogging archives? 

How do you calculate the difference between local time and UTC time in WinCC and how do you convert UTC time into an SQL statement?Go to beginning
Part number:

Instructions
The data of WinCC archives is stored with a UTC time stamp.
Attached is an example created WinCC V6.0 SP3 in VB for:

  • Calculating the difference between local time and UTC time
  • Outputting local time and UTC time
  • Converting UTC time into an SQL statement

Brief description of the project
The project contains a picture with three buttons (yellow). The buttons trigger the various VB actions, the results are output in the I/O fields underneath.

Note
More information about handling times in WinCC is available in Entry ID: 26729255.

Screenshot of the project


Fig. 01

Sample project download

UTC-Beispielprojekt ( 712 KB )

Displaying and exporting alarms and tag values on a Dat@View client with Windows NT 4.0Go to beginning
Part number:

QUESTION:  
Why can't you have alarms and tag values displayed or exported on a Dat@View client (Dat@Monitor V6.0) with Windows NT 4.0?

ANSWER:  
In the case of a Dat@Monitor client with Windows NT 4.0 there might be errors in Dat@View with the Display and Export of alarms and tag values. The reason lies in the old versions of the Windows files msado15.dll and shell32.dll (4.00).

You should create an image of the hard disk before making the following changes.

Requirement for the display of data in Dat@View is the file msado15.dll with version V2.5 SP3 or higher. Furthermore, Microsoft Data Access Components (MDAC) 2.5 SP3 must be installed on the client. You can download this from the following address:

http://www.microsoft.com/downloads/details.aspx?displaylang=de&FamilyID=c57692e9-dde7-4a60-b586-5d4fd6794db6

Requirement for the export of data from Dat@View is the file shell32.dll (4.00). You can proceed as follows to install the latest version of shell32.dll:

  • Option 1 (with Internet connection):
    To install the latest version of shell32.dll you must install Support for Active Desktop when setting up the Internet Explorer 6.0 SP1. However, since you cannot select this in the Setup mask, you should call the Setup for the Internet Explorer 6.0 SP1 with the following command from the command line:
    ie6setup.exe /C:"ie6wzd /e:IE4Shell_NTx86 /I:Y"
  • Option 2 (without Internet connection):
    First deinstall the Internet Explorer 6.0 SP1 on the Dat@Monitor client, then install Internet Explorer 4.01 SP1 with Active Desktop and finally reinstall the Internet Explorer 6.0 SP1.
  • Option 3 (without Internet connection):
    If you have a version of the Internet Explorer installed on your computer, which cannot be deinstalled and which is more recent than version 4.01 SP1, then you must reinstall Windows NT 4.0. Then you must again install SP6 (or SP6a), then Internet Explorer 4.01 SP1 with Active Desktop and finally Internet Explorer 6.0 SP1.
  • Option 4 (without Internet connection):
    You also have the option of installing the new shell32.dll on a computer without there having to be an Internet connection and without having to deinstall the Internet Explorer 6.0 SP1:
    First unpack ie4slhnt.cab from the Internet Explorer 4.01 SP1 CD into a temporary folder (e.g. C:\Temp). Then install the files "ie4shell.inf" and ie4unit.inf by right-clicking the files and selecting the menu item "Install" from the pop-up menu. 
    Ignore the error message: "Copy error: an error has occurred while copying wallpaper.htm..." with the "Skip" button. Once you have installed both files you restart the computer. Then you install the Internet Explorer 6.0 SP1 again and restart the computer once again.

Keywords:
Alarm Logging, Data manager, Variables table, Variables, Tag, Tags, IE6, IE6.0, Microsoft


What does the SIMATIC WinCC/DataMonitor options package contain?Go to beginning
Part number:

Description:
SIMATIC WinCC DataMonitor contains the following components:
 
No. Procedure
1 Process Screens (formerly Dat@Symphony)
"Process Screens" is used purely for monitoring purposes and for the navigation across WinCC process screens with the Microsoft Internet Explorer. In doing so, on the server side DataMonitor employs the same mechanisms as the WinCC Web Navigator.
2 Trends & Alarms (formerly Dat@View)
With Trends & Alarms you can read data out of the WinCC archives and output the data as tables or graphs. The following display options are available:
  • Process value table
  • Trend (process values)
  • Alarm table
  • Hit list of alarms
  • Statistics functions for process values
3 Excel Workbook (formerly Dat@Workbook)
With this add-in for Microsoft Excel it is possible to read out process/archive values and their associated values online from WinCC Runtime and display them in Microsoft Excel. Here, you can use all the functions of Microsoft Excel for processing the data, e.g. diagram display, mean value calculation...
You can also prepare finished workbooks for downloading on the DataMonitor server.
4 WebCenter (from V6.2 onwards)
Using WebCenter you can create your own WebCenter pages and save them on the server. WebCenter is very flexible in its options for designing pages. You can combine all the displays from Trends & Alarms and make a WebCenter page out of them. DataMonitor-Admin can save a WebCenter page created in this way on the server, so that all other users have access to it (public). DataMonitor users can save their own pages on the server (private).
5 Reports (from V6.2 onwards)
DataMonitor Reports permits you to generate event-driven or time-driven reports. You can send these reports as e-mails or make PDFs or Excel tables out of them. You need "Adobe Acrobat Elements" to produce reports as PDFs. This program is available as an option with DataMonitor.

Keywords:
Package, Extension

How can you display archives of other WinCC projects in Runtime?Go to beginning
Part number:

Instructions
You can use the ODK functions to incorporate archives of other projects.

The Open Development Kit (ODK) provides functions that can be used to list existing archives, read data out of archives and write data to archives. It is also possible to export data into "*.csv" files. Using the ODK functions you can export the archive data during Runtime of a WinCC project and import it during the Runtime of another project. The imported data can then be displayed with the "WinCC Online Trend Control" or the "WinCC Online Table Control".

Information on the WinCC option Open Development Kit (ODK) is available in Entry IDs 9652128, 17810928, 22450798 and 26663897.

Entry ID 22578952 shows the options for displaying and editing WinCC archives.

How can you create a database user in the WinCC Runtime database for access via the MS OLE DB provider?Go to beginning
Part number:

Description:
If the MS OLE DB provider is to be used for access to the WinCC Runtime database, you must specify a database user and password in the "ConnectionString" for setting up connections to the database:

string myConnectionString =      "Provider=SQLOLEDB;
  Data Source = <Computer name>\WINCC>;
  uid = <User name>
  pwd = <Password>
  Initial Catalog = <Data Source Name>";

If the specified user is not in the database or the user does not have sufficient rights, access to the database is prevented.

Note:

  • When using the WinCC OLE DB provider, there is no user or password specified in the "ConnectionString".
  • If the same Windows users are logged on to the computers with the Connectivity Pack Server and Client and these users are also using the same password, then it is NOT necessary to create separate user roles or users in the SQL server or in the Runtime database. In this case there is no need for specifying the user name and password in the "ConnectionString" for connection setup. Instead, use the following connection parameters:
    "Integrated Security=SSPI; Persist Security Info=false;"
    Information on this is available in the Online Help for the Connectivity Pack under "Access via OLE DB Provider > Set up connection to the archive database".

To be able to use the MS OLE DB provider to access the WinCC Runtime database, you can use an existing user with sufficient rights or you create an new user accordingly for this purpose. Below we describe how to create a new user in the WinCC Runtime database.
 
No. Procedure
1 Open the WinCC project
You open the project in the WinCC Explorer (WinCC Control Center).

Note:
This automatically attaches the WinCC Runtime database to the SQL server. The Runtime database is then "visible" for the following steps in the "Microsoft SQL Server Management Studio". It does not have to be attached manually.

2 Open "Microsoft SQL Server Management Studio"
  • Open the "Microsoft SQL Server Management Studio" on the WinCC computer. You can use the Windows Start menu for this:
    "Start > Programs > Microsoft SQL Server 2005 > SQL Server Management Studio".
  • The "Connect to Server" dialog window opens. Click the "Connect" button to acknowledge this dialog.
3 Create a new login in the SQL server instance of WinCC
  • In the "Object Explorer" of the "Microsoft SQL Server Management Studios" you select the item "<Computer name>\WINCC > Security > Logins" under the SQL server instance and right-click to open the pop-menu. Select the menu command "New Login...". A window opens for creating a new login.

    ( 48 KB )
    Fig. 01
  • Enter the name of the new login in the "Login name" input box.
  • Select the "SQL Server authentication" option and enter the password and confirm it appropriately in the "Password" and "Confirm password" input boxes.
  • Deselect the following options.
    • "Enforce password policy"
    • "Enforce password expiration" (this is deselected automatically if "Enforce password policy" is deselected)
    • "User must change password at next login" (this is deselected automatically if "Enforce password policy" is deselected)

    ( 80 KB )  
    Fig. 02
     

  • Click the "OK" button to create the new login.
4 Create a new user in the WinCC Runtime database
  • In the "Object Explorer" of the "Microsoft SQL Server Management Studios" you select the item "... > Security > Users" under the WinCC Runtime database and right-click to open the pop-up menu. Select the menu command "New User...".

    ( 54 KB )
    Fig. 03 

    Note:
    The name of the WinCC Runtime database corresponds to the "Data Source Name" of the Runtime database. Entry ID 9061684 contains all the detailed information you need about the determining the "Data Source Name".

    A window opens for creating a new database user.

    ( 44 KB )
    Fig. 04
  • Enter the name of the name of the new user in the "User name" input box. You can use the same name as in Step 3.
     
  • Enter the login name used in Step 2 in the "Login name" input box.

    Note:
    With the "..." button on the right of the "Login name" input box you can look for logins in the database and select them.
     
  • Fill in the "Default schema" and "Database role membership" fields.

    Note:
    If you only wish to have read access to the Runtime database, read-only access rights suffice. In this case you select the value "db_datareader" as "Default schema" and select the item "db_datareader" in the "Database role membership" list.
     
  • Click the "OK" button to create the new user.

How can you access archived WinCC data with a C# Windows application?Go to beginning
Part number:

This application has been revised and is available for downloading as an application in Entry ID 35840700.
An MS Excel-based solution is also available as an alternative.

How can you convert a time stamp (date and time) of the local computer time into coordinated world time (UTC)?Go to beginning
Part number:

Instructions
In certain cases it might be necessary to specify date and time as local computer time and to further process it as coordinated world time (UTC).

Example
One sample application is the connecting and disconnecting of exported archive segments. If exported archive segments are to be connected to or disconnected from the archive manager, there is a time stamp for selecting the archive segments by default in UTC time. To save having to make this conversion while inputting, it is useful to have automatic conversion of the time stamp from the local computer time to the UTC time.

This entry shows how you can have this conversion done using a VBScript.

Description
The deviation of a time stamp of local computer time to the UTC time depends on the local time zone and the summer/winter time changeover.
The VBS function IS_GetUTC is assigned a parameter of the data type Date. The time stamp (date and time) is to be returned as UTC time. From the current time zone setting of the computer, the function determines the difference to Greenwich Mean Time (UTC). Depending on whether summer time is active at the specified point in time, the difference to UTC is increased/reduced by the parameterized time.
The function returns the transferred time stamp corrected as UTC(GMT) time stamp.

The following figure shows the associated VBScript.


Fig. 01

The ZIP file contains the script as bmo file (project module) and as txt file (text file), and a PDL file (WinCC picture) for testing the time conversion.

WinCC_LocalTime2UTC.zip ( 14 KB )

Integrate

  • Open the project folder of the WinCC project (...Siemens\WinCC\WinCCProjects\<Project_name>).
  • Copy the LocalTimeToUTC(GMT).PDL file into the "GraCS" folder of the WinCC project.
  • Copy the IS_GetUTC.bmo file into the "ScriptLib" folder of the WinCC project. Create the "ScriptLib" folder in the project folder if not already available.
  • Open and save the IS_GetUTC.bmo file.

Settings
The configuration data for this script is in the area marked red in Fig. 01. You must set the following data:

  • Day of the changeover from winter time to summer time in the format of the local time zone without year number but with separator (Default: "31.03.").
  • Time of the time changeover (Default: "3" for 3 a.m.).
  • Difference between summer time and winter time in minutes.
  • Day of the changeover from summer time to winter time in the format of the local time zone without year number but with separator (Default: "31.10.").
  • Time of the time changeover (Default: "2" for 2 a.m.).
  • Automatic recognition of Sunday. The Sunday before the specified date of the time changeover can be determined (DaySelect = -1) or the Sunday after the specified date of the time changeover (DaySelect = 1).

Note
For time changeover on the second Sunday in March, you must specify the first possible date of the time changeover (08.03.) and set the automatic recognition of the Sunday (DaySelect) to "1".
The default values correspond to the standard rules in Europe which stipulate that the time changeovers are on the last Sunday in March at 2 a.m. and on the last Sunday in October at 3 a.m. During the summer time, an hour or 60 minutes is added to the UTC (GMT) time in addition to the time zone.

You can use the enclosed WinCC picture to test the settings.


Fig. 02

WinCC does not need any tags, you simply have to copy the *.PDL file into the "GraCS" folder of the WinCC project and call it in Runtime.
The picture contains an input field for entering the test times in the format specified. Using the "Convert to UTC(GMT)" button the input field is read, the format of the input checked and the VBS function IS_GetUTC is called. All the data is then displayed in the output window.

Warning

  • On the local computer, you must set the time zone for which the conversion is to be done.
  • There is no local computer time between 2 a.m. and 3 a.m. (with default values) on the day of the winter/summer time changeover. If despite this a time is transferred between 2 a.m. and 3 a.m., then it is not recognized as an error.
  • There is no UTC (GMT) between 1 a.m. and 2 a.m. (with default values) on the day of the summer/winter time changeover.

The following table explains the important parts of the script.
 
No. Option
1 Get time zone bias
In this section the difference between the current time zone of the computer and Greenwich Mean Time (GMT or UTC) is determined as the "TimeZone". This is done using "Windows Management Instrumentation (WMI)". Information about the WMI is available in Entry ID 24198647.

Note:
If summer time is active, it is not taken into account at this point in the "TimeZone" difference.

2 Get day of the year
To determine whether or not summer time is active at the time of the date specified ("vtDate") a "day of the year" query is made. Using the VBS function "DatePart()" you determine the day of the year for the following points in time:
  • "DoY" - Day of the year for the transferred date "vtDate".
     
  • "dwi"   - Day of the year for changeover to winter time
    The "day of the year" for changeover to winter time is a result of the "day of the year" difference on October 31 minus the number of the associated day in the week. Since the VBS function DatePart() supplies the number values 1 to 7 as weekdays, the value delivered by DatePart() is reduced by "1".
     
  • Since the VBS function DatePart() supplies the numbers (1 to 7) of the weekdays (0 = Sun, 1 = Mon, ..., 7 = Sat ), the value delivered by DatePart() is reduced by the "1". Sunday then is the number 0, Monday is number 1, Tuesday is number 2 etc.

    Example:
    October 31 is the 304th day in the year. The associated weekday on October 31 is a Tuesday ("day of the week" = 2). The result for the summer/winter time changeover is thus the 302nd day in the year.
     
  • "dso"  - Day of the year for changeover to summer time

A query is then made as to whether summer time is active when the "vtDate" date is transferred. If summer time is active, the difference to Greenwich Mean Time determined as "TimeZone" in Step 1 is increased by the difference between summer time and winter time.

3

Correction of date
The VBS function "DateAdd()" is used to calculate the associated UTC time "vtDateUTC" for the transferred date "vtDate". For this the difference to the UTC time "TimeZone" is subtracted from the transferred date "vtDate".

4 Diagnostic output
This section of the code generates the screen output in the WinCC diagnostics window or in the APDIAG output window. You can comment out these lines.
5 Return UTC date and time
The VBS function returns the date "vtDateUTC" (date and time) converted to UTC time.

Creation environment
The instructions in this entry have been tested with the following environment.
 
Component Product and version designation
PC operating system Microsoft Windows XP SP3
Standard tools ---
HMI software WinCC 7.0 SP2 Upd 4
Options ---
Controllers ---

What options are there in WinCC for read and write access to TagLogging/AlarmLogging archives?Go to beginning
Part number:

Configuration Notes
The table below shows what options there are in WinCC for read and write access to TagLogging/AlarmLogging archives.

Notes

  • "r" read access
    If the "r" column is ticked for a configuration tool, this indicates that this tool supports read access to the archive data.
  • "w" write access
    If the "w" column is ticked for a configuration tool, this indicates that this tool supports write access to the archive data.
  • "csv" option to export data as a text file
    If the "csv" column is ticked for a configuration tool, this indicates that this tool supports data export in text format (CSV file, for example). 
Configuration tool r w csv Description
WinCC Graphics Designer x     Runtime data can be displayed directly in the WinCC screen.
More detailed information about the controls is available in the WinCC documentation.
The following controls are available:
x 4) WinCC Alarm Control
Using the WinCC Alarm Control, messages and alarms can be displayed in tabular form and acknowledged in the process picture.
4) From WinCC V7.0 onwards you can export all or selected Runtime data to a CSV file.
x 1) WinCC Online Trend Control
Using the WinCC Online Trend Control, process values (archive and online values) can be displayed graphically in the form of a trend in the process picture.
1) From WinCC V6.2 onwards, at Runtime, you can export the trend data as a CSV file for the time slot shown in the control.
More information is available in Entry ID: 25533776.
x 2) WinCC Online Table Control
Using the WinCC Online Table Control, process values (archive and online values) can be displayed in tabular form in the process picture.
2) From WinCC V7.0 onwards you can export the data as a CSV file at Runtime for the time slot displayed or selected parts of it.
x 3) WinCC Function Trend Control
Using the WinCC Function Trend Control, process values (archive and online values) can be displayed graphically in the form of a trend in the process picture.
3) From WinCC V7.0 onwards you can export the Runtime data to a CSV file.
WinCC Report Designer   x     Using the WinCC Report Designer, you can create reports and logs which can be used to print tag logging and alarm logging data at Runtime.
More detailed information is available in the WinCC documentation.

Note
The Report Designer also enables you to use data from ODBC data sources in the report or log.
More detailed information is available in the WinCC documentation.

Logging object
of the VBS
(as from WinCC V6.0 SP3)
x     Using  "Logging Object"  you can reconnect swapped-out archive segments to the Runtime or delete previously swapped-in archive segments.
More detailed information is available in the WinCC documentation.
WinCC Option
Open Development Kit
(ODK)
x x x The ODK provides among other things functions that can be used to list existing archives, read data out of archives and insert data in archives. It is possible to export data into "*.csv" files.
More information is available in the WinCC documentation.
WinCC Option
Connectivity Pack
(as from WinCC V6.0 SP1)
x x x The WinCC/Connectivity Pack option provides among other things an OPC server that supports the specification OPC Historical Data Access 1.1 (OPC HDA). Using OPC HDA you can have read or write access to the WinCC archive system. Using WinCC OLE DB it is possible to gain direct read access to the archive data stored by WinCC in the MS SQL server database (process values, messages and user data). Here you can even use statistics functions (Minimum, Maximum, Average, Variance, for example). Here you can read data from several archive variables simultaneously with one access. The results here can be provided on request with a common time stamp and interpolated.
More detailed information is available in the WinCC Connectivity Pack documentation.

Notes

  • From WinCC V6.0 onwards, the process values of the Tag Logging FAST archives are saved in compressed form. Direct access is possible via WinCC OLE-DB or ODK.
  • From WinCC V6.2 onwards, the process values of the Tag Logging SLOW archives are saved in compressed form. 
WinCC Option
Industrial Data Bridge
x   x

The WinCC/Industrial Data Bridge options package is for simple configuration/parameterization of the transfer of WinCC data (online data and historical data) to third-party systems (other OPC servers or databases) and back using standard software. Programming know-how is NOT necessary. Data transfer can be transferred automatically at specific times or depending on specific conditions. For example, the Industrial Data Bridge is used in conjunction with WinCC to be able to read and write data from and to external databases. Furthermore, you have the option of having read access to WinCC archives (process value or message archives) and writing this data to a file or database, for example. It is also possible to access WinCC user archives.
More detailed information is available in the WinCC Industrial Data Bridge documentation in Entry ID: 29489481.

WinCC Option
DataMonitor
(pre V6.2: Dat@Monitor Web Edition)
x   x The WinCC/Data Monitor options package is used specially for end users who wish to display process data (online, archives and alarms) or further analyze this data with the powerful tools supplied. DataMonitor is a suite of different evaluation applications.
More detailed information is available in the WinCC DataMonitor documentation.
Central Archive Server
(as from WinCC V6.2)
x     The WinCC/Central Archive Server (CAS) options packages permits you to export to a computer the archive data of all the servers available in the system. Data access is transparent for the display and analysis and continues to be possible via the standard WinCC clients. Here, for the clients it does not matter whether the data is still on the WinCC server or already on the CAS.

Both process value archives and message archives are created on the separate WinCC servers and transferred to the CAS upon completion of the individual database segments. Through "Store&Forward", even if the network is interrupted between the WinCC server and the CAS, the data is transferred securely as soon as the network is up and running again.
More detailed information is available in the WinCC Central Archive Server documentation.

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 can be found in Entry ID: 50203404.

 Entry ID:29443058   Date:2012-03-22 
I regard this article....as helpfulas not helpful                                 






























related links
WinCC V6.2 HMI Manual Collection
Why does the WinCC Online Trend C ...
With what are SIMATIC WinCC V7.x, ...
Why are the characters "i" and "u ...
WinCC: General information
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