ADVERTISEMENT

ConnectivityPack.pdf

Gdzie znaleźć dokumentację i przykłady do WinCC/ConnectivityPack?

Dokumentacja z przykładami do WinCC/ConnectivityPack.


Download file - link to post

SIMATIC HMI WinCC V6.2 Connectivity Pack

1
WinCC/Connectivity Pack
______________
Release Notes - Connectivity
Pack

2
______________
SIMATIC HMI
WinCC V6.2
Connectivity Pack
Printout of the Online Help

Licenses and Open Source
Software

3
______________
4
WinCC/Connectivity Pack
______________
5
Licensing
______________
Installation Connectivity
Pack

6
______________
7
Applications
______________
Access Via the OLE DB
Provider

8
______________
Security Settings During
Access to SQL Databases
Using MS OLE DB

9
______________
Examples for Access Using
OLE DB Provider

10
______________
11
Performance Data
______________
12
Connectivity Station
______________

Printout of the Online Help

11/2006

Safety Guidelines
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
Danger
indicates that death or severe personal injury will result if proper precautions are not taken.
Warning
indicates that death or severe personal injury may result if proper precautions are not taken.
Caution
with a safety alert symbol, indicates that minor personal injury can result if proper precautions are not taken.
Caution
without a safety alert symbol, indicates that property damage can result if proper precautions are not taken.
Notice
indicates that an unintended result or situation can occur if the corresponding information is not taken into
account.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will
be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to
property damage.

Qualified Personnel
The device/system may only be set up and used in conjunction with this documentation. Commissioning and
operation of a device/system may only be performed by qualified personnel. Within the context of the safety notes
in this documentation qualified persons are defined as persons who are authorized to commission, ground and
label devices, systems and circuits in accordance with established safety practices and standards.

Prescribed Usage
Note the following:
Warning
This device may only be used for the applications described in the catalog or the technical description and only in
connection with devices or components from other manufacturers which have been approved or recommended
by Siemens. Correct, reliable operation of the product requires proper transport, storage, positioning and
assembly as well as careful operation and maintenance.

Trademarks
All names identified by ® are registered trademarks of the Siemens AG. The remaining trademarks in this
publication may be trademarks whose use by third parties for their own purposes could violate the rights of the
owner.

Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.

Siemens AG
Automation and Drives
Postfach 48 48
90437 NÜRNBERG
GERMANY

Printout of the Online Help
11/2006

Copyright © Siemens AG 2006.
Technical data subject to change

Table of contents
1

WinCC/Connectivity Pack ....................................................................................................................... 1-1

2

Release Notes - Connectivity Pack......................................................................................................... 2-1

3

Licenses and Open Source Software...................................................................................................... 3-1

4

WinCC/Connectivity Pack ....................................................................................................................... 4-1

5

Licensing ................................................................................................................................................ 5-1

6

Installation Connectivity Pack ................................................................................................................. 6-1
6.1
6.2

Installation of the Connectivity Pack Server .............................................................................. 6-1

6.3
7

Installation .................................................................................................................................. 6-1
Installation of the Connectivity Pack Client................................................................................ 6-2

Applications ............................................................................................................................................ 7-1
7.1
7.2

Use Case 2: Remote Access to WinCC RT Databases ............................................................ 7-2

7.3

Use Case 3: Local Access to WinCC Archive Databases ......................................................... 7-3

7.4

Use Case 4: Remote access to WinCC archive databases ...................................................... 7-4

7.5

Use Case 5: Local Access to WinCC User Archive................................................................... 7-5

7.6

Use Case 6: Remote Access to WinCC User Archives ............................................................. 7-6

7.7

Use Case 7: Access Using WinCC OLE DB Provider While Employing DTS........................... 7-7

7.8

Access Using OPC to WinCC Archives, Tags, and Messages ................................................. 7-8

7.9

Transparent access to archived data......................................................................................... 7-9

7.10
8

Use Case 1: Local Access to WinCC RT Databases ................................................................ 7-1

Functions of SQL Servers........................................................................................................ 7-11

Access Via the OLE DB Provider............................................................................................................ 8-1
8.1

Accessing Archive Data via OLE DB-Provider .......................................................................... 8-1

8.2

Bases of OLE DB....................................................................................................................... 8-2

8.3

WinCC Archive Connector ......................................................................................................... 8-4

8.4

Establishing the connection to the archive database ................................................................ 8-7

8.5
8.5.1
8.5.2
8.5.3
8.5.4
8.5.5
8.5.6
8.5.7
8.5.8

Querying the Archive Data......................................................................................................... 8-9
Displaying Process Value Archives ........................................................................................... 8-9
Querying the Archive Data......................................................................................................... 8-9
Query for Process Values Archive ........................................................................................... 8-11
Querying Alarm Message Archives ......................................................................................... 8-17
Displaying Alarm Message Archives ....................................................................................... 8-18
Query for User Archives........................................................................................................... 8-20
Displaying User Archives ......................................................................................................... 8-22
Configuring Access With DTS.................................................................................................. 8-22

Connectivity Pack
11/2006, Printout of the Online Help

iii

Table of contents

8.6
8.6.1
8.6.2

Analysis Functions for Messages and Process Values ........................................................... 8-26
Analysis Functions for Messages and Process Values ........................................................... 8-26
Display of Message Archives for Analysis Queries ................................................................. 8-29

9

Security Settings During Access to SQL Databases Using MS OLE DB................................................. 9-1

10

Examples for Access Using OLE DB Provider ...................................................................................... 10-1
10.1

Examples for Access Using OLE DB Provider......................................................................... 10-1

10.2

Example: Configuring the Access to Archive Data Using VB .................................................. 10-1

10.3

Example: Configuring Access to Archive Data Using DataConnector Wizard ........................ 10-4

10.4
10.4.1
10.4.2
10.4.3
10.4.4

Examples: Analyzing Process Value Archives......................................................................... 10-8
Example: Analyzing Process Value Archives in WinCC Project.............................................. 10-8
Example: Reading Process Value Archive With WinCC OLE DB Provider........................... 10-10
Example: Comparing Measured Value Profiles in the WinCC Project .................................. 10-13
Example: Analyzing Process Value Archives with a VB Application ..................................... 10-14

10.5
10.5.1
10.5.2
10.5.3

Examples: Analyzing Alarm Message Archives..................................................................... 10-17
Example: Reading Alarm Message Archive Data with WinCC OLE DB Provider ................. 10-17
Example: Analyzing Alarm Message Archives in the WinCC Project .................................... 10-19
Example: Analyzing Alarm Message Archives With a VB Application................................... 10-22

11

Performance Data................................................................................................................................. 11-1

12

Connectivity Station .............................................................................................................................. 12-1
12.1

Basics of the Connectivity Station............................................................................................ 12-1

12.2
12.2.1
12.2.2

Functionality of the Connectivity Station .................................................................................. 12-4
Use of OPC interface of the Connectivity Station .................................................................... 12-4
Using OLE DB Interface of Connectivity Station...................................................................... 12-6

12.3

Configuring Connectivity Station in S7-Project ........................................................................ 12-7

12.4

Accessing WinCC data with the Connectivity Station.............................................................. 12-9

Index............................................................................................................................................... Index- 1

iv

Connectivity Pack
11/2006, Printout of the Online Help

WinCC/Connectivity Pack

1

Contents
Through the WinCC Connectivity Pack, you receive licensed access to WinCC databases via
OPC or WinCC OLE DB Provider.
This chapter will show you
• how to install the Connectivity Pack Server and Client;
• the OPC-Servers of WinCC
• how to configure access to the alarm message archive;
• how to configure access to the process value archive.
• How to configure the Connectivity Station

Target group of this documentation
This documentation was designed for developers with Visual Basic and SQL knowledge.

Connectivity Pack
11/2006, Printout of the Online Help

1-1

WinCC/Connectivity Pack

1-2

Connectivity Pack
11/2006, Printout of the Online Help

Release Notes - Connectivity Pack

2

Archive Connector
Monitored Folders in Archive Connector
The WinCC runtime archive folder and its subdirectories must not be registered in the list of
folders to be monitored. In the same way, there must be no archives in this folder or its
subdirectories which are linked to the SQL server manually by means of the Archive
Connector.

Activating/Deactivating the Monitoring for Folders in the Archive Connector
If the monitoring is activated or deactivated in the list of folders to be monitored, the change
will only become effective after closing the Archive Connector.

Language Switch of the Archive Connector
The user interface language of the Archive Connector is dependent on the settings of the
regional and language options.

Procedure
1. Close the Archive Connector.
2. In the Windows " Control Panel " , click on the icon " Regional and Language Options " . The
dialog " Regional and Language Options " opens.
3. In the tab " Regional Options " , specify the language at " Standards and Formats " .
4. Close the dialog. start the Archive Connector.

Querying Alarm Message Archives
When querying for alarm message archives, the result is summarized by archive, but without
a sorting of the queried archive segments.
If a sorting is to be carried out, the filter condition needs to be expanded accordingly, e.g. for
a chronological sorting, with " ORDER BY DateTime ASC, MS ASC " .

Queries for Process Value Archives
Queries for process value archives are limited to a maximum of 20 tags, each with a
maximum of 128 characters per tag.

Connectivity Pack
11/2006, Printout of the Online Help

2-1

Release Notes - Connectivity Pack

Access to user archives via MS OLE DB Provider
Consider the following when accessing WinCC user archives via the MS OLE DB Provider:
• Ensure that the write access is not enabled simultaneously via the MS OLE DB Provider
and via WinCC. This prevents inconsistencies in the archives.
• Changes via MS OLE DB Provider will not be displayed in WinCC Runtime until the User
Archive Table Controls are selected by a screen change. The current data of the user
archives are reread
• User archives changed via MS OLE DB Provider are not synchronized in a redundant
system.
• Please consider that WinCC updates can cause changes in the database scheme.
Scheme changes are also possible with the installation of hot fixes and service packs. In
this case, you must adapt the reading and writing access accordingly.

Time Range for Archive Inquiries for Message and Process Values
If the inquiry for message or process value archives selects a time range for which no
messages or other values exist within the archives, no note on the message or other status
display takes place. If this status is to be displayed, an error handling must be implemented
by the user.
A simple execution of this error treatment is described in the sample script under the topic
" Example: Reading Alarm Message Archive Data Using the WinCC OLE DB Provider " .

Archive Inquiry Using DataConnector Control on Web Client
If an archive inquiry is to be performed on a Web Navigator Client using DataConnector
Control in a process picture, the Connectivity Pack Client must also be installed on the web
client.

Installation on Windows Server 2003 with Activated Hyperthreading
Please note during installation:
On a computer with Windows Server 2003 and activated Hyperthreading, the installation of
Automation License Manager may sporadically be terminated with an error message.
In this case, terminate the installation.
Deactivate Hyperthreading in Bios and reinstall the Automation License Manager. To do so,
start the file " Setup.exe " located on the WinCC CD-ROM in the directory
" WinCC\setup\Products\ALM " .
After installation is complete, you may reactivate Hyperthreading.

Installation of the Examples
When installing the Connectivity Pack, the included examples will also be installed in the
path " & lt; Installation Directory & gt; \SAMPLES " .

2-2

Connectivity Pack
11/2006, Printout of the Online Help

Release Notes - Connectivity Pack

Saving Examples Prior to Deinstallation
When uninstalling the Connectivity Pack, the included examples will also be deinstalled in
the path " Installation Directory & gt; \SAMPLES " . If the examples are to be saved, you must copy
the files in this path into a different directory.

Prerequisite For Access Using WinCC OLE DB Provider
If a computer without Connectivity Pack installation is supposed to access archive data using
WinCC OLE DB Provider, this computer must have installed WinCC V6.2.

Using MS Data Transformation Services (DTS)
Access via WinCC OLE DB-Provider by using MS Data Transformation Services is currently
not released.

Error OPC_E_MAXEXCEEDED During Archive Access Using OPC
If the OPC Client requests more than 2,000 values during synchronous or asynchronous
reading of data, the request is rejected using the error message OPC_E_MAXEXCEEDED.
This limit value serves to limit the computer load and duration of the call.
This restriction does not apply if the entire time range is read.

Connectivity Station:Limited access via WinCC OLE DB-Provider
Only one WinCC CAS may be used in a project with transparent access via WinCC OLE DBProvider.
If you want to use a Connectivity Station in two projects which both contain a WinCC CAS,
you have to remove the DCF file from the previous project before you switch projects. You
can find the DCF file on the Connectivity Station in the following path:
• Siemens\AutomationProjects\ & lt; PROJECTNAME_ConnectivityStationName & gt; .DC

Connectivity Station: Changes to the configuration in Tag Management, Alarm Logging or Tag
Logging
If you change the tag configuration or Tag Logging configuration, all OPC links that access
this computer will be quit and reconnected.
Similarly, the OPC links on the WinCC Connectivity Station must be reconnected.
While changing the Alarm Logging configuration you need to restart WinCC runtime on the
local computer.

Using a Connectivity Pack Server on the Central Archive Server (CAS)
Use of a Connectivity Pack Server on the computer where Central Archive Server (CAS) is
operated is not released.

Microsoft Message Queuing Services
WinCC Connectivity Pack uses Message Queuing Services by Microsoft. MS Message
Queuing is not part of the default settings of Windows installation and may have to be
installed if necessary.
Installation will require the Windows Installation CD-ROM.

Connectivity Pack
11/2006, Printout of the Online Help

2-3

Release Notes - Connectivity Pack

Procedure for Windows 2000
1. Open the operating system Start menu and select " Settings " & gt; " Control Panel " & gt;
" Software " .
2. Click on the button " Add or remove Windows components " .
3. In the dialog " Windows Components Wizard " , select the component " Message Queuing
Services " .
4. Click " Continue " .
5. Select the " Independent Client " MSMQ type. Click " Continue " .
6. Select the " Message Queuing Does Not Access the Active Directory " setting. Click
" Continue " .
7. If the dialog " Disk " opens, insert the requested Windows Installation CD-ROM. Click
" OK " . The MS Message Queuing Services will be installed.
8. Close the dialog using the " Finish " button.

Procedure for Windows XP
1. Open the operating system Start menu and select " Settings " & gt; " Control Panel " & gt;
" Software " .
2. Click on the button " Add or remove Windows components " .
3. In the dialog " Windows Components Wizard " , select the component " Message Queuing
Services " .
4. Click on the " Details " button. The dialog box " Message Queuing " will open.
5. Activate the sub-component " Common " . Deactivate all other sub-components and
confirm by clicking " OK " .
6. If the dialog " Disk " opens, insert the requested Windows Installation CD-ROM. Click
" OK " . The MS Message Queuing Services will be installed.
7. Close the dialog using the " Finish " button.

Procedure for Windows Server 2003
1. Open the operating system Start menu and select " Settings " & gt; " Control Panel " & gt;
" Software " .
2. Click on the button " Add or remove Windows components " .
3. In the dialog " Windows Components Wizard " , select the component " Application Server " .
4. Click on the " Details " button. The dialog " Application Server " opens.
5. Select the component " Message Queuing " .
6. Click on the " Details " button. The dialog box " Message Queuing " will open.
7. Activate the sub-component " Common " . Deactivate all other sub-components and
confirm by clicking " OK " twice.
8. Click " Continue " . The MS Message Queuing Services will be installed.
9. Close the dialog using the " Finish " button.

2-4

Connectivity Pack
11/2006, Printout of the Online Help

Licenses and Open Source Software
3.1

3.1

3

Open Source Software used in this product

Open Source License Conditions
For Resellers: In order to avoid infringements of the license conditions by the reseller or the
buyer these instructions and license conditions have to be forwarded to the buyers.

Copyright Notices
Name

Copyright

Author or License

Zlib 1.2.3

Copyright ©

1995-2005 Jean-loup Gailly and Mark Adler

Xerces 2.7.0

Copyright ©

the apache software foundation. all rights reserved.

TabCtrlEx

Copyright ©

1998 RedCreek Communications

Portions of the zlib 1.2.3 distribution
are under the following copyrights:

Copyright (c) 1990-2000 Info-ZIP, Copyright (C) 1995-1996 Jean-loup Gailly and
Gilles Vollant, Copyright (C) 1995-2005 Jean-loup Gailly, Copyright (C) 1995-2005
Jean-loup Gailly and Mark Adler, Copyright (C) 1995-2005 Jean-loup Gailly, Brian
Raiter and Gilles Vollant, Copyright (C) 1995-2005 Mark Adler, Copyright (c) 1997
Christian Michelsen Research AS Advanced Computing, Copyright (c) 1997,99
Borland Corporation, Copyright (C) 1998 Brian Raiter, Copyright (C) 1998 by
Andreas R. Kleinert, Copyright (C) 1998 by Bob Dellaca, Copyright (C) 1998-2000
by Jacques Nomssi Nzali, Copyright (C) 1998-2005 Gilles Vollant, Copyright (C)
2000 Dan Higdon and Chuck Walbourn, Copyright (C) 2000-2004 Simon-Pierre
Cadieux, Copyright (C) 2002-2004 Dmitriy Anisimkov, Copyright (C) 2003 Chris
Anderson, Copyright (C) 2003-2004 Cosmin Truta, Copyright Henrik Ravn 2004.

Portions of the Xerxes 2.7.0
distribution are under the following
copyrights:

software copyright (c) 1999, IBM Corporation., copyright free software foundation,
inc., (c) international organization for standardization 1986, copyright by the
massachusetts institute of technology, year 2k copyright swat.

Connectivity Pack
11/2006, Printout of the Online Help

3-1

Licenses and Open Source Software

3.2

3.2

Siemens License Conditions

General License Conditions for Software Products for Automation and Drives
1. Supply of Software to Licensee and Granting of Rights to use the Software
1.1 These General License Conditions shall exclusively apply to the delivery of Software for
Automation and Drives to the Licensee. General terms and conditions of the Licensee shall
apply only where expressly accepted in writing by us. The scope of delivery of the Software
shall be determined by the congruent mutual written declarations of both parties. We shall
grant the Licensee rights to use the software specified in the Confirmation of Order or, if the
Licensee does not receive a Confirmation of Order, the software specified in the Certificate
of License or that specified in the Software Product Sheet, if the Licensee is instead
submitted a Software Product Sheet (hereinafter referred to as " SW " ). The Certificate of
License and the Software Product Sheet shall be collectively referred to as " CoL "
hereinafter. The Licensee shall be submitted the CoL when the SW is supplied or in
conjunction with the delivery bill. The way in which the SW is supplied is also derived directly
from the Confirmation of Order or from the SW purchase order number contained in the
Confirmation of Order, in conjunction with the associated order data of our catalog valid at
the time of the Confirmation of Order (hereinafter collectively referred to as " Order Data " ), or
from the CoL. If the Licensee does not receive a data medium, it shall be authorized to copy
the SW already available to it to the extent necessary to exercise the rights to use the SW
granted to it. The aforesaid shall apply, mutatis mutandis, to electronic supply of the software
(downloading). Where reference is made to the Order Data or the CoL in these General
License Conditions, the reference to the CoL is of significance if the Licensee has not
received a Confirmation of Order. In any case, the data contained in the Order Data is also
contained in the CoL.
1.2 The Documentation relating to the SW (hereinafter referred to as " Documentation " ) shall
be purchased separately, unless either the Order Data or CoL contain a stipulation stating
that it belongs to the scope of delivery. If the Licensee is authorized to copy the SW in
accordance with Clause 1.1, this shall also apply to the Documentation provided that it is
included in the scope of delivery.
1.3 In the event that we submit a License Key to the Licensee, which unlocks the SW
(hereinafter referred to as " License Key " ), this License Key must also be installed.
1.4 The rights granted to the Licensee with respect to the SW are based on the License
Type (see Section 2) and the Software Type (see Section 3). The license and Software
Types are detailed in the Order Data or CoL. If the SW is supplied electronically or if copying
rights are granted for it, the rights and duties specified in these General License Conditions
shall apply to the legitimately generated copies.
1.5 If the Licensee is legitimately in possession of a previous SW version/release
(hereinafter referred to as " Previous Version " ), the Licensee shall be authorized to exercise
the rights to use the SW granted to it either with respect to the SW or - if this is intended from
a technical point of view - to the Previous Version, at its own discretion (downgrading). If the
SW is an Upgrade or PowerPack in accordance with Section 4, Section 4 shall apply
additionally.
1.6 In case the Licensee obtains only the data media but no license as per the Order Data or
the CoL, any use of the SW by the Licensee is subject to the acquisition of a license
according to Section 2. Up to the acquisition of the license, the Licensee is not entitled to
supply the SW to third parties.

3-2

Connectivity Pack
11/2006, Printout of the Online Help

Licenses and Open Source Software

1.7 Insofar as the SW contains Open Source Software (hereinafter referred to as " OSS " ) the
OSS is listed in the Readme_OSS-file of the SW. The Licensee is entitled to use the OSS in
accordance with the respective license conditions of the OSS. The license conditions are
provided on the same data carrier as the SW. The license conditions of the respective OSS
shall prevail these General License Conditions with respect to the OSS. If the license
conditions of the OSS require the distribution of the source code of such OSS we shall
provide such source code on request against payment of the shipping and handling charges.
1.8 The SW may be licensed software, i.e. software which has not been developed by us
itself but which has been licensed to us by a third party (hereinafter referred to as the
" Licensor " ), e.g. Microsoft Licensing Inc. In the event that the Licensee is then forwarded the
terms and conditions stipulated by the relevant Licensor together with the SW, such terms
and conditions shall apply with respect to the Licensor's liability vis-à-vis the Licensee. Our
own liability vis-à-vis the Licensee shall be governed by these General License Conditions.

2. License Type
Depending on the License Type, the Licensee shall be granted the following rights to the
SW:
2.1 Single License (One Off License, Copy License)
The term " One Off License " or " Copy License " which may be used in the Software Product
Sheet corresponds to the term " Single License " . The following regulation shall apply to the
full scope of the One Off License / Copy License. The Licensee shall be granted the nonexclusive right, transferable in accordance with Clause 5.3 and valid for an unlimited period
of time, to install the SW on one (1) hardware device and to utilize the SW thus installed in
the manner specified in the Order Data or CoL (see " Type of Use " ).
2.2 Floating License
The Licensee shall be granted the non-exclusive right, transferable in accordance with
Clause 5.3 and valid for an unlimited period of time, to install the SW on any desired number
of the Licensee's hardware devices. The number of persons permitted to utilize the SW at
the same time ( " Users " ) can be derived from the Order Data or CoL (see " Type of Use).
2.3 Rental License
The Licensee shall be granted the non-exclusive right, transferable in accordance with
Clause 5.3 and limited in time as stipulated in the Order Data or CoL (see " Type of Use " ), to
install the SW on one (1) hardware device and to use it. If the period of use is specified in
hours, the usage decisive for the calculation of the time limit commences with the software
start-up and finishes with its shut-down. If the period of usage is specified in days, weeks or
months, the specified period, which commences in conjunction with the first SW start-up,
shall apply independently of the actual time of usage.
2.4 Trial License
The Licensee shall be granted the non-exclusive and non-transferable right to install the SW
on one (1) hardware device and to use it for validation purposes in the manner specified in
the Order Data or CoL (see " Type of Use " ). The period of usage is limited to 14 days and
commences with the SW start-up, unless a different period of usage is specified in the Order
Data or CoL.

Connectivity Pack
11/2006, Printout of the Online Help

3-3

Licenses and Open Source Software

2.5 Factory License
The Licensee shall be granted the non-exclusive right, transferable in accordance with
Clause 5.3 and valid for an unlimited period of time, to install the SW at one (1) permanent
establishment and to use it. The number of hardware devices on which it is permitted to
install and utilize the SW at this permanent establishment at the same time can be derived
from the Order Data or CoL (see " Type of Use " ). A permanent establishment is defined by its
address. Permanent establishments with different addresses are different permanent
establishments in the context of these General License Conditions, except when otherwise
stipulated in the Order Data or CoL. The Licensee shall be entitled to install the SW at a
different permanent establishment for permanent use, provided that it uninstalls the SW from
all hardware devices of the previous permanent establishment and discontinues the use of
the SW at the previous permanent establishment in total.

3. Software Type
If the Software Type is not specified in the Order Data or CoL, the rights specified in Clause
3.2 (Runtime Software) shall apply to the SW.
3.1 Engineering Software (hereinafter referred to as " E-SW " )
In the event that the Licensee uses E-SW to generate its own programs or data containing
parts of the E-SW, the Licensee shall have the right, without having to pay any license fee, to
copy and to use these parts of the E-SW as a part of its own programs or data, or to supply
them to third parties for use. In the event that such parts are supplied to third parties for use,
these parties shall be bound in writing to comply with stipulations corresponding to those in
Clauses 5.1 and 5.2 with respect to the above parts of the E-SW.
3.2 Runtime Software (hereinafter referred to as " R-SW " )
If the Licensee incorporates R-SW or any parts thereof into its own programs or data, it shall
purchase a license with respect to the R-SW each time it installs or copies - depending on
what is done first - its own programs or data containing R-SW or parts thereof, in accordance
with the relevant intended Type of Use and on the basis of the Siemens catalog valid at that
time. In the event that the Licensee supplies the specified programs or data to third parties
for their use, these parties shall be bound in writing to adhere to stipulations corresponding
to those in Section 5, with respect to the R-SW parts contained therein. The aforesaid shall
not affect the Licensee's obligation to purchase a license for the R-SW if the R-SW original is
copied. If the R-SW contains tools for parameterization/configuration and extended rights
have been granted in this regard, this will be detailed in the readme file of the R-SW.
4. Upgrade and PowerPack
If it is apparent from the Order Data or CoL, e.g. by the addition " PowerPack " or " Upgrade "
after the SW product name, that the SW is an upgrade for another software item (hereinafter
referred to as " Source License " ), the Licensee shall also have the rights to use the SW
granted to it with respect to the Source License as soon as this has been upgraded with the
Upgrade/PowerPack. The rights originally granted to the Licensee to use the Source License
end in conjunction with the upgrade measure. However, the Licensee is entitled to undo the
upgrading (downgrading) - if this is intended from a technical point of view - and to exercise
the rights to use the SW granted to it with respect to the Source Version in accordance with
Clause 1.5.

3-4

Connectivity Pack
11/2006, Printout of the Online Help

Licenses and Open Source Software

5. Further Rights and Duties of the Licensee
5.1 Unless a stipulation to the contrary relating to a specific number of copies is contained on
the data medium or in the readme file of the SW, the Licensee may generate an appropriate
number of copies of every item of SW which it is authorized to use in accordance with these
General License Conditions, where such copies shall be used exclusively for data backup
purposes. Furthermore the Licensee may only copy the SW if and insofar as it has been
granted copying rights by us in writing.
5.2 The Licensee shall not be entitled to modify, decompile or reverse engineer the SW. Nor
may it extract any individual parts unless this is permitted by mandatory copyright law.
Furthermore, the Licensee shall not be entitled to remove any alphanumeric identifiers,
trademarks or copyright notices from the SW or the data medium and, insofar as it is entitled
to make copies of the SW, shall copy them without alteration. The aforementioned regulation
shall apply accordingly to the Documentation supplied in accordance with Section 1.
5.3 The Licensee shall be entitled to transfer the right to use the SW granted to it to a third
party, provided that it concludes a written agreement with the third party in conformance with
all of the conditions contained in this Section 5 and on the proviso that it does not retain any
copies of the SW. If the Licensee has received a License Key for the SW, this key shall be
supplied to the third party together with the SW. Furthermore, the third party shall be
submitted the CoL together with these General License Conditions. The Licensee shall
submit the CoL received for the SW to us at any time, if requested.
5.4 If the SW is a PowerPack or an Upgrade, the Licensee shall keep the Certificate of
License or Software Product Sheet of the Source License and submit it to us at any time, if
requested, together with the CoL for the SW. In the event that the Licensee transfers its right
to use the PowerPack SW or Upgrade SW in accordance with Clause 5.3, it shall also
submit the Certificate of License or Software Product Sheet of the Source License to the
third party.
5.5 If the Licensee receives a data medium which, in addition to the SW, contains further
software products which are released for use, then it shall have the right to use these
released software products exclusively for validation purposes, for a limited period of time
and free of charge. The period of use shall be limited to 14 days, commencing with the first
start-up of the relevant software program unless a different period is specified e.g. in the
readme file of the relevant software product. These software products supplied exclusively
for validation purposes shall be governed, mutatis mutandis, by the stipulations contained in
these General License Conditions. The Licensee shall not be authorized to pass on these
software products separately, i.e. without the SW, to a third party.
In other respects, the terms of the purchase contract shall apply, unless below explicitly
stated otherwise for Open Source Software.

Connectivity Pack
11/2006, Printout of the Online Help

3-5

Licenses and Open Source Software

3.3

3.3

License Conditions and Disclaimers for Open Source Software

License Conditions and Disclaimers
The Software " WinCC " (hereinafter referred to as " Software " ) contains the open source
software listed below in unmodified or modified form (hereinafter referred to as " Open
Source Software " ):
Name

License

Zlib 1.2.3

Zlib license

Xerces 2.7.0

Apaches License Version 2.0

TabCtrlEx

TabCtrlEx License

The Open Source Software is provided free of charge. You are entitled to use the Open
Source Software in accordance with the respective license conditions (OSS License
Conditions) listed below. If there are discrepancies between the OSS License Conditions
and the license conditions of the Software as per clauses 2 and 3 above, the OSS License
Conditions shall prevail. In case of an infringement or breach of such OSS License
Conditions the respective licensor named in such OSS License Conditions is entitled - in
addition to ourselves - to bring forward and enforce the respective claims resulting from such
infringement or breach in its own name.
Insofar as the applicable OSS License Conditions provide for it you can order the source
code of the Open Source Software from your Siemens sales contact - against payment of
the shipping and handling charges - for a period of at least 3 years since purchase of the
Software.

Liability for Open Source Software
We are liable for the Software including the Open Source Software contained in it in
accordance with the license conditions applicable to the Software. Any liability for the Open
Source Software beyond the program flow intended for the Software is explicitly excluded.
Furthermore any liability for defects resulting from modifications to the Open Source
Software by you or third parties is excluded.
We do not provide any technical support for the Software if it has been modified.

Hinweis
Note
PLEASE READ THE BELOW LICENSE CONDITIONS CAREFULLY BEFORE USING THE
SOFTWARE. THE ACCEPTANCE OF ANY DISCLAIMER OF WARRANTY OR LIABILITY
CONTAINED IN SUCH LICENSE CONDITIONS IS A STRICT PRECONDITION FOR THE
USE OF THE OPEN SOURCE SOFTWARE.

3-6

Connectivity Pack
11/2006, Printout of the Online Help

Licenses and Open Source Software

3.4

3.4

License text of the zlib license

License Conditions for Zlib 1.2.3
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied warranty. In no event will the
authors be held liable for any damages arising from the use of this software.
Permission is granted to anyone to use this software for any purpose, including commercial
applications, and to alter it and redistribute it freely, subject to the following restrictions:
10.The origin of this software must not be misrepresented; you must not claim that you wrote
the original software. If you use this software in a product, an acknowledgment in the
product documentation would be appreciated but is not required.
11.Altered source versions must be plainly marked as such, and must not be misrepresented
as being the original software.
12.This notice may not be removed or altered from any source distribution.

Jean-loup Gailly
jloup@gzip.org

3.5

3.5

Mark Adler
madler@alumni.caltech.edu

License Conditions for Xerces 2.7.0

Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
" License " shall mean the terms and conditions for use, reproduction, and distribution as
defined by Sections 1 through 9 of this document.
" Licensor " shall mean the copyright owner or entity authorized by the copyright owner that is
granting the License.
" Legal Entity " shall mean the union of the acting entity and all other entities that control, are
controlled by, or are under common control with that entity. For the purposes of this
definition, " control " means (i) the power, direct or indirect, to cause the direction or
management of such entity, whether by contract or otherwise, or (ii) ownership of fifty
percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.

Connectivity Pack
11/2006, Printout of the Online Help

3-7

Licenses and Open Source Software

" You " (or " Your " ) shall mean an individual or Legal Entity exercising permissions granted by
this License.
" Source " form shall mean the preferred form for making modifications, including but not
limited to software source code, documentation source, and configuration files.
" Object " form shall mean any form resulting from mechanical transformation or translation of
a Source form, including but not limited to compiled object code, generated documentation,
and conversions to other media types.
" Work " shall mean the work of authorship, whether in Source or Object form, made available
under the License, as indicated by a copyright notice that is included in or attached to the
work (an example is provided in the Appendix below).
" Derivative Works " shall mean any work, whether in Source or Object form, that is based on
(or derived from) the Work and for which the editorial revisions, annotations, elaborations, or
other modifications represent, as a whole, an original work of authorship. For the purposes of
this License, Derivative Works shall not include works that remain separable from, or merely
link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
" Contribution " shall mean any work of authorship, including the original version of the Work
and any modifications or additions to that Work or Derivative Works thereof, that is
intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an
individual or Legal Entity authorized to submit on behalf of the copyright owner. For the
purposes of this definition, " submitted " means any form of electronic, verbal, or written
communication sent to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and issue tracking
systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and
improving the Work, but excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as " Not a Contribution. "
" Contributor " shall mean Licensor and any individual or Legal Entity on behalf of whom a
Contribution has been received by Licensor and subsequently incorporated within the Work.

2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby grants to You a
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to
reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and
distribute the Work and such Derivative Works in Source or Object form.

3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby grants to You a
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in
this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise
transfer the Work, where such license applies only to those patent claims licensable by such
Contributor that are necessarily infringed by their Contribution(s) alone or by combination of
their Contribution(s) with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a cross-claim or counterclaim in a
lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes
direct or contributory patent infringement, then any patent licenses granted to You under this
License for that Work shall terminate as of the date such litigation is filed.

3-8

Connectivity Pack
11/2006, Printout of the Online Help

Licenses and Open Source Software

4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof in any
medium, with or without modifications, and in Source or Object form, provided that You meet
the following conditions:
(a) You must give any other recipients of the Work or Derivative Works a copy of this
License; and
(b) You must cause any modified files to carry prominent notices stating that You changed
the files; and
(c) You must retain, in the Source form of any Derivative Works that You distribute, all
copyright, patent, trademark, and attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of the Derivative Works; and
(d) If the Work includes a " NOTICE " text file as part of its distribution, then any Derivative
Works that You distribute must include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not pertain to any part of the
Derivative Works, in at least one of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents of the NOTICE file are for
informational purposes only and do not modify the License. You may add Your own
attribution notices within Derivative Works that You distribute, alongside or as an addendum
to the NOTICE text from the Work, provided that such additional attribution notices cannot be
construed as modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or distribution of
Your modifications, or for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with the conditions stated in
this License.

5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in
the Work by You to the Licensor shall be under the terms and conditions of this License,
without any additional terms or conditions. Notwithstanding the above, nothing herein shall
supersede or modify the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.

6. Trademarks.
This License does not grant permission to use the trade names, trademarks, service marks,
or product names of the Licensor, except as required for reasonable and customary use in
describing the origin of the Work and reproducing the content of the NOTICE file.

7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and
each Contributor provides its Contributions) on an " AS IS " BASIS, WITHOUT WARRANTIES
OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any
warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or
FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any risks associated with
Your exercise of permissions under this License.

Connectivity Pack
11/2006, Printout of the Online Help

3-9

Licenses and Open Source Software

8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence), contract, or
otherwise, unless required by applicable law (such as deliberate and grossly negligent acts)
or agreed to in writing, shall any Contributor be liable to You for damages, including any
direct, indirect, special, incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor has been advised of the
possibility of such damages.

9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to offer, and
charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations
and/or rights consistent with this License. However, in accepting such obligations, You may
act only on Your own behalf and on Your sole responsibility, not on behalf of any other
Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless
for any liability incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following boilerplate notice, with the
fields enclosed by brackets " [] " replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate comment syntax for the file
format. We also recommend that a file or class name and description of purpose be included
on the same " printed page " as the copyright notice for easier identification within third-party
archives.

Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the " License " ); you may not use this file
except in compliance with the License. You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the
License is distributed on an " AS IS " BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
ANY KIND, either express or implied. See the License for the specific language governing
permissions and limitations under the License.

3-10

Connectivity Pack
11/2006, Printout of the Online Help

WinCC/Connectivity Pack

4

Introduction
Licensed access to online and archive data of WinCC is enabled with the WinCC /
Connectivity Pack.
The WinCC OLE DB Provider makes access to the process value and alarm archives
possible. Data that is stored, compressed in the database can be read as decompressed
data. The WinCC OLE DB Provider also provides analysis functions such as Minimum,
Maximum of archive tags for example.
OPC enables manufacturer-spanning communication in the automation branch via
standardized interfaces. WinCC V6.is expanded by OPC HDA 1.2 (Historical Data Access)
and OPC A & E 1.1 (Alarm & Events). WinCC also supports OPC DA in versions 2.05A and
3.0. As a result, WinCC operating as an OPC-Server can forward current process data to
other OPC clients (e.g. Microsoft Excel).
The WinCC Connectivity Station also uses OPC to access data of different WinCC stations.
The Connectivity Pack includes:
• The WinCC OLE DB Provider for directly accessing process value and alarm archives in
the SQL server database on the WinCC RT computer and on a long-term archive server.
• The tool " Archive Connector " for configuring the database access. With it, swapped out
WinCC archive databases can be connected to or disconnected for the SQL server. In
doing so, an overview of the individual database segments is generated. The Archive
Connector can monitor folders and automatically connect copied in archives.
• WinCC DataConnector for configuration and access to the process value and alarm
archives in process images.
• WinCC Connectivity Station
• License for Server OPC HDA 1.2 (Historical Data Access) for access to historical data in
the WinCC archive system.
• License for Server OPC A & E 1.1 (Alarms & Events) for forwarding and acknowledging of
messages.
• License for Server OPC XML DA 1.0 (OPC eXtensible Markup Language).
• The licenses for access to the WinCC archive databases through the WinCC OLE DBProvider or WinCC User Archive through Microsoft OLE DB.

WinCC OLE DB Provider
The WinCC OLE DB Provider is available on the following systems:
• Connectivity Pack Client
• Connectivity Pack Server
• The WinCC Station
Connectivity Pack
11/2006, Printout of the Online Help

4-1

WinCC/Connectivity Pack

Using WinCC OLE DB Provider, the Connectivity Pack Client has direct access to the
WinCC archive data in the process value and message archives.
Access may take place under various configurations of the Connectivity Pack Client:
• A WinCC software like WinCC Basis, Web Navigator Server, DataMonitor Server or
Connectivity Pack Server exists on the client computer. The Connectivity Pack Client
does not have to be installed explicitly. Licensing is provided through WinCC licenses.
• The client computer has no installation of WinCC software. Then the Connectivity Pack
Client needs to be installed on the client computer. Additionally, a WinCC/CAL must be
present.

Simultaneous access to archive and Runtime databases
The Connectivity Pack provides the function " ArchiveMonitor " . The function automatically
merges the data from runtime and archive databases of the activated WinCC project into an
SQL database " CC_ExternalBrowsing " and creates the " AMT " and " ARCHIVE " views in it.
Since these views provide all the necessary information for the WinCC OLE DB Provider, the
" CC_ExternalBrowsing " database can be used as a data source for the provider. On
deactivating WinCC runtime, views additionally created in " CC_ExternalBrowsing " are
deleted.
Since a long-term archive server does not contain any runtime databases, access to the
archive databases using the " CC_ExternalBrowsing " database is not possible.

WinCC OLE DB Provider as a " Linked Server "
The WinCC OLE DB Provider can be registered in the SQL server in the list of " Linked
Servers " . This is independent of whether the database is local or remote.
Note
When configuring WinCC OLE DB Provider as a " Linked Server " , the " WinCC OLE DB
Provider for Archives " entry must be selected in the " Provider Name " field of the " Linked
Server Properties " dialog. Activate the " AllowInProcess " checkbox in the " Provider Options "
dialog.
You will find more detailed information in the " SQL Server Books Online " under " Configuring
OLE DB Providers for Distributed Queries " .
Example of a WinCC OLE DB Provider as a Linked Server with the server name " WinCC " :
select min(realvalue) from openquery(WINCC,'Tag:R,1,''0000-00-00
00:01:00.000'',''0000-00-00 00:00:00.000''')
select * from openquery(WINCC,'Tag:R,1,''0000-00-00
00:01:00.000'',''0000-00-00 00:00:00.000''')

4-2

Connectivity Pack
11/2006, Printout of the Online Help

WinCC/Connectivity Pack

WinCC Archive Connector
The Connectivity Pack also includes the tool " Archive Connector " for the configuration of the
database access. With it, swapped out WinCC archives can be reconnected to an SQL
server. The archive data is made available again via the WinCC OLE DB Provider. With the
Archive Connector, the following functions are possible:
• Manual Connection: Locally swapped out WinCC archive databases are selected and
connected to the local SQL server.
• Manual Disconnection: Connected databases are selected and disconnected from the
SQL server.
• Automatic Connection: Local folders for swapped out WinCC archives are selected. All
archives in the selected folders are automatically connected to the SQL server when
copied in.
The Archive Connector may only be operated using a local SQL Server and a Connectivity
Pack license.
Note
If you access message archives or swapped out archives via " CC_ExternalBrowsing " , this
access may take several minutes.

WinCC DataConnector
The DataConnector provides the following functions.
• Using the DataConnector Wizard, a process picture may be configured in Graphics
Designer for an archive inquiry for message or process value archives.
• DataConnector Control will execute the archive inquiry in Runtime after opening the
process picture and will display the data found.
Inquiries using relative or absolute time ranges are possible. The result of the inquiry may be
shown in table format for messages, and in table or trend format for process values.

OPC
WinCC supplies historical data from the archive system to other applications via the WinCC
OPC HDA server. An OPC HDA client - such as a reporting tool - can specify the beginning
and the end of a time interval and specifically request the corresponding data. An OPC HDA
client can also specifically request previously processed data on the WinCC OPC HDA
server and actively affect data compression prior to data transfer.
With the WinCC OPC A & E server, a WinCC message is portrayed as an alarm. The alarm
can only be forwarded with its accompanying process values to the production or
management level of the company, where it is also acknowledged. Via filters, only selected
data is transferred.
The WinCC OPC-XML server provides the OPC-XML client with the OPC process data as a
web service. OPC-XML clients can access WinCC runtime data via any platforms as well as
via both Intranet and Internet.
Access via OPC can only take place on computers on which WinCC Runtime is running.

Connectivity Pack
11/2006, Printout of the Online Help

4-3

WinCC/Connectivity Pack

Note
For access to WinCC archive databases using OPC HDA, process values with OPC XML
and alarms with OPC A & E, a Connectivity Pack license is required on the computer with this
data. An installation of Connectivity Pack Server or Client is not required.
OPC DA is licensed with the WinCC Basic System.

WinCC Connectivity Station
The Connectivity Station allows you to access data of different WinCC stations such as
WinCC server or WinCC / Central Archive Server (CAS). The Connectivity Station is
configured in the S7 projects, which also manage these WinCC stations.
You will access the WinCC stations via an OPC client via the OPC-Server.

See also
Access Using OPC to WinCC Archives, Tags, and Messages (Page 7-8)

4-4

Connectivity Pack
11/2006, Printout of the Online Help

5

Licensing
Introduction
The WinCC / Connectivity Pack enables licensed access to online and archive data of
WinCC.
The Connectivity Pack includes licenses for access using:
• WinCC OPC HDA Server
• WinCC OPC A & E Server
• WinCC OPC XML DA Server
• WinCC OLE DB Provider
• Microsoft OLE DB

Note
Access to WinCC User Archives using Microsoft OLE DB requires a Connectivity Pack
license on the computer where the WinCC user archives are located.

WinCC Client Access License (WinCC/CAL)
A Client Access License is a license for remote access to the MS SQL Server database.
If a product of the WinCC family (WinCC Basis, Web Navigator, DataMonitor, etc.) has been
installed on the accessing computer then you do not need WinCC/CAL on this computer.
WinCC/CAL required for remote access is already included in the WinCC Basic system as
well as in the option packages, such as Web Navigator.
A WinCC/CAL is required for each computer that does not have a WinCC product installed
and which remotely accesses WinCC archive data on one or several WinCC servers, or
processes same.
The same applies for access using OPC HDA, OPC A & E or MS OLE DB Provider from
outside systems.

Connectivity Pack
11/2006, Printout of the Online Help

5-1

Licensing

5-2

Connectivity Pack
11/2006, Printout of the Online Help

Installation Connectivity Pack
6.1

6.1

6

Installation

Introduction
You can install the Connectivity Pack as follows:
• Connectivity Pack Server
• Connectivity Pack Client

See also
Installation of the Connectivity Pack Client (Page 6-2)
Installation of the Connectivity Pack Server (Page 6-1)

6.2

6.2

Installation of the Connectivity Pack Server

Introduction
The installation of the Connectivity Pack Server includes the following components:
• WinCC OLE DB Provider
• SQL Server 2005
• " Automation License Manager " for Management of WinCC Licenses
• WinCC Archive Connector
• WinCC DataConnector
• WinCC Basic Components
• Documentation
• Examples

Connectivity Pack
11/2006, Printout of the Online Help

6-1

Installation Connectivity Pack
6.3 Installation of the Connectivity Pack Client

Requirement
• Pentium III, 1 GHz, 1 Gbyte main memory
• Windows 2000 Professional SP4 (max. 3 clients)
• Windows XP Professional SP2 (max. 3 clients)
• Windows Server 2003 Service Pack 1 or Windows Server 2003 R2
• Internet Explorer V6.0 SP1 or V6.0 SP2
• For access to WinCC RT archives, WinCC V6.2 must be installed.
Note
In order to use more than 3 clients, the server version of Windows Server 2003 must be
installed, as the Workstation version is limited to 3 clients.

Installation
In order to configure a computer as Connectivity Pack Server, run the Connectivity Pack
Server setup on the computer.
From the " Install Software " menu of the installation CD-ROM, select the entry " Connectivity
Pack Server " .

Licensing
For operation of the Connectivity Pack Server, the license for the WinCC Connectivity Pack
option is required.

See also
Licensing (Page 5-1)

6.3

6.3

Installation of the Connectivity Pack Client

Introduction
The installation of the Connectivity Pack Client includes the following components:
• WinCC OLE DB Provider
• WinCC DataConnector
• SQL Connectivity Tools
• Documentation
Note
In order to install the SQL Connectivity Tools, you will need administrator rights on the
computer.

6-2

Connectivity Pack
11/2006, Printout of the Online Help

Installation Connectivity Pack
6.3 Installation of the Connectivity Pack Client

Requirement
• Windows 2000Professional SP4
• Windows Professional SP2
• Windows Server 2003 Service Pack 1 or Windows Server 2003 R2
• Internet Explorer V6.0 SP1 or V6.0 SP2

Installation
In order to configure a computer as Connectivity Pack Client, run the Connectivity Pack
Client setup on the computer.
From the " Install Software " menu of the installation CD-ROM, select the entry " Connectivity
Pack Client " .
If the client already has WinCC V6.2 installed, no additional installation of the Connectivity
Pack Client is necessary.

See also
Licensing (Page 5-1)

Connectivity Pack
System Manual, 11/2006, Printout of the Online Help

6-3

Installation Connectivity Pack
6.3 Installation of the Connectivity Pack Client

6-4

Connectivity Pack
11/2006, Printout of the Online Help

Applications
7.1

7.1

7

Use Case 1: Local Access to WinCC RT Databases

Principles
An application uses WinCC OLE DB Provider to access the local WinCC RT database.
You may locally analyze the archive data and may, for example, calculate the standard
deviation of a process value.

Software Requirements
On the WinCC station, the following licenses need to be installed:
• WinCC Basic System
• WinCC Option Connectivity Pack

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Licensing (Page 5-1)
Installation (Page 6-1)

Connectivity Pack
11/2006, Printout of the Online Help

7-1

Applications
7.2 Use Case 2: Remote Access to WinCC RT Databases

7.2

7.2

Use Case 2: Remote Access to WinCC RT Databases

Principles
The Connectivity Pack Client remotely accesses the WinCC RT database of a WinCC
station. Via the WinCC OLE DB Provider, the Connectivity Pack Client reads the data of the
process value and alarm message archives.
Since in this use case, the swapped-out WinCC archive is not accessed, the Archive
Connector does not have to connect WinCC archives to an SQL server.
You may use the Connectivity Pack Client to display, analyze, or process the data, e.g. by
exporting it to a csv file.

Software Requirements
On the WinCC station, the following licenses need to be installed:
• WinCC Basic System
• WinCC Option Connectivity Pack
The access may take place under various configurations of the Connectivity Pack Client:
• A WinCC software like WinCC Basis, Web Navigator Server, DataMonitor Server or
Connectivity Pack Server exists on the client computer. The Connectivity Pack Client
does not have to be installed explicitly. Licensing is provided through WinCC licenses.
• The client computer has no installation of WinCC software. The Connectivity Pack Client
must then be installed on the client computer. Additionally, a WinCC/CAL must be
present.

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Licensing (Page 5-1)
Installation (Page 6-1)

7-2

Connectivity Pack
11/2006, Printout of the Online Help

Applications
7.3 Use Case 3: Local Access to WinCC Archive Databases

7.3

7.3

Use Case 3: Local Access to WinCC Archive Databases

Principles
An application accesses the local archive database using WinCC OLE DB Provider. The
older archive data are copied from the WinCC RT database to a separate directory on the
same computer.
With the Archive Connector, the swapped out WinCC archives are reconnected to an SQL
Server. The archives are then available for access using WinCC OLE DB Provider.
Local archive data may be displayed, searched or analyzed, e.g. to search for process errors
or to optimize processes.

Software Requirements
The WinCC station requires the following installations:
• WinCC Basic System
• License for WinCC Basic System
• License for WinCC Option Connectivity Pack

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Licensing (Page 5-1)
Installation (Page 6-1)

Connectivity Pack
11/2006, Printout of the Online Help

7-3

Applications
7.4 Use Case 4: Remote access to WinCC archive databases

7.4

7.4

Use Case 4: Remote access to WinCC archive databases

Principles
A long-term archive server is used to secure database files of process value and message
archives, for example, in a monthly backup.
With the Archive Connector, the swapped out WinCC archives are reconnected to an SQL
Server. The archives are then available for access using WinCC OLE DB Provider.
The Connectivity Pack Client accesses the archives via the WinCC OLE DB Provider. Using
a VB application, for example, the archives may be analyzed, and process values of a
specific day may be displayed.
Note
If you access message archives or swapped out archives via " CC_ExternalBrowsing " , this
access may take several minutes.

Software Requirements
The long-term archive server requires the following to be installed:
• Connectivity Pack Server
• License for WinCC Connectivity Pack
Access may take place under various configurations of the Connectivity Pack Client:
• A WinCC software like WinCC Basis, Web Navigator Server, DataMonitor Server or
Connectivity Pack Server exists on the client computer. The Connectivity Pack Client
does not have to be installed explicitly. Licensing is provided through WinCC licenses.

7-4

Connectivity Pack
11/2006, Printout of the Online Help

Applications
7.5 Use Case 5: Local Access to WinCC User Archive
• The client computer has no installation of WinCC software. The Connectivity Pack Client
must then be installed on the client computer. Additionally, a WinCC/CAL must be
present.

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Licensing (Page 5-1)
Installation (Page 6-1)

7.5

7.5

Use Case 5: Local Access to WinCC User Archive

Principles
An application accesses the local archive WinCC user archives using the MS OLE DB
Provider.
Using a VB application, for example, you may display, search, and write back modified
values for local archive data.

Software Requirements
The WinCC station requires the following installations:
• WinCC Basic System
• License for WinCC Basic System
• License for WinCC Option Connectivity Pack

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Licensing (Page 5-1)
Installation (Page 6-1)

Connectivity Pack
11/2006, Printout of the Online Help

7-5

Applications
7.6 Use Case 6: Remote Access to WinCC User Archives

7.6

7.6

Use Case 6: Remote Access to WinCC User Archives

Principles
The Connectivity Pack Client accesses the WinCC user archives using the MS OLE DB
Provider.
Using a VB application, for example, you may display, search, and write back modified
values for archive data.

Software Requirements
The WinCC server requires the following installations:
• WinCC Basic System
• License for WinCC Basic System
• License for WinCC Connectivity Pack
Access may take place under various configurations of the Connectivity Pack Client:
• A WinCC software like WinCC Basis, Web Navigator Server, DataMonitor Server or
Connectivity Pack Server exists on the client computer. The Connectivity Pack Client
does not have to be installed explicitly. Licensing is provided through WinCC licenses.
• The client computer has no installation of WinCC software. On the client computer, no
Connectivity Pack Client needs to be installed. However, a WinCC/CAL must be present.

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Licensing (Page 5-1)
Installation (Page 6-1)

7-6

Connectivity Pack
11/2006, Printout of the Online Help

Applications
7.7 Use Case 7: Access Using WinCC OLE DB Provider While Employing DTS

7.7

7.7

Use Case 7: Access Using WinCC OLE DB Provider While Employing
DTS

Principles
WinCC OLE DB Provider may be used to access WinCC databases while employing MS
Data Transformation Services (DTS).
DTS is an integrated tool of the MS SQL server and enables data to be extracted from
various sources and its export in other formats, e.g. Excel spreadsheets, text files.
Databases are linked using OLE DB, and access to WinCC databases using WinCC OLEDB Provider. Data queries are defined in DTS in so-called packages.
The packages from DTS can be integrated into scripts in order to achieve a time-controlled
query and transfer of the data into the target format. Equally, tasks may be tied into
packages, for example, in order to initiate a notification by mail following execution of the
package.

Connectivity Pack
11/2006, Printout of the Online Help

7-7

Applications
7.8 Access Using OPC to WinCC Archives, Tags, and Messages
Using WinCC computers, access to runtime and archive databases may be established
locally or remotely. In the case of long-term archive servers, local or remote access is only
possible to the archive databases since they have no runtime databases.

Software Requirements
The WinCC station requires the following installations:
• WinCC Basic System
• License for WinCC Basic System
• License for WinCC Option Connectivity Pack
Additional information on the application of DTS may be found in Chapter " Configuring
Access With DTS " .

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Licensing (Page 5-1)
Installation (Page 6-1)
Configuring Access With DTS (Page 8-22)

7.8

7.8

Access Using OPC to WinCC Archives, Tags, and Messages

Introduction
OPC enables licensed access to online and archive data of WinCC. WinCC OPC-Servers
provide WinCC data to the OPC client through the OPC software interface. As OPC client,
any software can be implemented which is based on the respective OPC specification.

OPC DA
The WinCC OPC DA server makes the data from the WinCC project available to other
applications. These applications may be running locally or on computers linked to the
network environment. In this way WinCC tags can for example be exported to Microsoft
Excel. The WinCC-OPC-DA server and its licensing are components of the WinCC base
system.

OPC XML
Within a distributed system, WinCC clients have views of several WinCC servers. The
WinCC OPC-XML server provides the OPC-XML client with the OPC process data as a web
service. You can access the web service via the Internet using HTTP. The OPC XML client
is no longer limited to the local network. In this way, OPC XML clients can access WinCC
Runtime data via any platform as well as through an intranet or the Internet.

7-8

Connectivity Pack
11/2006, Printout of the Online Help

Applications
7.9 Transparent access to archived data

OPC HDA
Using the OPC HDA (Historical Data Access) server permits access to historical data of the
WinCC archive system.
Installations without write access permit only reading and analyzing of WinCC archive data.
Write access permits analyzing, adding, deleting, and updating of data.
An OPC HDA client may be used for analysis and evaluation of archive data and for process
controlling of archives from different OPC HDA servers.
Note
OPC HDA does not permit access to message archives. Application permits access to
process value archives only.

OPC A & E
The OPC A & E (Alarms & Events) server permits forwarding or acknowledging of WinCC
messages
An OPC A & E client, for example, may be used for analysis and joint archiving of alarms from
different OPC A & E servers.

WinCC OPC-Servers in a Redundant System
In a redundant system, the WinCC servers monitor each other during runtime for early
recognition of any server outage. The WinCC OPC-Servers make WinCC Runtime data
available to the OPC client, using the OPC software interface. An OPC client with a view of
several WinCC-OPC-Servers simultaneously, can be used for centralized monitoring of
various redundant systems.
As OPC client, any software can be implemented which is based on the respective OPC
specification.
Additional information may be found in Chapter " OPC " - OLE for Process Control.

7.9

7.9

Transparent access to archived data

Introduction
The archiving of process values and messages is used to register, manage and archive
process data from an industrial system. The registered process data are swapped out onto
the central archive server " CAS " by the WinCC stations in regular intervals. The archived
process data of a longer time period are therefore distributed to two archive databases.
The transparent access will ensure that the requested process data from the two archive
databases are combined.

Connectivity Pack
11/2006, Printout of the Online Help

7-9

Applications
7.9 Transparent access to archived data

Principle
The following screen will show the principle of transparent access using an example of a
user request for process values of the previous month:

The result of the user query is shown to the user as though the process values stem from a
data source.

Transparent access in redundant systems
With redundant systems, the transparent access functions by the same principle, but with the
following difference: If a server fails during a user query, the user query will automatically be
rerouted to the substitute server.

Transparent access with OPC
With OPC, you will have transparent access to all archive databases of the WinCC stations:
OPC-Server
OPC DA

WinCCConnectivity.OPCDAServer

OPC HDA

WinCCConnectivity.OPCHDAServer.1

OPC A & E

7-10

Server name

WinCCConnectivity.OPCAEServer.1

Connectivity Pack
11/2006, Printout of the Online Help

Applications
7.10 Functions of SQL Servers

Transparent access via OLE DB-Provider
Using OLE DB-Provider you can access process value archives in a transparent manner.
Use the following syntax for transparent access for database link:

Data Source
& lt; SYMBOLIC COMPUTER NAME & gt; ::\WinCC

Catalog
Name of the WinCC project

7.10

7.10

Functions of SQL Servers

Introduction
In the following you find a short description of important functions already implemented in
Microsoft SQL Servers.
A detailed description may be found in the respective online help " SQL Server Books
Online " . You may call up this help by opening the start menu using " Programs & gt; Microsoft
SQL Server & gt; Books Online " .

Functions
DTS
Microsoft® SQL Server™ 2000 Data Transformation Services (DTS) represents a summary
of graphic tools and programmable objects which enable extraction, transfer and merging of
data from distributed sources into one or several targets.
A description of use cases may be found in Chapters " Access Using WinCC OLE DB
Provider While Employing DTS " and " Configuring Access With DTS " .

Jobs and Alerts
A job represents a series of operations executed in sequence by the SQL Server Agent. A
job may consist of extensive functions, such as Transact SQL scripts, command line
applications and ActiveX scripts. Jobs allow the execution of repetitive or time-controlled
tasks. Through settings of displays, so-called " Alerts " , a job may automatically inform the
user of the execution status.

Connectivity Pack
11/2006, Printout of the Online Help

7-11

Applications
7.10 Functions of SQL Servers

backup
The " Backup " component of the SQL server provides important protection for critical data in
SQL server databases.
This will prevent damage caused by memory media malfunctions, user errors or the
permanent loss of a server.
Furthermore, the component can be useful for other application cases, such as the copying
of databases between different servers or the creation of a copy of a database via backup
and the subsequent restore on a different computer.

Replication
The " Replication " component enables copying, distributing, and modifying of data within the
corporate level. Therefore, the SQL server contains several methods and options for the
design of replication, implementation, monitoring, and administration, and therefore provides
the required functionality for the distribution of data and maintenance of data consistency.

Database Maintenance Plans
After creating and supplementing objects and data and their use, a maintenance of a
database may become necessary.
Therefore, it is important to create a backup of the database regularly or to create new
indices to increase the performance. These items should be taken into consideration during
creation of the database in order to minimize the effect on users, and to minimize the
required time and resources for such maintenance.
You can use a wizard and the component " Database Maintenance Plans " you can create
one or more maintenance schedules.

Linked Server
The Microsoft SQL Server allows creating a connection to OLE DB databases by using the
" Linked Server " . For example, implementation of a " Linked Server " offers the following
advantages.
• Permits access to data sets from the OLE-DB databases as well as display in table
format using Transact SQL instructions.
• Permits transmission of commands to OLE-DB data sources as well as display in table
format of the subsequent data results using Transact SQL instructions.
A description of a use case on WinCC OLE DB Provider as " Linked Server " may be found in
Chapter " WinCC / Connectivity Pack: Introduction " .

See also
WinCC/Connectivity Pack (Page 4-1)
Configuring Access With DTS (Page 8-22)
Use Case 7: Access Using WinCC OLE DB Provider While Employing DTS (Page 7-7)

7-12

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.1

8.1

8

Accessing Archive Data via OLE DB-Provider

Introduction
Using OLE DB, you have the following options for accessing WinCC archive data and for
displaying these using an external interface:

Access using WinCC OLE DB Provider
WinCC OLE DB provides access to all WinCC archive data.
Depending on the configuration, process data of WinCC are stored in compressed form.
WinCC OLE DB Provider permits transparent access even to these data.

Access with Microsoft OLE DB
Microsoft OLE DB provides access to all WinCC user archives.
Note
Microsoft OLE DB is only tested and released for access to WinCC User Archives but not to
alarm and process value archives.
Use the WinCC OLE DB Provider to access message and process value archives.

Configuration Options
For access to databases with WinCC OLE DB, you may write your own applications. For the
communication with the WinCC OLE DB Provider, applications - created with, for example,
Visual Basic, VBScript or VBA - use the ADO DB.
Note
Special characters in tag names
Please not that programming languages such as Visual Basic, VBScript or VBA only allow
the following characters in the tag names: " A...Z " , " a...z " , " 0...9 " and " _ " .
In WinCC if you use special characters such as " , " or " ; " in the tag names then the script will
be aborted with an error message. In such a case use the " Tag-ID " to access a tag with
special characters in the script name.

Connectivity Pack
11/2006, Printout of the Online Help

8-1

Access Via the OLE DB Provider
8.2 Bases of OLE DB

The Procedure in Principle
1. For access to archive data, the computer must have WinCC Basic, Connectivity Pack
Server or Connectivity Pack Client installed.
2. For swapped out archives, establish the connection between the SQL database and the
swapped out archives with the WinCC Archive Connector.
Note
WinCC RT archives in directory " & lt; Project Directory & gt; \ ArchiveManager " and the
associated subdirectories must not be connected to or disconnected from the Archive
Connector since their connection to the SQL server is managed by the WinCC Basic
system.
3. Establish the connection to the database, for example by using MS Excel or your own
application. Define the desired selection criteria and read the archive data.
4. The query result, for example, may be displayed in MS Excel or be exported as a csv file.

See also
Configuring Access With DTS (Page 8-22)
Querying the Archive Data (Page 8-9)
Establishing the connection to the archive database (Page 8-7)
WinCC Archive Connector (Page 8-4)
Bases of OLE DB (Page 8-2)

8.2

8.2

Bases of OLE DB

Introduction
Using the OLE DB interface and the associated database provider supplied by WinCC, you
have access to process value and message archives.

OLE DB
OLE DB is an open standard for a fast access to different databases. It is irrelevant whether
the database is relational or not.
The connection between the OLE DB level and the database is established through a
database provider.
OLE DB interfaces and providers are offered from various manufacturers.

8-2

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.2 Bases of OLE DB

WinCC OLE DB Provider
Using WinCC OLE DB Provider, you may directly access WinCC archive data stored in the
MS SQL server database. Depending on the configuration, process data of WinCC are
stored in compressed form. WinCC OLE DB Provider permits transparent access even to
these data.

Note
If WinCC closes a full archive and opens a new one, no data from the message and process
value archives are read momentarily via the OLE DB Provider.

Microsoft OLE DB
Microsoft OLE DB only provides access to WinCC user archives.
Access to WinCC User Archives using Microsoft OLE DB requires a Connectivity Pack
license on the computer where the WinCC user archives will be accessed. A WinCC Client
Access License is required for remote access to the MS SQL Server database.
As protection from unauthorized access using MS OLE DB, the administrator of the
databases can take appropriate actions. Additional information may be found in Chapter
" Security Settings for Access to SQL Databases Using MS OLE DB " .
Note
Microsoft OLE DB is only tested and released for access to WinCC User Archives but not to
alarm and process value archives.
Use the WinCC OLE DB Provider to access message and process value archives.

See also
Security Settings During Access to SQL Databases Using MS OLE DB (Page 9-1)
Accessing Archive Data via OLE DB-Provider (Page 8-1)
Licensing (Page 5-1)
Installation (Page 6-1)

Connectivity Pack
11/2006, Printout of the Online Help

8-3

Access Via the OLE DB Provider
8.3 WinCC Archive Connector

8.3

8.3

WinCC Archive Connector

Introduction
The WinCC " Archive Connector " is used for configuring the access to the archive database.
The tool is an integral part of WinCC DataMonitor and Connectivity Pack. With the Archive
Connector, already swapped out WinCC archives can be reconnected to an SQL Server.
DataMonitor client or WinCC OLE DB provider can then access the archives.
Functions of the WinCC Archive Connector:
• Manual Connection: Local databases may be selected and connected to the local SQL
server.
• Manual Disconnection: Connected databases may be selected and disconnected from
the SQL server.
• Automatic Connection: Local directories can be selected in which WinCC archives have
been exported. All the archives are automatically linked to the SQL servers which were
added to the selected directories from the moment change monitoring was activated.
The Archive Connector can only be operated on a local SQL server and a license for WinCC
DataMonitor or WinCC Connectivity Pack.
Once the configuration has been completed, the Archive Connector may be terminated.
Note
WinCC RT archives in directory " & lt; Project Directory & gt; \ ArchiveManager " and the associated
subdirectories must not be connected to or disconnected from the Archive Connector since
their connection to the SQL server is managed by the WinCC Basic system.
The path for the swapped out WinCC archives is set in WinCC with the Archive Configurator,
e.g. of Tag Logging, not with the WinCC Archive Connector.
If access is to be made to swapped archives which are on interchangeable media such as
tape or MOD drives, pay attention that the connection to these archives on this medium is
disconnected using the Archive Connector before changing the medium in the drive. After
changing the medium, the user should check the Archive Connector whether or not the
archives on the new medium are connected.
Configuration of the WinCC Archive Connector should be accessible to a limited circle of
people only. Therefore, access to the Tool should be protected using Windows user
authorization " Administrators " or other Windows protective measures, such as storage in a
protected directory.
Note
Use the Archive Connector to access the linked archives using the Connectivity Pack or
DataMonitor.
The following objects do not give any access to the linked archives using Archive Connector:
• WinCC Alarm Control
• WinCC Online Trend Control
• WinCC Online Table Control
• WinCC Online Function Control

8-4

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.3 WinCC Archive Connector

The " Configuration " Tab

In the " Configuration " tab, archiving folders are displayed and managed that are to be
accessed through the Web or the WinCC OLE DB Provider.
Via buttons, archiving folders can be added or removed. For each archiving folder, a
symbolic, unique name has to be assigned during the configuration.
DataMonitor client or the WinCC OLE DB-Provider use the symbolic name to access the
archive.
The name is also used for managing and connecting exported data from multiple computers
or projects.
The symbolic names must only contain SQL-syntax-permissible characters.
By activating the corresponding checkbox, all archives added to the selected folder at the
time of activation will automatically be connected to the SQL Server.

Connectivity Pack
11/2006, Printout of the Online Help

8-5

Access Via the OLE DB Provider
8.3 WinCC Archive Connector

The " Connect/Disconnect Archive " Tab

The " Connect/Disconnect Archive " tab lists all archives located in the archiving directories.
The connection status of each archive is displayed. The connection to the archives can be
established or terminated via buttons.
The archive type is shown in the " Type " field:
• " A " = Alarm Logging
• " TF " = Tag Logging (Fast)
• " TS " = Tag Logging (Slow)
The columns " From " and " To " provide information on the local time zone.
Note
The connection of multiple, swapped-out archives to the SQL server may take several
seconds.
It is not possible to connect a database file with the same name twice.
The WinCC Archive Connector connects finalized and backed up (swapped-out) archives to
the SQL server. Archives not finalized are not supported.

8-6

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.4 Establishing the connection to the archive database

Note
Archives created with SQL Server 2000 can only be connected if you remove the write
protection of the archive. Archives that are once linked can no longer be linked using the
ArchiveConnector of the Connectivity Pack versions V6.0 and V6.1 under SQL Server 2000.
In order to connect swapped out archives on CD or DVD, copy the archives to a media
where you will be able to remove the write protection.

8.4

8.4

Establishing the connection to the archive database

Introduction
For ActiveX data objects (ADO), the connection between the application and the archive
database is established by the connection object. An important parameter here is the
ConnectionString. The ConnectionString contains all necessary information for access to the
database using OLE DB Provider.

Structure of the ConnectionString
" Provider = Name of the OLE DB Providers; Catalog=Datebase name;Data
Source=Server name; "
Parameters Description
Provider

Name of the OLE DB Provider:
e.g. WinCCOLEDBProvider

Catalog

Names of the WinCC database
With WinCC RT databases, you will use database names that end in " R " .
& lt; Datenbankname_R & gt; .
The database " CC_ExternalBrowsing " can also be used.
If you have connected swapped out WinCC archives to the SQL Server via the WinCC
Archive Connector, use their symbolic name.
Note
Enter the WinCC project name for " Catalog " for transparent access; for e.g.:
" Catalog=WinCC_Project_Name " .
Note
If you access message archives or swapped out archives via " CC_ExternalBrowsing " ,
this access may take several minutes.

Connectivity Pack
11/2006, Printout of the Online Help

8-7

Access Via the OLE DB Provider
8.4 Establishing the connection to the archive database
Parameters Description
Data
Source

Server name
Local: " .\WinCC " or " & lt; Computer Name & gt; \WinCC "
Remote: " & lt; Computer name & gt; \WinCC "
Note
Enter the transparent access to the Central Archive Server and in case of redundant
servers enter the following via the OLE DB-Provider for " Data Source " :
& lt; Symbolic Computer Name & gt; ::\WinCC.
Note
Use the archive tag name to directly access an archive tag on the long-term archive
server CAS. The long-term archive server CAS returns the CAS-ID and not the archive
tag ID as ID:
& lt; SYMBOLIC COMPUTERNAME & gt; \\ & lt; Achive_Var_Name & gt;

Example Process Value and Message Archive:
In the following example, a connection object is created with subsequent opening of the
connection to the WinCC database (process value and message archive).
Set conn = CreateObject( " ADODB.Connection " )
conn.open
" Provider=WinCCOLEDBProvider.1;Catalog=CC_OpenArch_03_05_27_14_11_46
R;Data Source=.\WinCC "

Example User Archive:
In the following example, a connection object is created with subsequent opening of the
connection to the WinCC user archive.
Set conn = CreateObject( " ADODB.Connection " )
conn.open " Provider=SQLOLEDB.1; Integrated Security=SSPI; Persist
Security Info=false; Initial Catalog=CC_OpenArch_03_05_27_14_11_46R;
Data Source=.\WinCC "
Note
In order to improve performance during local access, enter " & lt; Computer Name & gt; \WinCC " as
the data source instead of " .\WinCC " .

See also
Example: Configuring Access to Archive Data Using DataConnector Wizard (Page 10-4)
Example: Configuring the Access to Archive Data Using VB (Page 10-1)
Query for User Archives (Page 8-20)
Querying Alarm Message Archives (Page 8-17)
Query for Process Values Archive (Page 8-11)

8-8

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data

8.5

8.5.1

8.5

Querying the Archive Data

Displaying Process Value Archives

Introduction
The query result is returned as the Recordset. In this chapter, the structure of Recordset for
process value archives is described.

Recordset Structure
Field Name

Type

Comment

ValueID

Integer 4 Bytes

Unique identification of Value.

Timestamp

DateTime

Time stamping

RealValue

Real 8 Bytes

Tag value

Quality

Integer 4 Bytes

QualityCode of value (e.g. " good " or " bad " ).

Flags)

Integer 4 Bytes

Internal Control Parameter

See also
Querying the Archive Data (Page 8-9)
Establishing the connection to the archive database (Page 8-7)
Accessing Archive Data via OLE DB-Provider (Page 8-1)
Bases of OLE DB (Page 8-2)

8.5.2

Querying the Archive Data

Introduction
The queries are forwarded to the database by the command object. An important parameter,
aside from " ConnectionString " , is CommandText. The CommandText transmits the query.
The result is returned as the Recordset.
In the following examples, a command object each is generated and the query transmitted
as CommandText.
In the following structure examples, CommandText also includes the ConnectionString
whose structure is described under " Establishing Connection to Archive Database " .

Connectivity Pack
11/2006, Printout of the Online Help

8-9

Access Via the OLE DB Provider
8.5 Querying the Archive Data

Structure of CommandText
Process Value Archives:
Set oRs = CreateObject( " ADODB.Recordset " )
Set oCom = CreateObject( " ADODB.Command " )
oCom.CommandType = 1
Set oCom.ActiveConnection = conn
oCom.CommandText = " TAG:R,'PVArchive\Tag1','0000-00-00
00:10:00.000','0000-00-00 00:00:00.000' "

Alarm Message Archives:
Set oRs = CreateObject( " ADODB.Recordset " )
Set oCom = CreateObject( " ADODB.Command " )
oCom.CommandType = 1
Set oCom.ActiveConnection = conn
oCom.CommandText = " ALARMVIEW:Select * FROM AlgViewEnu "

User archives
Set oRs = CreateObject( " ADODB.Recordset " )
Set oCom = CreateObject( " ADODB.Command " )
oCom.CommandType = 1
Set oCom.ActiveConnection = conn
oCom.CommandText = " SELECT * FROM UA#Test "

See also
Example: Reading Process Value Archive With WinCC OLE DB Provider (Page 10-10)
Displaying User Archives (Page 8-22)
Displaying Alarm Message Archives (Page 8-18)
Displaying Process Value Archives (Page 8-9)
Query for User Archives (Page 8-20)
Querying Alarm Message Archives (Page 8-17)
Query for Process Values Archive (Page 8-11)
Establishing the connection to the archive database (Page 8-7)
WinCC Archive Connector (Page 8-4)
Bases of OLE DB (Page 8-2)
Examples for Access Using OLE DB Provider (Page 10-1)

8-10

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data

8.5.3

Query for Process Values Archive

Principle
With the following query, a process value archive can be accessed. The data can be
selected using filter criteria. The queries are forwarded to the database by the command
object.

Syntax
TAG:R, & lt; ValueID or ValueName & gt; , & lt; TimeBegin & gt; , & lt; TimeEnd & gt; [, & lt; SQL_clause & gt; ]
[, & lt; TimeStep & gt; ]

Parameters
Parameters

Description

ValueID

Value ID from the database table
Multiple names are possible, for e.g.
" TAG:R,(ValueID_1;ValueID_2;ValueID_x), & lt; TimeBegin & gt; , & lt; TimeEnd & gt; "

ValueName

ValueName in the format 'ArchiveName\Value_Name'. The parameter & lt; ValueName & gt; must be enclosed
in single quotes.
Multiple names are possible, for e.g.
" TAG:R,('ValueName_1';'ValueName_2';'ValueName_x'), & lt; TimeBegin & gt; , & lt; TimeEnd & gt; "
Note
Please not that programming languages such as Visual Basic, VBScript or VBA only allow the following
characters in the tag names: " A...Z " , " a...z " , " 0...9 " and " _ " .
In WinCC if you use special characters such as " , " or " ; " in the tag names then the script will be aborted
with an error message. In such a case use the " Tag-ID " to access a tag with special characters in the
script name.

Timebegin

Start time in the format
'YYYY-MM-DD hh:mm:ss.msc'
While using & lt; TimeStep & gt; you must specify & lt; TimeBegin & gt; as absolute time. A relative statement or " 000000-00 00:00:00.000 " are not permitted.

Timeend

End time in the format
'YYYY-MM-DD hh:mm:ss.msc'

SQL_Clause

Filter criterion in SQL syntax:
[WHERE search_condition]
[ORDER BY {order_expression [ASC|DESC] } ]
" ORDER BY " criterion can only be used with the given sort sequence " {order_expression [ASC|DESC] } " .
Example: The following query returns all values of the tags " ValueName_1 " and " ValueName_2 " which
are below 50 or above 100.
" TAG:R,('ValueName_1';'ValueName_2'), & lt; TimeBegin & gt; , & lt; TimeEnd & gt; , 'WHERE RealValue & gt; 100 OR
RealValue & lt; 50' "

Connectivity Pack
11/2006, Printout of the Online Help

8-11

Access Via the OLE DB Provider
8.5 Querying the Archive Data
Parameters

Description

TimeStep

Values in the stated time interval are summarized, beginning with the starting time & lt; TimeBegin & gt; .
Format: 'TIMESTEP=x,y'
x = Interval in seconds
y = Aggregation type
Depending on aggregation type, the result of an interval is returned for this interval.
The following values are possible for the aggregation type.
1. Without interpolation:
If no values are present in the interval, no interval result will be returned.
1 (FIRST): First value
2 (LAST): Last value
3 (MIN): Minimum value
4 (MAX): Maximum value
5 (AVG): Average value
6 (SUM): Sum
7 (COUNT): Number of Values
2. With interpolation:
An interval result is returned for every interval. Linear interpolation is used. No extrapolation is done.
257 (FIRST_INTERPOLATED): First value
258 (LAST_INTERPOLATED): Last value
259 (MIN_INTERPOLATED): Minimum value
260 (MAX_INTERPOLATED): Maximum value
261 (AVG_INTERPOLATED): Average value
262 (SUM_INTERPOLATED): Sum
263 (COUNT_INTERPOLATED): Number of Values
Example: For TIMESTEP=60,257, an interpolated value is returned for each 60-second interval.
" TAG:R,1,'2004-07-09 09:03:00.000','0000-00-00 00:10:00.000','TIMESTEP=60,257' "

Note
& lt; TimeBegin & gt; and & lt; TimeEnd & gt; must never both be " ZERO " = " 0000-00-00 00:00:00.000 " .
In order to improve performance, use the parameter " ValueID " instead of " ValueName "
during the query. The " ValueID " may be determined from the table " Archives " .
Some applications cannot process the time in steps of 1 ms with process values which can
lead to inaccuracies.
In the " Example: chapter you will find an example in the " SplitDateTimeAndMs " VB script to
remove the milliseconds from the timestamp of process values. Reading Process Value
Archive Using WinCC OLE DB Provider. " The script is also implemented in the demo project
" OpConPack " .

Selection of an Absolute Time Interval
Reading from start time & lt; TimeBegin & gt; until the end time & lt; TimeEnd & gt; .

Example A1:
Reads the values of the ValueID 1 from start time 9:03 hours to end time 9:10 hours.
" TAG:R,1,'2004-07-09 09:03:00.000','2004-07-09 09:10:00.000' "

8-12

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data

Selection of a Relative Time Interval
Reads from beginning of recording:
& lt; TimeBegin & gt; = '0000-00-00 00:00:00.000'
Reads until end of recording:
& lt; TimeEnd & gt; = '0000-00-00 00:00:00.000'
& lt; TimeBegin & gt; and & lt; TimeEnd & gt; should both not be " ZERO " = '0000-00-00 00:00:00.000'.
Note
Enter a relative period you want to query in a linked archive database using the following
format:
• 0000-00-DD hh:mm:ss.msc
If you indicate the time frame in months, the content can be faulty, because a month can
have 28 to 31 days.

Example B1:
Reads the absolute time from " TimeBegin " to end of recording, i.e. the last archived value.
& lt; TimeBegin & gt; = '2003-02-02 12:00:00.000', & lt; TimeEnd & gt; = '0000-00-00
00:00:00.000'

Example B2:
Reads the absolute time from " TimeBegin " for the next 10 seconds.
& lt; TimeBegin & gt; = '2003-02-02 12:00:00.000', & lt; TimeEnd & gt; = '0000-00-00
00:00:10.000'

Example B3:
Reads 10 seconds backward from the absolute time from " TimeEnd " .
& lt; TimeBegin & gt; = '0000-00-00 00:00:10.000', & lt; TimeEnd & gt; = '2003-02-02
12:00:00.000'

Example B4:
Reads the values of the loast hour starting from the time of the last archived value for
multiple valueIDs (1;3;5;6).
" TAG:R,(1;3;5;6),'0000-00-00 01:00:00.000','0000-00-00
00:00:00.000' "

Connectivity Pack
11/2006, Printout of the Online Help

8-13

Access Via the OLE DB Provider
8.5 Querying the Archive Data

Example B5:
Reads the values of the last five minutes starting from the time of the last archived value for
" TAG_2 " tag from the " ArTags " archive.
" TAG:R,'ArTags\TAG_2','0000-00-00 00:05:00.000','0000-00-00
00:00:00.000' "
The following diagrams shows a possible result of this example. The query was implemented
using the Connectivity Pack Demo Project.

Multiple Return Values to a Query Using a Filter on Tag Value
Example C1:
The following query also uses the & lt; SQL_Clause & gt; parameter and returns all tag values that
have the ValueID " 3 " and " 6 " and are below 50 or above 100.
" TAG:R,(3;6), & lt; TimeBegin & gt; , & lt; TimeEnd & gt; ,'WHERE RealValue & gt; 100 OR
RealValue & lt; 50' "

8-14

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data

Query with parameter & lt; TimeStep & gt;
Example C2:
The following query uses the & lt; TimeStep & gt; parameter and returns all values of ValueID " 1 " starting from start time " TimeBegin " till 5 minutes later in intervals of " 60 " seconds with the
aggregation type " 5 " = " Average value without Interpolation " .
" TAG:R,1,'2004-10-13 17:00:00.000','0000-00-00 00:05:00.000',
'TIMESTEP=60,5' "
The following diagram shows the query result. The left table displays the archive data which
were archived in an archiving cycle of 30 seconds. The right table displays the query result.
It determines the average between two archive values at " 0 " seconds and " 30 " seconds,
displayed with the first time stamp of the averaging interval, i.e. second " 0 " .

Connectivity Pack
11/2006, Printout of the Online Help

8-15

Access Via the OLE DB Provider
8.5 Querying the Archive Data

Example C3:
The following query uses the & lt; TimeStep & gt; parameter and returns all values of ValueID " 1 "
and " 2 " - starting from start time " TimeBegin " till 2 minutes later in intervals of " 15 " seconds
with the aggregation type " 261 " = " Average value with linear Interpolation " .
" TAG:R,(1;2),'2004-10-13 17:00:00.000','0000-00-00 00:02:00.000',
'TIMESTEP=15,261' "
The following diagram shows the query result. The left table displays the archive data which
were archived in an archiving cycle of 30 seconds. The right table displays the query result.
The archive values at " 0 " and " 30 " seconds are displayed in the query result unchanged with
their time stamp. For second " 15 " , the average is formed of archive values at seconds " 0 "
and " 30 " . For the " 45 " second the average value is taken from the archive values of " 30 "
second of the same minute and the " 0 " second of the next minute.

See also
Example: Reading Process Value Archive With WinCC OLE DB Provider (Page 10-10)
Displaying Process Value Archives (Page 8-9)

8-16

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data

8.5.4

Querying Alarm Message Archives

Introduction
With the following query, an alarm message archive can be accessed. The data can be
selected using filter criteria. The queries are forwarded to the database by the command
object.
You will find information about status of messages in the WinCC Information System under
" Working with WinCC & gt; ANSI-C Function Descriptions & gt; Appendix & gt; Structure Definitions & gt;
Structure Definition MSG_RTDATA_STRUCT " .

Syntax
ALARMVIEW:SELECT * FROM & lt; ViewName & gt; [WHERE & lt; Condition & gt; ...., optional]

Parameters
Parameters

Description

ViewName

Name of the database table. The table has to be specified in the desired language.
The " ViewName " for the five European language is e.g.:
ALGVIEWDEU: German alarm message archive data
ALGVIEWENU: English alarm message archive data
ALGVIEWESP: Spanish alarm message archive data
ALGVIEWFRA: French alarm message archive data
ALGVIEWITA: Italian alarm message archive data
Note
The languages that are installed in the WinCC base system or that are configured
in the WinCC Text Library are supported. Information concerning the possible
query-languages or the respective " ViewName " can be found in the SQL-Server in
the linked alarm archives under " Views " . All languages that are supported in the
corresponding archive are shown with their IDs e.g. " GENVIEWENU " here.

Condition

Filter criterion, e.g.:
DateTime & gt; '2003-06-01' AND DateTime & lt; '2003-07-01'
DateTime & gt; '2003-06-01 17:30:00'
MsgNr = 5
MsgNr in (4, 5)
State = 2
With DateTime, only absolute time indications can be used.

Example 1:
Reads all entries of message no. 5 that were captured after July 5, 2003.
" ALARMVIEW:SELECT * FROM ALGVIEWENU WHERE MsgNr = 5 AND
DateTime & gt; '2003-07-05' "
Example 2:
Reads all messages with the time stamp between July 3, 2003 and July 5, 2003.
" ALARMVIEW:SELECT * FROM ALGVIEWENU WHERE DateTime & gt; '2003-07-03' AND
DateTime & lt; '2003-07-05' "

Connectivity Pack
11/2006, Printout of the Online Help

8-17

Access Via the OLE DB Provider
8.5 Querying the Archive Data
The following picture shows a possible result of this example. The query was implemented
using the Connectivity Pack Demo Project.

See also
Displaying Alarm Message Archives (Page 8-18)
Example: Reading Alarm Message Archive Data with WinCC OLE DB Provider (Page 10-17)

8.5.5

Displaying Alarm Message Archives

Introduction
The query result is returned as the Recordset. In this chapter, the structure of the Recordset
for alarm log archives is described.
You will find information about the status of messages in the WinCC Information System
under " Working with WinCC & gt; ANSI-C Function Descriptions & gt; Appendix & gt; Structure
Definitions & gt; Structure Definition MSG_RTDATA_STRUCT " .

Recordset Structure
Position
1
2
3

8-18

Field Name

Type

Comment

MsgNo

Integer 4 Bytes

Message number

State

Small Integer 2
Bytes

Alarm Log Status

DateTime

DateTime 8 Bytes

Time stamp of message (Date/time without
milliseconds)

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data
Position

Field Name

Type

Comment

4

MS

Small Integer 2
Bytes

Time stamp of message (milliseconds)

5

Instance

VarChar (255)

Instance Name of the Alarm Log

6

Flags1

Integer 4 Bytes

(only for internal use)

7

PValueUsed

Integer 4 Bytes

Process Values used

8 to 17

PValue1 to
PValue10

Real 8 Bytes

Numerical Process Value 1 to 10

18 to 27

PText1 to PText10

VarChar (255)

Process Value Text 1 to 10

28

ComputerName

VarChar (255)

Computer name

29

Application

VarChar (255)

Application Name

30

Comment

VarChar (255)

Comment

31

UserName

VarChar (255)

User Name

32

Counter

Integer 4 Bytes

Running Alarm Message Counter

33

TimeDiff

Integer 4 Bytes

Time difference to " Came in " status

34

ClassName

VarChar (255)

Name of the message class.

35

Type name

VarChar (255)

Name of the message type.

36

Class

Small Integer 2
Bytes

Message class ID

37

Type

Small Integer 2
Bytes

Message type ID

38 to 47

Text1 to Text10

VarChar (255)

Message Text 1 to 10

48

AG_NR

Small Integer 2
Bytes

Number of the PLC

49

CPU_NR

Small Integer 2
Bytes

Number of the CPU

50

CrComeFore

Integer 4 Bytes

Foreground Color for the " Came in " Status

51

CrComeBack

Integer 4 Bytes

Background Color for the " Came in " Status

52

CrGoFore

Integer 4 Bytes

Foreground Color for the " Went out " Status

53

CrGoBack

Integer 4 Bytes

Background Color for the " Went out " Status

54

CrAckFore

Integer 4 Bytes

Foreground Color for the " Acknowledged "
Status

55

CrAckBack

Integer 4 Bytes

Background Color for the " Acknowledged "
Status

56

LocaIID

Integer 4 Bytes

Location of the Alarm

57

Priority

Integer 4 Bytes

Priority

58

AP_type

Integer 4 Bytes

Loop-in alarm

59

AP_name

VarChar (255)

Loop-in-Alarm Function Name

60

AP_PAR

VarChar (255)

Loop-in-Alarm Screen

61

InfoText

VarChar (255)

Info text

62

TxtCame

VarChar (255)

Text came in

63

TxtWent

VarChar (255)

Text went out

64

TxtCameNWent

VarChar (255)

Text came in and went out

65

TxtAck

VarChar (255)

Text acknowledged

66

AlarmTag

Integer 4 Bytes

Message Tag

Connectivity Pack
11/2006, Printout of the Online Help

8-19

Access Via the OLE DB Provider
8.5 Querying the Archive Data
Position

Field Name

Type

Comment

67

AckType

Small Integer 2
Bytes

Acknowledgment Type

68

Params

Integer 4 Bytes

Parameters

See also
Querying the Archive Data (Page 8-9)
Establishing the connection to the archive database (Page 8-7)
Accessing Archive Data via OLE DB-Provider (Page 8-1)
Bases of OLE DB (Page 8-2)

8.5.6

Query for User Archives

Introduction
With the following query, you may use MS OLE DB Provider to access WinCC user archives.
Access may be read or write enabled in order to analyze the saved data and to modify and
save same.
The data can be selected using filter criteria. The queries are forwarded to the database by
the command object.

Syntax
Reading of Values
SELECT * FROM UA# & lt; ArchiveName & gt; [WHERE & lt; Condition & gt; ...., optional]

Writing of Values
UPDATE UA# & lt; ArchiveName & gt; . & lt; Column_n & gt; = & lt; Value & gt; [WHERE & lt; Condition & gt; ....,
optional]

Inserting a Data Set
INSERT INTO UA# & lt; ArchiveName & gt; (ID, & lt; Column_1 & gt; , & lt; Column_2 & gt; , & lt; Column_n & gt; )
VALUES ( & lt; ID_Value & gt; , Value_1,Value_2,Value_n)

Deleting a Data Set
DELETE FROM UA# & lt; ArchiveName & gt; WHERE ID = & lt; ID_Number & gt;

8-20

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data

Parameters
Parameters

Description

ArchiveName

Name of the user archive.

Condition

Filter criterion e.g.:
LastAccess & gt; '2004-06-01' AND LastAccess & lt; '2004-07-01'
DateTime & gt; '2004-06-01 17:30:00'
ID = 5
ID & gt; 3

Example 1:
Reads all data in the user archive " Test " .
SELECT * FROM UA#'Test
Example 2:
Reads all data in the user archive " Test " that were changes between June 1, 2004 and July
1, 2004.
SELECT * FROM UA#'Test WHERE LastAccess & gt; '2004-06-01' AND
LastAccess & lt; '2004-07-01'
Example 3:
Enters the value 'New_String' in the field F_STRING of the ID 3.
UPDATE UA#TEST.F_STRING = 'New_String' WHERE ID = 3
Example 4:
Inserts a data set with the ID 100.
INSERT INTO UA#Test (ID,F_Integer,F_Float,F_Double,F_String) VALUES
(100,10,'10.0','AAAA')
Example 5:
Deletes the data set with the ID 100.
DELETE FROM UA#Test WHERE ID = 100

See also
Displaying User Archives (Page 8-22)

Connectivity Pack
11/2006, Printout of the Online Help

8-21

Access Via the OLE DB Provider
8.5 Querying the Archive Data

8.5.7

Displaying User Archives

Introduction
Each user archive consists of data fields with editable properties. Each data field has
properties such as name, alias name, type, lengths, value etc. The representation of the data
fields and properties in the Editor User Archives is done in lines and columns. Therefore, we
are talking of rows instead of data fields and of columns instead of properties.
In the following, the user archive " Test " is described as a structure example. This user
archive in included in the Connectivity Pack Demo Project " OPConPack " in directory
" \Samples\DemoProject " .

Structure of User Archive " Test "
Field Name

Type

Comment

ID

Integer

Unique identification of Value.

F_Integer

Integer

Example for Value

F_Float

Float

Example for Value

F_Double

Double

Example for Value

F_String

String

Sample character sequence

See also
Querying the Archive Data (Page 8-9)
Establishing the connection to the archive database (Page 8-7)
Accessing Archive Data via OLE DB-Provider (Page 8-1)
Bases of OLE DB (Page 8-2)

8.5.8

Configuring Access With DTS

Introduction
WinCC OLE DB Provider may be used to access WinCC databases while employing MS
Data Transformation Services (DTS). DTS is an integrated tool of MS SQL Servers. Data
queries are defined in DTS in so-called packages.
The following description shows how to configure a package for implementation of DTS.

Requirements
Using WinCC computers, access to runtime and archive databases may be established
locally or remotely. In the case of long-term archive servers, local or remote access is only
possible to the archive databases since they have no runtime databases.

8-22

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data

Procedure
1. Start " SQL Server Enterprise Manager " and select an SQL server under " SQL Server
Group " . Click on the associated subdirectory " Data Transformation Services " and select
the menu item " New Package " from the pop-up menu. The dialog " DTS Package " opens.
2. Use this step to configure the data source.
Select the menu item " Other Connection... " in the " Connection " menu. The " Connection
Properties " dialog is opened.
Select the entry " WinCC OLE DB Provider for Archives " in the field " Data Source " and
click the " Properties " button. The dialog " Data Link Properties " opens.
Enter " .\WinCC " as a data source in the " Data Source " field. The entry for " Location "
remains empty.
Enter the desired Runtime database under " Enter the initial catalog to use: " such as
" CC_ProjName_04_07_14_11_10_01R " or " CC_ExternalBrowsing " . The correct spelling
of the name may be found in " SQL Server Enterprise Manager " in the " Databases "
directory.

Close all dialogs using the " OK " button.

Connectivity Pack
11/2006, Printout of the Online Help

8-23

Access Via the OLE DB Provider
8.5 Querying the Archive Data
Note
In order to improve performance during local access, enter " & lt; Computer Name & gt; \WinCC "
as the data source instead of " .\WinCC " .
3. Use the following steps to configure the data destination. The example uses a text file.
Select the menu item " Text File (Destination) " in the " Connection " menu in the dialog
" DTS Package " .
The " Connection Properties " dialog is opened. In the field " File Name " , enter the name of
the text file to which data are to be exported. Using the " Properties " button, you may
optionally specify format parameters for the data to be exported.
Close the dialog by clicking on the " OK " button.
Two symbols for the data source and the target will be displayed in the dialog " DTS
Package " .
4. Now, configure the transformation of data.
Click in the background of the " DTS Package " so that neither of the two symbols is
selected.
Select the menu item " Transform Data Task " in the " Task " menu. The mouse cursor
changes and displays an additional text.
First, click the symbol " WinCC OLE DB Provider for Archives " to indicate the source and
after that the symbol of the text file " Text File (Destination) " to specify the target of the
transformation.
After that, an arrow from the source to the target will be displayed in the dialog " DTS
Package " .

8-24

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.5 Querying the Archive Data
5. Double-click on the arrow to open the dialog " Transform Data Task Properties " .
Activate the " SQL Query " option in the " Source " tab. Enter the desired query conditions.
For example, the query " Tag:R,1,'0000-00-00 00:00:00.000','0000-00-00 00:10:00.000'
reads values of ValueID " 1 " for the first 10 minutes of archiving. Additional information on
the syntax may be found in Chapter " Query for Process Value Archives " .

Switch to the " Destination " tab and exit the dialog " Define Columns " without entries by
clicking " Execute " .
Switch to the " Transformations " tab and enter a name, e.g. " DTSTransformation_1 " . The
entries for " Source " and " Destination " on this tab should be connected with arrows.
Close the dialog by clicking the " OK " button.
6. Save this newly created DTS package and execute it by clicking the " Execute " button.
The data will be saved in the text file in the specified format.

See also
Use Case 7: Access Using WinCC OLE DB Provider While Employing DTS (Page 7-7)

Connectivity Pack
11/2006, Printout of the Online Help

8-25

Access Via the OLE DB Provider
8.6 Analysis Functions for Messages and Process Values

8.6

8.6.1

8.6

Analysis Functions for Messages and Process Values

Analysis Functions for Messages and Process Values

Introduction
Using WinCC / Connectivity Pack, different analysis functions are available for query of
archived messages and process values. The analysis is triggered by a query with
parameters for different aggregate functions. Calculation of the aggregate function is
performed on the Connectivity Pack server, and only the result is transferred to the client.
Additional information on CommandText and ConnectionString which are used in the
following examples may be found under " Establishing Connection to Archive Database " and
" Querying Archive Data " .

Analysis Functions for Messages
The analysis query for message archives returns a specific recordset which contains
configuration and runtime data for each message as well as results of the aggregate
functions.
The returned recordset for analysis queries of message archives is not identical to the
recordset of normal queries of message archives. Additional information may be found in
Chapter " Display of Message Archives for Analysis Queries " .
For each message, the following aggregate functions are calculated. The column
descriptions of the result list are placed in parenthesis.
• Sum of message frequency ( " FreqOfAlarm " )
• Cumulative duration from " Message Came In " until " Message Went Out "
( " CumDurationComeGo " )
• Average duration from " Message Came In " until " Message Went Out "
( " AvDurationComeGo " )
• Cumulative duration from " Message Came In " until initial acknowledgment
( " CumDurationComeAckn1 " )
• Average duration from " Message Came In " until initial acknowledgment
( " AvDurationComeAckn1 " )
• Cumulative duration from " Message Came In " until second acknowledgment
( " CumDurationComeAckn2 " )
• Average duration from " Message Came In " until second acknowledgment
( " AvDurationComeAckn2 " )

8-26

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.6 Analysis Functions for Messages and Process Values

Syntax
For the calculation of aggregate functions for messages, the following command is issued to
WinCC OLE DB Provider.
" AlarmHitView: SELECT * FROM & lt; ViewName & gt; [WHERE & lt; Condition & gt; ] "
Dabei sind :
& lt; ViewName & gt; = Name der Datenbanktabelle in der gewünschten Sprache z.B.
ALGVIEWENU für Englisch.
[WHERE & lt; Condition & gt; ] = optional filter criterion as WHERE condition in the SQL syntax.
Additional information on the syntax may be found in Chapter " Query for Message Archives " .

Example:
The example provides results of the aggregate functions for all messages for the time range
between 7/15/2004 12:00 o'clock and 12:15 o'clock from the " ALGVIEWENU " database.
ConnectionString:
" Provider=WinCCOLEDBProvider.1;Catalog=CC_OpenArch_03_05_27_14_11_46
R;Data Source=.\WinCC "
CommandText:
" AlarmHitView: SELECT * FROM ALGVIEWENU WHERE DateTime & gt; '2004-07-15
12:00:00' AND DateTime & lt; '2004-07-15 12:15:00' "

Analysis Functions for Process Values
The analysis of process values returns the result of an aggregate function. Only one
aggregate function can be calculated in a query.
The following aggregate functions are available for process values.
• MIN (minimum)
• MAX (maximum)
• AVG (average)
• SUM (sum of all values)
• COUNT (count of process values)
• COUNTER (number of entries with value " 1 " , e.g., query of binary tags)
• STDEV (statistical standard deviation)
• VAR (statistical variance)

Syntax
For the calculation of aggregate functions for process values, a query is issued to the MS
SQL OLE DB Provider and the procedure " cp_TagStatistic " from database " SQL Server
Master " is executed.
Note
The analysis functions for process values in transparent access function only with
Connectivity Station on a client with own project.

Connectivity Pack
11/2006, Printout of the Online Help

8-27

Access Via the OLE DB Provider
8.6 Analysis Functions for Messages and Process Values
The following parameters are transferred to the " cp_TagStatistic " procedure.
cp_TagStatistic @P1,@P2,@P3[,@P4]
Where:
" @P1 " = database name (e.g. WinCC Runtime database or symbolic name for the directory
with the swapped out archives). During transparent access, instead of the database name
use the WinCC project name.
" @P2 " = WinCC OLE DB-Provider String for process values.
" @P3 " = desired aggregate function.
" @P4 " = & lt; Symbolic computer name & gt; ::\\WinCC (required only during transparent access).
Additional information on the syntax of parameters " @P1 " and " @P2 " may be found in
Chapter " Query for Process Value Archives " .

Example:
This query will return the average of process values in the time range between 5/17/2004
12:00 and 13:00 for ValueID " 17 " from database " TestDB " .
ConnectionString:
" Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=master ;Data Source=.\WinCC "
CommandText:
" cp_TagStatistic 'TestDB','TAG:R,17,''2004-05-17 12:00:00'',''200405-17 13:00:00''','AVG' "

Example of transparent access
This query delivers the average process value in the time range between 14.09.2006 10:00
hrs and 11:00 hrs for the ValueID " 7 " from the " WinCCProj " .
ConnectionString:
" Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security
Info=False;Initial Catalog=master ;Data Source=.\WinCC "
CommandText:
" cp_TagStatistic 'WinCCProj','TAG:R,7,''2006-09-14
10:00:00'',''2006-09-14 11:00:00''','AVG','Symb_WinCCProj::\WinCC' "

See also
Querying the Archive Data (Page 8-9)
Establishing the connection to the archive database (Page 8-7)
Display of Message Archives for Analysis Queries (Page 8-29)
Using OLE DB Interface of Connectivity Station (Page 12-6)

8-28

Connectivity Pack
11/2006, Printout of the Online Help

Access Via the OLE DB Provider
8.6 Analysis Functions for Messages and Process Values

8.6.2

Display of Message Archives for Analysis Queries

Introduction
The analysis query for message archives returns a specific recordset which contains
configuration and runtime data for each message as well as results of the aggregate
functions.
This Recordset is not identical to the Recordset of normal queries of message archives.

Recordset Structure for Analysis of Message Archives
Upon query of message archives using the analysis function " AlarmHitView " , the result is
returned as recordset with the following structure.
Position

Field Name

Type

Comment

1

MsgNo

Integer 4 Bytes

Message number

2

State

Small Integer 2
Bytes

Alarm Log Status

3

DateTime

DateTime 8
Bytes

Time stamp of message (Date/time without
milliseconds)

4

MS

Small Integer 2
Bytes

Time stamp of message (milliseconds)

5

Instance

VarChar (255)

Instance Name of the Alarm Log

6

Flags1

Integer 4 Bytes

(only for internal use)

7

Counter

Integer 4 Bytes

Running Alarm Message Counter

8

TimeDiff

Integer 4 Bytes

Time difference to " Came in " status

9

ClassName

VarChar (255)

Name of the message class.

10

Type name

VarChar (255)

Name of the message type.

11

Class

Small Integer 2
Bytes

Message class ID

12

Type

Small Integer 2
Bytes

Message type ID

13 to 22

Text1 to Text10

VarChar (255)

Message Text 1 to 10

23

AG_NR

Small Integer 2
Bytes

Number of the PLC

24

CPU_NR

Small Integer 2
Bytes

Number of the CPU

25

CrComeFore

Integer 4 Bytes

Foreground Color for the " Came in " Status

26

CrComeBack

Integer 4 Bytes

Background Color for the " Came in " Status

27

CrGoFore

Integer 4 Bytes

Foreground Color for the " Went out " Status

28

CrGoBack

Integer 4 Bytes

Background Color for the " Went out " Status

29

CrAckFore

Integer 4 Bytes

Foreground Color for the " Acknowledged "
Status

30

CrAckBack

Integer 4 Bytes

Background Color for the " Acknowledged "
Status

31

Priority

Integer 4 Bytes

Priority

32

AP_type

Integer 4 Bytes

Loop-in alarm

Connectivity Pack
11/2006, Printout of the Online Help

8-29

Access Via the OLE DB Provider
8.6 Analysis Functions for Messages and Process Values
Position

Field Name

Type

Comment

33

AP_name

VarChar (255)

Loop-in-Alarm Function Name

34

AP_PAR

VarChar (255)

Loop-in-Alarm Screen

35

InfoText

VarChar (255)

Info text

36

TxtCame

VarChar (255)

Text came in

37

TxtWent

VarChar (255)

Text went out

38

TxtCameNWent

VarChar (255)

Text came in and went out

39

TxtAck

VarChar (255)

Text acknowledged

40

AckType

Small Integer 2
Bytes

Acknowledgment Type

41

FreqOfAlarm

Integer 4 Bytes

Sum of message frequency

42

CumDurationComeGo

Integer 4 Bytes

Cumulative duration from " Message Came
In " until " Message Went Out "

43

AvDurationComeGo

Real 8 Bytes

Average duration from " Message Came In "
until " Message Went Out "

44

CumDurationComeAck
n1

Integer 4 Bytes

Cumulative duration from " Message Came
In " until initial acknowledgment

45

AvDurationComeAckn1

Real 8 Bytes

Average duration from " Message Came In "
until initial acknowledgment

46

CumDurationComeAck
n2

Integer 4 Bytes

Cumulative duration from " Message Came
In " until second acknowledgment

47

AvDurationComeAckn2

Real 8 Bytes

Average duration from " Message Came In "
until second acknowledgment

See also
Analysis Functions for Messages and Process Values (Page 8-26)

8-30

Connectivity Pack
11/2006, Printout of the Online Help

Security Settings During Access to SQL Databases
Using MS OLE DB

9

Introduction
Using MS OLE DB, users may access SQL databases, such as WinCC User Archives, and
may modify same. It is therefore possible for unauthorized users to do so. As protection from
unauthorized access, the administrator must take suitable measures.

Principles
One option for access protection is to create a user or user group on the SQL server for
access to SQL databases. This user or user group will then be assigned certain
authorizations for access to SQL databases.
This may use local or global Windows user groups on the SQL server to organize such
access authorizations in SQL.
Alternatively, Windows users can be transferred to the SQL server - either directly as a
Windows user or as individually defined SQL users.
Part of the security structure of an SQL server are the so-called " Server Roles " . This
organizes users into groups for administrative purposes, similar to Windows. " Server Roles "
are used to assign server-wide security settings to a login or if there are no corresponding
Windows user groups.
A detailed description may be found in the respective online help " SQL Server Books
Online " . You may open this help from the start menu using " Programs & gt; Microsoft SQL
Server & gt; Books Online & gt; Administering SQL Server & gt; Managing Security " .

See also
Bases of OLE DB (Page 8-2)

Connectivity Pack
11/2006, Printout of the Online Help

9-1

Security Settings During Access to SQL Databases Using MS OLE DB
8.6 Analysis Functions for Messages and Process Values

9-2

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.1

10.1

10

Examples for Access Using OLE DB Provider

Overview
The following examples demonstrate different ways of displaying and analyzing archive data.

See also
Example: Analyzing Process Value Archives with a VB Application (Page 10-14)
Example: Analyzing Alarm Message Archives With a VB Application (Page 10-22)
Example: Analyzing Alarm Message Archives in the WinCC Project (Page 10-19)
Example: Reading Alarm Message Archive Data with WinCC OLE DB Provider (Page 10-17)
Example: Comparing Measured Value Profiles in the WinCC Project (Page 10-13)
Example: Analyzing Process Value Archives in WinCC Project (Page 10-8)
Example: Reading Process Value Archive With WinCC OLE DB Provider (Page 10-10)
Example: Configuring Access to Archive Data Using DataConnector Wizard (Page 10-4)
Example: Configuring the Access to Archive Data Using VB (Page 10-1)

10.2

10.2

Example: Configuring the Access to Archive Data Using VB

Introduction
The following example shows how to configure a tabular display with Microsoft Controls. You
may also use other Controls or program your own.

Requirements
Archive files are local on the computer and must be connected to the SQL server, e.g., using
the WinCC Archive Connector.

Connectivity Pack
11/2006, Printout of the Online Help

10-1

Examples for Access Using OLE DB Provider
10.2 Example: Configuring the Access to Archive Data Using VB

Procedure
1. In Visual Basic Editor, create a new form which will be used for displaying the archive
data.
2. In Visual Basic Editor, select the menu commands " Project " & gt; " Components " .
3. Activate the Controls that you want to use, e.g. an " MS Data Grid Control " and an " MS
ADO Data Control " .
The respective symbols are displayed in the tool collection.
4. In your form, create an " MS Data Grid Control " for tabular display of archive data, and an
" MS ADO Data Control " for navigation within the tabular display.
5. Mark the MS Data Grid Control and select the entry " Adoc1 " in the property window under
" DataSource " in order to link the two controls.
6. Mark the MS ADO Data Control and click the button " ... " n the Property window under
" Connection String " .
This will open the " Property pages " dialog.

7. Click on the " Create " button next to the entry " Use Connection Character Sequence " .
The dialog " Data Link Properties " opens.
8. On the " Provider " tab, select " WinCC OLE DB Provider for Archives " and click on " Next " .
9. In the tab " Connection " , enter the data source in the field " DataSource " : & lt; Computer
name & gt; \WinCC.
Test the connection by clicking on the button " Test Connection " .
Select the " Extended " tab. After that, switch to the " All " tab without further changes. This
step is necessary to correctly set all parameters for the subsequently created connection
character set.

10-2

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.2 Example: Configuring the Access to Archive Data Using VB
10.In the " All " tab, enter the name of the WinCC database in the field " Catalog " . The
database name can be found in the SQL Enterprise Manager at " SQL Server Group " & gt;
" & lt; Computer Name & gt; \WinCC " & gt; " Databases " & gt; " & lt; Database name_R & gt; " .
If the project is active, only use database names that end with " R " .
If you have connected swapped out WinCC archives to the SQL Server via the WinCC
Archive Connector, use the symbolic name of the database or the swap out directory.
Confirm your settings with " OK " .
11.Mark the MS ADO Data Control and click the button " ... " n the Property window under
" RecordSource " . This will open the " Property pages " dialog.
For command type select the setting " 1 - adCmdText " and enter a valid statement such
as TAG:R,1,'0000-00-00 00:10:00.000','0000-00-00 00:00:00.000' in the field " Command
text (SQL) " .

12.Confirm your entries with " OK " and start Visual Basic Runtime.

Connectivity Pack
11/2006, Printout of the Online Help

10-3

Examples for Access Using OLE DB Provider
10.3 Example: Configuring Access to Archive Data Using DataConnector Wizard

10.3

Example: Configuring Access to Archive Data Using DataConnector
Wizard

10.3

Introduction
The following example shows how to configure a tabular display of process values using the
DataConnector Wizard in WinCC Graphics Designer.
Alternatively, you may also use the DataConnector Wizard to configure the display of
messages or graphical display of process values.

Requirements
• WinCC Basic system and Connectivity Pack are installed.
• Archive files are connected to the desired SQL server, e.g., using WinCC Archive
Connector.

Procedure
1. Open Graphics Designer and select the entry " Create New Picture " in the
" DataConnector " menu. A new process picture opens and the dialog " DataConnector Select Object " is displayed.
2. For this example, select the option " Display Tag Values in Table Form " and then click the
" Continue " button.

10-4

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.3 Example: Configuring Access to Archive Data Using DataConnector Wizard
3. The dialog " DataConnector - Connection Properties " opens.
Enter the name of the server in the " Server " field that contains the desired interlinked
databases. The name of the local computer is prescribed.
Select the desired database in the " Database " field. The currently connected databases
of the selected server are available.

Click " Continue " .

Connectivity Pack
11/2006, Printout of the Online Help

10-5

Examples for Access Using OLE DB Provider
10.3 Example: Configuring Access to Archive Data Using DataConnector Wizard
4. The dialog " DataConnector - Time window " will open.
Select the desired time frame from which the data should be displayed, e.g. " Relative
time window " . Prescribed is a time window for the previous hour. Change the
specifications as needed, e.g., in the field " Starting point forward " to the value " 0000-0000 01:00:00 " and in the field " Duration " to the value " 0000-00-00 01:00:00 " in order to
display the previous hour. The value in the " Duration " field cannot be larger than the
value in field " Starting point forward " .

Click " Continue " .
5. The dialog " DataConnector - Select Archive Tag " opens.
Select at least one archive tag.

Click on the " Finish " button.

10-6

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.3 Example: Configuring Access to Archive Data Using DataConnector Wizard
6. The DataConnector Wizard will insert several elements into the opened process picture.
The selected server, the database and the time frame are displayed in the static text
fields at the top.
Next to them there will be a text with the selected archive tags and the selection field for
the archive tag.
As per the selection " Display tag values as tables " , a data grid control, an ADO data
control and a button are inserted below them.
Save the process screen.
In order to change the configured values, open this process picture and select the entry
" Modify existing connection " in the " DataConnector " menu. The Wizard will restart and
you may change the configured values.

7. Start WinCC Runtime and open this process picture with the database query. The query
will be initially executed directly upon opening of the process picture.
In Runtime, the data found will be displayed in tabular form in Data Grid Control, and you
may navigate within the table using ADO Data Control.
With more than one configured archive tags, the tag, whose values are to be displayed
can be chosen in the selection field.
The displayed data can be updated via the " Update " button, for example, if the most
recent hour was indicated as a relative time frame.

Connectivity Pack
11/2006, Printout of the Online Help

10-7

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives

See also
Querying Alarm Message Archives (Page 8-17)
Query for Process Values Archive (Page 8-11)

10.4

10.4.1

10.4

Examples: Analyzing Process Value Archives

Example: Analyzing Process Value Archives in WinCC Project

Introduction
This example shows the operation of the WinCC project " OPConPack " . The WinCC project
contains the process value archives used. The queries are created for this archive data. The
query result is displayed in tabular form with time stamp, value and quality code. Statistics
show the number, the average value, the sum and the standard deviation of the process
values. The result can be exported as a csv file.
The WinCC project " OPConPack " may be installed at the same time as the Connectivity
Pack Server. The project can also be copied to the hard drive of your computer at a later
time from the folder " Samples\DemProject " located on the " Connectivity Pack " CD-ROM.

Requirement
• The computer has been entered as a server in the computer list of the WinCC project.
• The WinCC project " OPConPack " has been activated.
• The folder " D:\out " has been created.

10-8

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives

Procedure
1. Click on the button " Simulator on " . The simulator supplies the tags with values.
2. Click on the button " Tags archive 1x " . The dialog box " Database Taglogging1 " will open.

How to Analyze Process Value Archives
1. Click on the button " Q:1,Now-1h " .
The buttons " Q:,.. " are linked to queries. The corresponding query is shown in the field
below the buttons. " Q:1 " and " Q:2 " represent the queried ValueID, respectively.
- " Q:1,Now-5m " and " Q:2,Now -5m " return as result the process values of the last 5
minutes.
" Q:1,Now-1h " returns tthe process values of the last hour as a result.
" Q:2,Date " returns the process values of a certain day as a result.
2. Click on the button " Execute " . Confirm the next dialog. The query will then be performed.
3. The data will be displayed with a time stamp (DateTime), process value (RealValue) and
quality code (TypeName) in a table.
The " Count " provides the number of the selected process values. The field " Sum "
contains the sum of all process values. The field " Avg " contains the average value of the
column " RealValue " and the field " Std " the standard deviation.
4. Click on the button " Export Csv " . Confirm the next dialog. The query results are stored in
the csv file " OutTAGEXP1.csv " in the folder " D:\out " .

Connectivity Pack
11/2006, Printout of the Online Help

10-9

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives

10.4.2

Example: Reading Process Value Archive With WinCC OLE DB Provider

Introduction
In this example, the values of the last 10 minutes of the tag " Tag_1 " are read from the local
WinCC RT database. The data is displayed in a ListView with a time stamp, value and
quality code. The output of values is limited to 100 (constant NMAX = 100).
The example does not include error processing.

Procedure
1. Create a WinCC tag named " Tag_1 " .
2. Create a process value archive named " ArTags " . Connect the WinCC tag " Tag_1 " with
the process value archive.
3. Create a Visual Basic project. Connect the MS Windows Common Controls 6.0 " ListView
Control " with the name " ListView1 " . The columns in the ListView are created by the script.
Set the property " View " to the option " 3 - lvwReport " on the ListView control.
4. Create a " CommandButton " . Copy in the script from the section " Example Script " below.
5. In the script, adjust the name of the WinCC Runtime database
" CC_OpConPac_04_10_01_10_36_36R " to your own project.
The database name can be found in the SQL Enterprise Manager at " SQL Server Group "
& gt; " & lt; Computer Name & gt; \WinCC " & gt; " Databases " & gt; " & lt; Database name_R & gt; " .
6. Activate WinCC Runtime and start the VB application.
7. Click on the " CommandButton " .

Example Script
Option Explicit
Const NMAX = 100
Private Sub Command1_Click()
Dim sPro As String
Dim sDsn As String
Dim sSer As String
Dim sCon As String
Dim sSql As String
Dim conn As Object
Dim oRs As Object
Dim oCom As Object
Dim oItem As ListItem
Dim m, n, s, nRec
Dim strDateTime As String
Dim iMS As Long

'1.1 Make connection string for ADODB

10-10

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives
sPro
sDsn
sSer
sCon

=
=
=
=

" Provider=WinCCOLEDBProvider.1; "
" Catalog=CC_OpConPac_04_10_01_10_36_36R; "
" Data Source=.\WinCC "
sPro + sDsn + sSer

' 1.2 Define command text in sSql (relative time)
sSql = " TAG:R,'ArTags\Tag_1','0000-00-00 00:10:00.000','0000-00-00
00:00:00.000' "
MsgBox " Open with: " & vbCr & sCon & vbCr & sSql & vbCr
' 2.1 Make connection
Set conn = CreateObject( " ADODB.Connection " )
conn.ConnectionString = sCon
conn.CursorLocation = 3
conn.Open
' 2.2 Use command text for query
Set oRs = CreateObject( " ADODB.Recordset " )
Set oCom = CreateObject( " ADODB.Command " )
oCom.CommandType = 1
Set oCom.ActiveConnection = conn
oCom.CommandText = sSql
' 2.3 Fill the recordset
Set oRs = oCom.Execute
m = oRs.Fields.Count
nRec = NMAX
' 3.0 Fill standard listview object with recordset
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(1).Name), 2500
DateTime

'

ListView1.ColumnHeaders.Add , , " MS " , 1500
Milisecond

'

ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(0).Name), 1500
VarID

'

ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(2).Name), 1500
RealValue

'

ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(3).Name), 1500
Quality

'

ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(4).Name), 1500
Flags

'

If (m & gt; 0) Then
oRs.MoveFirst
n = 0

Connectivity Pack
11/2006, Printout of the Online Help

10-11

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives
Do While (Not oRs.EOF And n & lt; nRec)
n = n + 1
SplitDateTimeAndMs oRs.Fields(1).Value, strDateTime, iMS
Milisecond from DateTime

'Split

s = FormatDateTime(strDateTime, 2) & " " &
FormatDateTime(strDateTime, 3)
Set oItem = ListView1.ListItems.Add()
oItem.Text = s
oItem.SubItems(1) = iMS
oItem.SubItems(2) = oRs.Fields(0).Value
oItem.SubItems(3) = FormatNumber(oRs.Fields(2).Value, 4)
oItem.SubItems(4) = Hex(oRs.Fields(3).Value)
oItem.SubItems(5) = Hex(oRs.Fields(4).Value)
oRs.MoveNext
Loop
oRs.Close
Else
End If
Set oRs = Nothing
conn.Close
Set conn = Nothing
End Sub
Sub SplitDateTimeAndMs(dtDateTimeWithMs_in, strDateTime_out,
strMs_out)
Dim diff
Dim dtTemp
Dim lTemp As Long
lTemp = 86400000 '24 * 60 * 60 * 1000
diff = (CDbl(dtDateTimeWithMs_in) CDbl(CDate(CStr(dtDateTimeWithMs_in)))) * lTemp
If (diff & lt; 0) Then
diff = 1000 + diff
dtTemp = CDbl(dtDateTimeWithMs_in) - diff / lTemp
strDateTime_out = CDate(dtTemp)
Else
strDateTime_out = CDate(dtDateTimeWithMs_in)
End If
strMs_out = " 00 " & Round(diff)
strMs_out = Right(strMs_out, 3)
End Sub

10-12

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives

Note
To improve the performance, note the following information:
-For DataSource, enter " & lt; Computer name & gt; \WinCC " instead of " .\WinCC " .
-For the query, use " ValueID " instead of " ArchiveName & gt; \ & lt; Tag name & gt; " . In the example script
under Item 1.2, the expression 'ArTags\Tag_1' should be replaced by " ValueID " .

See also
Displaying Process Value Archives (Page 8-9)
Query for Process Values Archive (Page 8-11)
Querying the Archive Data (Page 8-9)
Establishing the connection to the archive database (Page 8-7)

10.4.3

Example: Comparing Measured Value Profiles in the WinCC Project

Introduction
This example shows how a comparison of measured value profiles can be configured. To
keep the WinCC project simple, only measured value profiles from a single and not two
process value archives are compared. From the local WinCC RT database, the process
values of the tag with the ID = 1 are selected. For the comparison, the process values are
read time-delayed. The query results are exported in two csv files.
The WinCC project " OPConPack " may be installed at the same time as the Connectivity
Pack Server. The project can also be copied to the hard drive of your computer at a later
time from the folder " Samples\DemProject " located on the " Connectivity Pack " CD-ROM.

Requirement
• The computer has been entered as a server in the computer list of the WinCC project.
• The WinCC project " OPConPack " has been activated.
• The folder " D:\out " has been created.

Procedure
1. Click on the button " Simulator on " . The simulator supplies the tags with values.
2. Click on the button " Tags archive 2x " .

How to Analyze Process Value Archives
1. In the area " Database Taglogging1 " , click the " Q:1,Now-1h " button. Click on the button
" Execute " .
2. In the area " Database Taglogging2 " , click on the button " Q:1,Now-5m " . Click on the
button " Execute " .

Connectivity Pack
11/2006, Printout of the Online Help

10-13

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives
3. The data will be displayed with a time stamp (DateTime and milliseconds), process value
(RealValue), and quality code (Quality) in tabular form.

4. The field " Std " contains the standard deviation. You can now compare the standard
deviation of the databases TagLogging1 and TagLogging2 with each other.
5. Click on the button " Export Csv " . Confirm the next dialog. The query result of the
database TagLogging1 is exported in the csv file " OutTAGEXP1.csv " . The query result of
the database TagLogging2 is exported in the csv file " OutTAGEXP2.csv " .

10.4.4

Example: Analyzing Process Value Archives with a VB Application

Introduction
This example shows the operation of the VB application " WinCCDBPr " . This application
contains several query examples. The query result is displayed in ListView with time stamp,
value, and quality code. Statistics show the number, the average value, the sum and the
standard deviation of the process values. The results are exported in a csv file.
The VB application " WinCCDBPr " may be installed at the same time as the Connectivity
Pack Server. The VB application can also be installed from the " Connectivity Pack " CD-ROM
at a later time. For this, double-click on the file " setup.exe " in the folder
" \Samples\VB_Sample " .
You will find the sources for this example in the directory
" \Samples\VB_Sample\Sourcecode " . The directory " \Samples\VB_Sample " contains Tag
Logging databases for testing.

10-14

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives

Requirement
• The folder " D:\out " has been created.
• The desired, swapped-out databases of Tag Logging must be connected to the SQL
server, e.g., using the Archive Connector.
• The VBA application " WinCCDBP " has been installed and started.

Procedure
1. From the " Database " menu, select the entry " 1.Connect " . The dialog box " Enter Server
and Database " will open.

For the local access, activate the radio button " Localhost " . For the remote access,
activate the radio button " Remote " . Enter the server name in the field " Remote " .
2. In the area " Connect to database " , the database can be directly specified or searched for.
Activate the option " Search for backup database " . Click on the button " Search " . The
dialog box " WinCC Database Example - [Select the Data ...] " will open.
3. Highlight the archive database and click on the button " Connect " .
4. From the " Database " menu, select the entry " 2.TagLogging " .

Connectivity Pack
11/2006, Printout of the Online Help

10-15

Examples for Access Using OLE DB Provider
10.4 Examples: Analyzing Process Value Archives
5. Via the button " Next Example " , the various query examples can be accessed.
The query is shown in the field above the button. The following query examples are
available:
TAG:R,1,'0000-00-00 00:01:00','0000-00-00 00:00:00'
TAG:R,(1;2),'0000-00-00 00:30:00.000','0000-00-00 00:00:00.000'
TAG:R,1,'0000-00-00 01:00:00.000','0000-00-00 00:00:00.000'
TAG:R,2,'0000-00-00 00:05:00.000','0000-00-00 00:00:00.000'
TAG:R,3,'0000-00-00 00:05:00.000','0000-00-00 00:00:00.000'
In addition, an example for the query of the current day will be displayed while the VBA
application automatically suggests the date of the current and the subseqent day.
(Format: TAG:R,1,' & lt; Date & gt; ',' & lt; Date+1 & gt; ' )
6. Click on the button " Execute " . The query will then be performed. The data will be
displayed in a table. The display field above the buttons will show the number of selected
process values.
In order to check whether the query was performed without errors, click the button " Show
ERR " . The display field will show errors occurred, if any.
7. Click the " Statistics " button.
The statistical values for the performed query will be displayed in the display field:
– N = number of selected process values
– Sum = sum of all process values
– Avg: = average of process values
– Sta = Standard deviation
8. Click on the button " Export(csv) " . The query result is exported in the file " WCCTAG.csv "
in the folder " D:\out " .
9. Click on the button " Show Connection " . The display field will show the ConnectionString
and the query.

See also
Displaying Process Value Archives (Page 8-9)
Query for Process Values Archive (Page 8-11)

10-16

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives

10.5

10.5.1

10.5

Examples: Analyzing Alarm Message Archives

Example: Reading Alarm Message Archive Data with WinCC OLE DB Provider

Introduction
In this example, a time interval of 10 minutes is read from the alarm message archive data.
The data are displayed in a ListView Control with a time stamp, message number, status and
message type.
The example includes simple error handling.

Procedure
1. Create a Visual Basic project. Connect the MS Windows Common Controls 6.0 ListView
Control to the name " ListView1 " .
2. The columns in the ListView are created by the script.
3. Create a " CommandButton " . Copy in the script from the section " Example Script " below.
4. In the script, change the name of the WinCC Runtime database
" CC_OpenArch_03_05_27_14_11_46R " to that of your own project.
The database name can be found in the SQL Enterprise Manager at " SQL Server Group "
& gt; " & lt; Computer Name & gt; /WinCC " & gt; " Databases " & gt; " & lt; Database name_R & gt; " .
5. This example uses " AlgViewEnu " . If you want to read the alarm message archive data of
another language, this entry needs to be modified.
6. Activate WinCC Runtime. start the VB application.
7. Click on the " CommandButton " .

Example Script
Dim
Dim
Dim
Dim
Dim

sPro
sDsn
sSer
sCon
sSql

As
As
As
As
As

String
String
String
String
String

Dim
Dim
Dim
Dim

conn As Object
oRs As Object
oCom As Object
oItem As ListItem

Dim m, n, s
On Error GoTo ErrorHandlerA
'1.1 Make connection string for ADODB

Connectivity Pack
11/2006, Printout of the Online Help

10-17

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives
sPro
sDsn
sSer
sCon

=
=
=
=

" Provider=WinCCOLEDBProvider.1; "
" Catalog=CC_OpenArch_03_05_27_14_11_46R; "
" Data Source=.\WinCC "
sPro + sDsn + sSer

' 1.2 Define command text in sSql
sSql = " ALARMVIEW:Select * FROM AlgViewEnu WHERE DateTime & gt; '2003-0730 11:30:00'
AND DateTime & lt; '2003-07-30 11:40:00' "
'sSql = " ALARMVIEW:Select * FROM AlgViewEnu WHERE MsgNr = 5 "
'sSql = " ALARMVIEW:Select * FROM AlgViewEnu "
MsgBox " Open with: " & vbCr & sCon & vbCr & sSql & vbCr
' 2.1 Make connection
Set conn = CreateObject( " ADODB.Connection " )
conn.ConnectionString = sCon
conn.CursorLocation = 3
conn.Open
' 2.2 Use command text for query
Set oRs = CreateObject( " ADODB.Recordset " )
Set oCom = CreateObject( " ADODB.Command " )
oCom.CommandType = 1
Set oCom.ActiveConnection = conn
oCom.CommandText = sSql
' 2.3 Fill the recordset
Set oRs = oCom.Execute
m = oRs.Fields.Count
' 3.0 Fill standard listview object with recordset
ListView1.ListItems.Clear
ListView1.ColumnHeaders.Clear
ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(2).Name), 140
ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(0).Name), 60
ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(1).Name), 60
ListView1.ColumnHeaders.Add , , CStr(oRs.Fields(34).Name), 100
If (m & gt; 0) Then
oRs.MoveFirst
n = 0
Do While Not oRs.EOF
n = n + 1
If (n & lt; 100) Then
s = Left(CStr(oRs.Fields(1).Value), 23)
Set oItem = ListView1.ListItems.Add()
oItem.Text = CStr(oRs.Fields(2).Value)
oItem.SubItems(1) = CStr(oRs.Fields(0).Value)

10-18

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives
oItem.SubItems(2) = CStr(oRs.Fields(1).Value)
oItem.SubItems(3) = CStr(oRs.Fields(34).Value)
End If
oRs.MoveNext
Loop
oRs.Close
Else
End If
Set oRs = Nothing
conn.Close
Set conn = Nothing
ErrorHandlerA:
MsgBox Err.Description
Note
In order to improve performance, enter " & lt; Computer name & gt; /WinCC " in DataSource instead
of " .\WinCC " .
The output of the values is limited to 100 (n & gt; 100).
The times indicated refer to system time.

See also
Establishing the connection to the archive database (Page 8-7)
Displaying Alarm Message Archives (Page 8-18)
Querying Alarm Message Archives (Page 8-17)
Querying the Archive Data (Page 8-9)

10.5.2

Example: Analyzing Alarm Message Archives in the WinCC Project

Introduction
This example shows the operation of the WinCC project " OpConP " . The WinCC project
contains the archive databases used. The queries are created for this archive data. The
query result is displayed in tabular form. The result can be exported as a csv file. A list
contains information about the frequency and duration of the alarms.
The WinCC project " OPConPack " may be installed at the same time as the Connectivity
Pack Server. The project can also be copied to the hard drive of your computer at a later
time from the folder " Samples\DemProject " located on the " Connectivity Pack " CD-ROM.

Connectivity Pack
11/2006, Printout of the Online Help

10-19

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives

Requirement
• The computer has been entered as an available server in the computer list of the WinCC
project.
• The WinCC project " OPConPack " has been activated.
• The folder " D:\out " has been created.

Procedure
1. Click on the button " Simulator on " . The simulator supplies the tags with values.

.
2. Click on the button " Alarms archive " . The dialog box " Database Alarms " will open.

3. The field " DSN " contains the name of the WinCC RT database. The field " Server "
contains the server name.

10-20

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives

How to Analyze Alarm Message Archive Data
1. Click on the button " " F:'Date1' & lt; D & lt; 'Date2' " .
The buttons " F:... " are linked to queries. The respective query is displayed in the field
below the buttons.
- " F:All " returns all messages as a result.
- " F:MsgNr=5 " returns the messages of message no. 5 as a result.
- " F:State=2 " returns the messages with message status 2 as a result.
- " F:'Date1' & lt; D & lt; 'Date2' " returns the messages generated between July 3, 2003 and July
5, 2003.
2. Click on the button " Execute " . The following dialog box will open.

In this dialog box, the ConnectionString and query used are output. Close the dialog by
clicking on the " OK " button. The query will then be performed.
3. The data is displayed with a time stamp (DateTime), alarm message number (MsgNr),
alarm message state (State) and alarm message class name (TypeName) in a table.

4. The field " Count " contains the number of the alarm messages. The fields " Avg " , " Sum "
and " Std " are displayed, but are irrelevant for this example.
5. Click on the button " Csv + Hitlist " . Confirm the next dialog. The query results are stored in
the csv file " ALGEXP.csv " in the folder " D:\out " .
Connectivity Pack
11/2006, Printout of the Online Help

10-21

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives
6. The data are shown in tabular form. The column " CNT " indicates how many times the
alarm message was pending. The column " Total " indicates how long the alarm message
was pending in total.

10.5.3

Example: Analyzing Alarm Message Archives With a VB Application

Introduction
This example shows the operation of the VB application " WinCCDBPr " . This application
contains several query examples. The query result is displayed in tabular form. The result
can be exported as a csv file. A list contains information about the frequency and duration of
the alarms.
The VB application " WinCCDBPr " may be installed at the same time as the Connectivity
Pack Server. The VB application can also be installed from the " Connectivity Pack " CD-ROM
at a later time. For this, double-click on the file " setup.exe " in the folder
" \Samples\VB_Sample " .
You will find the sources for this example in the directory
" \Samples\VB_Sample\Sourcecode " .

Requirement
• The folder " D:\out " has been created.
• The desired, swapped-out databases of Alarm Logging must be connected to the SQL
server, e.g., using the Archive Connector.
• The VBA application " WinCCDBP " has been installed and started.

10-22

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives

Procedure
1. From the " Database " menu, select the entry " 1.Connect " . The dialog box " Enter Server
and Database " will open.

For the local access, activate the radio button " Localhost " . For the remote access,
activate the radio button " Remote " . Enter the server name in the field " Remote " .
2. In the area " Connect to database " , the database can be directly specified or searched for.
Activate the option " Search for backup database " .
3. Click on the button " Search " . The dialog box " WinCC Database Example - [Select the
Data ...] " will open.

4. Highlight the archive database and click on the button " Connect " .

Connectivity Pack
11/2006, Printout of the Online Help

10-23

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives
5. From the " Database " menu, select the entry " 3.Alarms " .

6. Via the button " Next Example " , the various query examples can be accessed. The query
is shown in the field below the button. The time intervals can be adjusted.
The following query examples are available:
– ALARMVIEW:SELECT * FROM ALGVIEWDEU
– ALARMVIEW:SELECT * FROM ALGVIEWDEU WHERE DateTime & gt; '2003-07-01' AND
DateTime & lt; '2003-08-01'
– ALARMVIEW:SELECT * FROM ALGVIEWDEU WHERE State=2
– ALARMVIEW:SELECT * FROM ALGVIEWDEU WHERE DateTime & gt; '2003-08-01'
– ALARMVIEW:SELECT * FROM ALGVIEWDEU WHERE TimeDiff & gt; 100
7. Click on the button " Execute " . The query will then be run. The data will be displayed in a
table. In the upper field, the number of the selected alarm messages is shown.
8. Click the button " Statistics " .
The upper field will display how often and how long in total the message number 2 was
present.
9. Click on the button " Export(csv) " . The query result is exported in the file " WCCALA.csv " in
the folder " D:\out " .
10.Click on the button " Show Connection " . In the upper field, the ConnectionString and the
query are shown.

10-24

Connectivity Pack
11/2006, Printout of the Online Help

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives
11.From the " Database " menu, select the entry " Statistics/Csv " .

Click on the button " HitList " . The data are shown in tabular form. The column " CNT "
indicates how many times the alarm message was pending. The column " Total " indicates
how long the alarm message was pending in total. As the database, the csv file
" WCCALA.csv " is used.

See also
Displaying Alarm Message Archives (Page 8-18)
Querying Alarm Message Archives (Page 8-17)

Connectivity Pack
11/2006, Printout of the Online Help

10-25

Examples for Access Using OLE DB Provider
10.5 Examples: Analyzing Alarm Message Archives

10-26

Connectivity Pack
11/2006, Printout of the Online Help

11

Performance Data
Introduction

The following tables show the times required for accessing the archive databases using
WinCC OLE DB Provider. The values were measured in a test system using a Connectivity
Pack Server and a connected Client. The archive databases located on the server were
connected using the Archive Connector.
• Server: Intel Pentium 4; 3,2GHz; Windows Server 2003; 1024 MB RAM
Client: Intel Pentium 4; 3,2GHz; Windows XP SP1; 1024 MB RAM
• Data were read from a Visual Basic application using ADO.
• Network connection: Ethernet 100MBit/s
• The times measured do not include the display of data.
The times are indicated in milliseconds.
Note
Differently structured and compressed data or database segments varying in number and
size can result in different access times.
Also, the number of archive tags and the reading of the tag values from different archives
affects the access times.

Archive " Tag Logging Fast "
Number of Measured
Values

Local Access Time (Server)

Remote Access Time (Client)

100

63

188

1000

78

219

5000

93

234

10000

140

266

20000

219

360

50000

421

563

100000

765

937

Connectivity Pack
11/2006, Printout of the Online Help

11-1

Performance Data

Archive " Tag Logging Slow "
Number of Measured
Values

Local Access Time (Server)

Remote Access Time (Client)

100

62

79

1000

98

125

5000

219

234

10000

328

328

20000

562

563

40000

1047

1227

50000

1289

1621

100000

2515

2678

Local Access Time (Server)

Remote Access Time (Client)

Archive " Alarm Logging "
Number of Alarm
Messages
100

125

203

206

10000

1073

1093

50000

5118

4964

100000

11-2

109

1000

16160

10330

Connectivity Pack
11/2006, Printout of the Online Help

Connectivity Station
12.1

12.1

12

Basics of the Connectivity Station

Introduction
With the Connectivity Station, you can access WinCC stations with server packages from a
central computer without the WinCC software. The WinCC stations can be accessed through
two different interfaces:
• OPC interfaces of the Connectivity Station
• OLE DB interface of the Connectivity Pack
The access options include different functions.

OPC interfaces of the Connectivity Station
The Connectivity Station provides interfaces via which you can access the following content
with an OPC client:
• OPC DA server: Tags, such as process values
• OPC HDA server: Archives process values
• OPC-A & E server: Messages

Licensing
You need the " WinCC Connectivity Station " license to use the OPC interfaces of the
Connectivity Station on a computer without WinCC installation.
If you only use the OPC interfaces of a WinCC installation, you only need the " Connectivity
Pack " license.
The following table shows the rules:
New: WinCC-independent installation Conventional installation: OPC with WinCC
at Connectivity Station
OPC DA

" WinCC Connectivity Station " license

No license required

OPC HDA

" WinCC Connectivity Station " license

" WinCC Connectivity Pack " license

OPC A & E

" WinCC Connectivity Station " license

" WinCC Connectivity Pack " license

Connectivity Pack
11/2006, Printout of the Online Help

12-1

Connectivity Station
12.1 Basics of the Connectivity Station

OLE DB interface of the Connectivity Pack
The Connectivity Pack server or Connectivity Pack client necessary for the operation of the
Connectivity Station provides an additional OLE DB interface. You can access messages
and tags via such OLE DB interfaces.

Transparent access to archived data
The Connectivity Station supports the transparent access to the archive databases of WinCC
stations.

Installation and Configuration
You will need the following to install the Connectivity Station:
• PC with Connectivity Pack Server or Connectivity Pack Client
In order to configure a computer as a Connectivity Station, run the Connectivity Pack client
setup on the computer.
From the " Install Software " menu of the installation CD-ROM, select the entry " Connectivity
Station " .
After the installation, you can set up the access to the WinCC stations with the following
program:
• SIMATIC Manager of STEP 7.
• SIMATIC NCM PC Manager of the SIMATIC NET Edition 2006

12-2

Connectivity Pack
11/2006, Printout of the Online Help

Connectivity Station
12.1 Basics of the Connectivity Station
The figure below provides an overview of the configuration steps for the Connectivity Station:

See also
Bases of OLE DB (Page 8-2)
Licensing (Page 5-1)
Transparent access to archived data (Page 7-9)
Use of OPC interface of the Connectivity Station (Page 12-4)
Using OLE DB Interface of Connectivity Station (Page 12-6)

Connectivity Pack
11/2006, Printout of the Online Help

12-3

Connectivity Station
12.2 Functionality of the Connectivity Station

12.2

12.2.1

12.2

Functionality of the Connectivity Station

Use of OPC interface of the Connectivity Station

Principles
The Connectivity Station includes the WinCC OPC-Server through which you can access
WinCC stations with server packages, using the OPC client.
You can use the OPC client locally on the Connectivity Station or on a separate computer.
The OPC client requires DCOM access rights to the Connectivity Station.

Server name of the OPC-Servers
The data exchange between the OPC client and the Connectivity Station takes place via the
OPC. The following WinCC OPC-Servers are integrated into the Connectivity Station.
WinCC OPC-Server
OPC DA

WinCCConnectivity.OPCDAServer

OPC HDA

WinCCConnectivity.OPCHDAServer.1

OPC A & E

12-4

Server name

WinCCConnectivity.OPCAEServer.1

Connectivity Pack
11/2006, Printout of the Online Help

Connectivity Station
12.2 Functionality of the Connectivity Station

Supported OPC Standards
The Connectivity Station supports the following OPC standards:
• OPC DA 1.00 Specification
• OPC DA 2.05a Specification
• OPC DA 3.00 Specification
• OPC AE 1.10 Specification
• OPC HDA 1.20 Specification

Transparent access to archived data
With OPC, you have transparent access to all archive databases of the WinCC stations:

See also
Basics of the Connectivity Station (Page 12-1)
Access Using OPC to WinCC Archives, Tags, and Messages (Page 7-8)
Transparent access to archived data (Page 7-9)

Connectivity Pack
11/2006, Printout of the Online Help

12-5

Connectivity Station
12.2 Functionality of the Connectivity Station

12.2.2

Using OLE DB Interface of Connectivity Station

Principles
The Connectivity Station can only be used, if there is a Connectivity Pack Server or a
Connectivity Pack Client installed. The WinCC OLE DB provider of the Connectivity Pack
Server/Client provides an OLE DB interface. You can access messages and tags via such
OLE DB interfaces.

Access to databases with OLE DB
For access to databases with WinCC OLE DB, you may write your own applications. For the
communication with the WinCC OLE DB Provider, applications - created with, for example,
Visual Basic, VBScript or VBA - use the ADO DB.
Note
Use of Connectivity Station on a client with own project
If you use the Connectivity Station on a client with own project and use the OLE-DB
interface, then observe the following:
You can only access those WinCC stations, which you entered during the configuration
phase of the Connectivity Station. Connectivity Station does not use the server packages
available on the client.

12-6

Connectivity Pack
11/2006, Printout of the Online Help

Connectivity Station
12.3 Configuring Connectivity Station in S7-Project

Transparent access to archived data
With OLE DB, you can only access process value archives transparently.
Note
Enter the WinCC project name for " Catalog " for transparent access; for e.g.:
" Catalog=WinCC_Project_Name " .

See also
Basics of the Connectivity Station (Page 12-1)
Transparent access to archived data (Page 7-9)
Analysis Functions for Messages and Process Values (Page 8-26)

12.3

12.3

Configuring Connectivity Station in S7-Project

Introduction
In order to set up the Connectivity Station, you will add a new " SIMATIC PC Station " to the
system configuration. This " SIMATIC PC Station " receives the properties of the Connectivity
Station by configuring the application " SPOSA Application " .
Depending on the project type, one of the following objects will be created in the " SPOSA
Application " .
• " Connectivity Station_(s) " in the " STEP 7 " project type.
• With project type " STEP 7 " , this is the object " Open_PCS7_Station_(n) " .
In the following description, the project type " STEP 7 " and the respective object name are
used.

Requirements
• The required software for the Connectivity Station is installed on the Connectivity Station
PC.
• The system configuration contains WinCC stations with server packages.

Procedure
The configuration procedure for the Connectivity Station consists of the following steps:
1. Create and configure SIMATIC PC Station
2. Assign WinCC Station
3. Transfer Connectivity Station

Connectivity Pack
11/2006, Printout of the Online Help

12-7

Connectivity Station
12.3 Configuring Connectivity Station in S7-Project

Create and configure SIMATIC PC Station
1. Select the project directory in the navigation window in the SIMATIC Manager. Select the
entry " Insert New Object & gt; SIMATIC PC STATION " in the popup menu.
A new object, " SIMATIC PC Station " will be inserted into the navigation window and will
remain selected.
2. Select the entry " Open object " in the popup menu of the SIMATIC PC Station.
The Editor " HW Config " will be opened and the new PC station will be displayed as a
blank central rack.
3. Select the entry " SPOSA Application " in the module catalog in the directory " SIMATIC PC
Station & gt; HMI " . Insert the selected module by Drag & Drop into an open slot of the central
rack.
4. Select the menu command " Station & gt; Save and translate " .
5. Select the menu command " Station & gt; Exit " to close " HW Config " .

Assign WinCC Station
1. Using the " SPOSA Application " , navigate to the " Connectivity Station " icon in the
directory of the new PC station. Select the " Assign OS Server... " option in the
" Connectivity Station " shortcut menu.
The " Assignment of OS Server for Open_TIA_Station " dialog is opened.
2. Select the WinCC stations in the table in the column " OS Information " , whose data the
Connectivity Station is to gain access to. Close the dialog by clicking on the " OK " button.
3. Select the " Connectivity Station " icon in the navigation window. Select the " Object
properties " option on the context menu.
The " Properties - TIA application " dialog appears: " Connectivity Station " is opened.
4. Change to " Destination System " tab and enter the path to the Connectivity Station PC in
the " Path " field.
As an alternative, you may open a selection dialog via the " Browse... " button and search
for the computer in the network.
After you have entered the computer name, you click on the " Apply " button. The directory
" Automation Projects " will be appended to the computer name.
Close the dialog by clicking the " OK " button.

Transfer Connectivity Station
1. Check whether the " Connectivity Station " icon is clicked in the directory of the new PC
station in the navigation window.
2. Select the " Target System & gt; Load " option in the popup menu. Acknowledge the message
after exiting this process.

Result
A computer in the hardware configuration in the S7 project is supplemented and configured
for the Connectivity Station. The required project data has been transferred to this computer.

12-8

Connectivity Pack
11/2006, Printout of the Online Help

Connectivity Station
12.4 Accessing WinCC data with the Connectivity Station

12.4

12.4

Accessing WinCC data with the Connectivity Station

Introduction
The Connectivity Station allows access to the data of different WinCC stations by means of
an OPC client. For this, the OPC client must simply connect to the Connectivity Station.
The data exchange between the OPC client and the Connectivity Station takes place via the
OPC. The following WinCC OPC-Servers are integrated into the Connectivity Station.
OPC-Server

Server name

OPC DA

WinCCConnectivity.OPCDAServer

OPC HDA

WinCCConnectivity.OPCHDAServer.1

OPC A & E

WinCCConnectivity.OPCAEServer.1

Requirements
• The software for the Connectivity Station is installed on the Connectivity Station PC.
• The Connectivity Station is configured in the S7 project and the project data is transferred
to the computer of the Connectivity Station.
• An OPC client in accordance with the OPC specifications is available.

The Procedure in Principle
The following description depicts the basic procedure.
1. Start the OPC client on the PC.
2. Select the OPC-Server according to the desired data.
The same names as the ones in the above table apply to the WinCC OPC-Server.
3. Define which data should be transferred, e.g. tags.

Result
The OPC client is connected to the Connectivity Station and receives the WinCC data.

See also
Examples for Access Using OLE DB Provider (Page 10-1)
Access Using OPC to WinCC Archives, Tags, and Messages (Page 7-8)
Establishing the connection to the archive database (Page 8-7)

Connectivity Pack
11/2006, Printout of the Online Help

12-9

Connectivity Station
12.4 Accessing WinCC data with the Connectivity Station

12-10

Connectivity Pack
11/2006, Printout of the Online Help

Index
A

C

Access protection for SQL database, 9-1
Aggregate functions for analysis, 8-26
AlarmHitView, 8-26, 8-29
ALARMVIEW, 8-17
Analysis functions, 8-26
Alarm Message Archives:, 8-26, 8-29
Process value archives, 8-26
Recordset with the analysis of message
archives, 8-29
Application, 7-1, 7-2, 7-3, 7-4, 7-5, 7-6
Access to local WinCC Archive Database, 7-3
Access to local WinCC RT Database, 7-1
Access to local WinCC user archives, 7-5
Access Using OPC, 7-8
Access via WinCC OLE DB Provider with
DTS, 7-7, 7-11
Remote Access to WinCC Archive
Databases, 7-4
Remote Access to WinCC RT Databases, 7-2
Remote Access to WinCC User Archives, 7-6
Archive Connector, 4-1
Archive data, 8-1, 8-9, 8-17, 8-20
Access via WinCC OLE DB Provider, 8-1
Access via WinCC OLE DB Provider with
DTS, 7-7
Configuring access using DataConnector
Wizard, 10-4
Configuring access with Visual Basic, 10-1
Query, 8-9, 8-17, 8-20
Archive database, 8-7
Linking, 8-7
Archive tag
on ~ directly access long-term archive server,
8-8

CAL, 5-1
Client Access License, 5-1
CommandText, 8-9
Configuring
Connectivity Station, 12-7
ConnectionString, 8-7
Connectivity Pack, 4-1, 6-1
Archive Connector, 4-1, 8-4
Database Access, 8-4
Installation, 6-1
Licensing, 5-1
MS OLE DB Provider, 4-1
OPC, 4-1
Performance Data, 11-1
Use of OLE DB interface, 12-6
WinCC OLE DB Provider, 4-1
Connectivity Station
Accessing WinCC stations, 12-9
basics, 12-1
Configuring, 12-7
Installing, 12-2
License, 12-1
Supported OPC Standards, 12-5
Use of OPC interface, 12-4
cp_TagStatistic, 8-26

D
Database Access, 8-4
DataConnector, 4-1
Day
R, 8-11
DTS, 7-7
Configuring access via WinCC OLE DB and
DTS, 8-22

B
basics
Connectivity Station, 12-1

Connectivity Pack
11/2006, Printout of the Online Help

E
Example:, 10-1, 10-8, 10-10, 10-13, 10-14, 10-17,
10-19, 10-22
Analyzing in a WinCC Project, 10-8, 10-19

Index - 1

Index

Analyzing with VB appliation, 10-14, 10-22
Read message archive, 10-17
Reading Process Value Archives, 10-10

I
Installation, 6-1, 6-2
Connectivity Pack Client, 6-2
Installing
Connectivity Station, 12-2

L
Licensing
Connectivity Station, 12-1
Linked Server, 4-1
Long-term archive server
Direct access to archive tags, 8-8

Message Archive, 8-17
Process value archive, 8-11
User archive, 8-20
Process value archive, 8-9, 8-11, 10-8, 10-10,
10-13, 10-14
Access with Visual Basic, 10-1, 10-10
Analyzing in a WinCC Project, 10-8
Analyzing with VB appliation, 10-14
Comparing process value profiles, 10-13
Configuring access using DataConnector
Wizard, 10-4
display in Visual Basic Runtime, 10-10
Displaying data, 8-9
Poll, 8-11
Querying archive data, 8-9
Recordset, 8-9

R
Recordset, 8-9, 8-18

M
Message Archive, 8-9, 8-17, 10-17, 10-19, 10-22
Access with Visual Basic, 10-1, 10-17
Analyzing in a WinCC Project, 10-19
Analyzing with VB appliation, 10-22
Configuring access using DataConnector, 10-4
Displaying data, 8-18
Querying archive data, 8-9, 8-17, 10-17
Recordset, 8-18
MS OLE DB, 8-2

O
OLE DB
Transparent access, 12-7
OLE DB interface
Connectivity Pack, 12-6
OPC, 4-1
Transparent access, 12-5
OPC interface
Connectivity Station, 12-4
OPC Standards
supported ~ by the Connectivity Station, 12-5
OPC-Server
Server names, 12-4
Open Source Software, 3-1

P

S
Server names
WinCC OPC-Server, 12-4
SQL database, 9-1
Swapped out WinCC archives on removable
media, 8-4

T
the Connectivity Station
Accessing WinCC station via, 12-9
The WinCC Station
Access ~ via the Connectivity Station, 12-9
TIMESTEP, 8-11
Transparent access
with OLE DB, 12-7
with OPC, 12-5

U
Use
OLE DB interface of the Connectivity Pack, 12-6
OPC interface of the Connectivity Station, 12-4
User archive, 8-20, 8-22
Displaying data, 8-22
Querying archive data, 8-20

Poll, 8-11, 8-17, 8-20

Index - 2

Connectivity Pack
11/2006, Printout of the Online Help

Index

V
Visual Basic, 10-1
Access to Archive Data, 10-1

W
WinCC Archive Connector, 4-1, 8-4
WinCC DataConnector, 4-1
WinCC OLE DB, 8-2

Connectivity Pack
11/2006, Printout of the Online Help

basics, 8-2
Microsoft, 8-2
WinCC, 8-2
WinCC OLE DB Provider, 4-1, 8-1
Access to Archive Data, 8-1
Linked Server, 4-1
SQL Server, 4-1
WinCC OPC-Server
Server names, 12-4

3

Index

Index - 4

Connectivity Pack
11/2006, Printout of the Online Help