Opc
Opc
Opc
3
______________
OPC Specifications
SIMATIC HMI
4
______________
Compatibility
6
______________
WinCC OPC XML DA Server
Printout of the Online Help
7
______________
WinCC OPC DA server
8
______________
WinCC OPC HDA server
9
______________
WinCC OPC A&E Server
10
______________
Commissioning
07/2010
Legal information
Legal information
Warning notice system
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.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended
or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be adhered to. The information in the relevant documentation must be observed.
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.
COM
COM is the standard protocol for communication between objects located on the same
computer but which are part of different programs. The server is the object providing
services, such as making data available. The client is an application that uses the services
provided by the server.
DCOM
DCOM represents an expansion of COM functionality to allow access to objects on remote
computers.
This foundation allows standardized data exchange between applications from industry,
administrative offices and manufacturing.
Previously, applications which accessed process data were tied to the access protocols of
the communication network. The OPC standard software interface allows devices and
applications from various manufacturers to be combined with one another in a uniform
manner.
The OPC client is an application that accesses process data, messages and archives of an
OPC server. Access is through the OPC software interface.
An OPC server is a program that provides the applications from various manufacturers with
a standard software interface. The OPC server is the intermediate layer between the
applications for handling process data, the various network protocols and the interfaces for
accessing these data.
Only devices with operating systems based on Windows COM and DCOM technology can
use the OPC software interface for data exchange. Currently, Windows 2000, Windows XP,
Windows 2003 Server and Windows VISTA have these software interfaces.
XML
Communication via DCOM is restricted to local networks. Data exchange via XML operates
with SOAP (Simple Object Access Protocol). SOAP is a platform-independent XML-based
protocol. SOAP can be used to enable applications to communicate with each other via the
Internet or in heterogenic computer networks by means of HTTP (HyperText Transfer
Protocol).
Licensing:
For utilization of the WinCC OPC HDA, the WinCC-OPC-XML-DA server and the WinCC
OPC A&E server, a license must be purchased. The "Connectivity Pack" license must be
installed on the WinCC server which is utilized as the WinCC OPC HDA server, WinCC OPC
XML DA server or WinCC OPC A&E server. For more information, see chapter "Licensing".
Applications
WinCC as OPC-XML-DA-Server
Within a distributed system, WinCC clients have views of several WinCC servers. The
WinCC OPC XML DA server provides the OPC XML client with the OPC process data as a
web page. The web page can be accessed 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.
Introduction
The OPC XML DA server from WinCC is realized as a web service of the Microsoft Internet
Information Server (IIS).
The WinCC OPC XML DA server provides the OPC XML client with the OPC process data
as a web page. The web page can be accessed via the Internet using HTTP. The address of
the WinCC OPC XML DA Server is: <http://<xxx>/WinCC-OPC-XML/DAWebservice.asmx>"
The WinCC OPC XML DA server is not visible in WinCC. When an OPC XML client requests
data, the Web service is automatically started by the Web server.
To establish successful OPC communication, the following must be observed:
● The WinCC project of the WinCC OPC XML DA server must be activated.
● The computer of the WinCC OPC XML DA server must be capable of being accessed via
HTTP.
Licensing
In order to operate the WinCC OPC XML DA server, the following licenses must be installed
on each WinCC computer implemented as an OPC XML server:
● WinCC Basic System
● WinCC Option Connectivity Pack
Description
An OPC client writes to a string tag and does not enter the new value in the form of a string
but as float, double or decimal.
Problem
The comma that indicated the decimal value (in German) can be lost. This will result in a
wrong value.
This also affects the read access to string tags if the read value is requested in the float,
double or decimal format.
Remedy
Only use the respective floating point tags for the floating point values. Access string tags
only in string format.
6.2 Installation
6.2.1 Installation
Introduction
OPC XML enables access to the process tags via the Internet. In order to operate OPC
XML, a number of additional software components must be installed.
Note
It is essential to observe the sequence of installation steps as described here. Otherwise,
there might be problems during installation.
Introduction
The Internet Information Service (IIS) must be installed prior to the installation of WinCC
OPC XML Server in Windows 2000 Professional, Windows 2000 Server, Windows 2003
Server or Windows XP.
Note
To install the Internet Information Service in Windows, you must have the necessary write
access rights to the registry database. To do this, you must have administrator rights.
Procedure
1. Open the "Add or Remove Programs" dialog and click "Add or Remove Windows
Components". The following dialog is opened.
2. Select the check box preceding the "Internet Information Service (IS)" item in the
selection box. On Windows 2003 servers, IIS is accessible at "Windows Components" >
"Application Server" > "Internet Information Service". You must also install the ASP.NET
under Windows Server 2003
3. Click "Next". The required data is transferred and the necessary configuration is
completed by Windows.
4. Close the Assistant by clicking "Finish".
Requirement
● Internet Information Server (IIS)
● Installation of the ASP.NET under Windows Server 2003
● Microsoft .NET Framework 2.0
Installation
The WinCC OPC XML DA server can be selected during the installation of WinCC. For more
information, refer to the WinCC Information System in chapter "Installation Notes" >
"Installing WinCC".
The following settings must be made during the installation:
● Create virtual directory "WinCC-OPC-XML".
● Define the access rights for the directory.
Introduction
The WinCC OPC DA Server supports OPC Data Access specifications 1.0, 2.05a and 3.0.
This has been confirmed by the compliance test. The WinCC OPC DA Server of WinCC
V6.0 SP2 or higher supports the OPC Data Access 3.0 specification.
The WinCC OPC DA server is a DCOM application. This interface is used by the WinCC
OPC DA server to make the required information about WinCC tag available to the WinCC
client.
The WinCC OPC DA server is active, if the WinCC OPC DA client is accessing it via a
connection. To establish successful OPC communication, the following must be observed:
● The WinCC project of the WinCC OPC DA server must be enabled.
● The computer on which the WinCC OPC DA server runs must be accessible via its IP
address.
Installation
The WinCC OPC DA server can be selected during the installation of WinCC. After
installation, the WinCC OPC DA server is immediately usable without any further
configuration.
The WinCC OPC DA server can be implemented on a WinCC server or a WinCC client.
Configuration tip
In your WinCC project you can summarize for structuring purposes tags in tag groups. The
tags should not have the same name as the group.
Introduction
More than one OPC DA server may be installed on a computer, and any number may work
in parallel.
In this way, the OPC DA server of WinCC and the OPC DA server of another (third-party)
provider may be operated independently of one another on the same computer.
The WinCC OPC DA client can access the process data of the automation device via the
OPC server of the third-party provider. The OPC DA client of Microsoft Excel can use the
WinCC OPC DA server to access the WinCC data.
There are a number of OPC DA servers available from various manufacturers. Each of these
OPC DA servers has a unique name (ProgID) for identification. OPC DA clients must use
this name to address the OPC server.
The OPC Item Manager can be used to query the name of the OPC DA server. The OPC DA
server of WinCC V 7 is named: "OPCServer.WinCC".
Introduction
Multiple OPC DA servers can be installed on a single computer. The OPC Item Manager
displays the names of the OPC DA servers available to the workstation in a selection
window. These OPC DA servers can be run on the same computer or on computers in the
network environment.
Requirement
Add the "OPC" channel to the WinCC project of the WinCC OPC DA client.
Procedure
1. In the shortcut menu of the channel unit "OPC Groups(OPCHN Unit#1)" on the WinCC
OPC DA client, select "System Parameters".
Introduction
When establishing a WinCC - WinCC connection, data are exchanged between the WinCC
OPC DA server and client by means of the "OPC_Server_Tag" WinCC tag. The
"Client_OPC_Server_Tag_xyz" WinCC tag on the client reads the "OPC_Server_Tag" WinCC
tag on the server. If the value of the "OPC_Server_Tag" tag on the WinCC OPC server
changes, the value of the "Client_OPC_Server_Tag_xyz" WinCC tag on the WinCC OPC DA
client also changes. Changes on the client are also reflect on the server.
Tag values are displayed in I/O fields on both computers.
Requirements
● Two computers with WinCC projects.
● Both computers must be accessible via their IP addresses.
Configuration Procedure
The following configurations are required to establish a WinCC - WinCC connection:
1. Configuring a WinCC Project on a WinCC OPC DA Server
2. Configuring a WinCC Project on a WinCC OPC DA Client
Introduction
In this section, a WinCC tag is created in the WinCC project of the WinCC OPC DA server
and displayed in an I/O field.
Procedure
1. Select "New Tag" from the shortcut menu of the "Internal Tags" icon on the WinCC OPC
DA server. Create a new tag called "OPC_Server_Tag" of the "signed 16-bit value" type.
2. Launch the Graphics Designer and open a new picture.
3. Add an I/O field to the picture. Select the "I/O field" object from the object list under
"Smart Objects". The "I/O Field Configuration" dialog is opened.
Introduction
In this section, a WinCC tag is created on the WinCC OPC DA client, in order to read a
WinCC tag on the WinCC OPC DA server. The tag value is displayed in an I/O field.
Requirements
● Add the "OPC" channel to the WinCC project of the WinCC OPC DA client.
● Configure an internal tag named "OPC_Server_Tag" of the data type "signed 16-bit value"
in the WinCC project of the WinCC OPC DA server.
● Enable the WinCC project of the WinCC OPC DA server.
Procedure
1. In the shortcut menu of the channel unit "OPC Groups(OPCHN Unit#1)" on the WinCC
OPC DA client, select "System Parameters". The OPC Item Manager is opened.
2. Choose the name of the computer to be used as the OPC DA server from the selection
dialog. Select "OPCServer.WinCC" from the list. Click the "Browse Server" button. The
"Filter Criteria" dialog is opened.
3. Click the "Next->" button in the "Filter Criteria" dialog. Select the "OPC_Server_Tag" tag
in the "OPCServer.WinCC ..." dialog. Click the "Add Items" button.
4. If a connection to the OPC DA server already exists, continue with step 5.
If no connection has been configured, a corresponding message is displayed.
Click "Yes". The "New Connection" dialog is displayed.
6. Click the "<- Back" button in the "OPCServer.WinCC ..." dialog. In the "OPC Item
Manager", click "Exit" to close the OPC Item Manager.
7. Launch the Graphics Designer and open a new picture. Add an I/O field to the picture.
Select the "I/O field" object from the object list under "Smart Objects". The "I/O Field
Configuration" dialog is opened.
8. Enter the name "Client_OPC_Server_Tag_xyz" in the "Tag" field. Set the update to "2 s".
Set the field type to "I/O field". Close the dialog and save the picture. Enable the WinCC
project by clicking the "Activate" button in the Graphics Designer.
9. The value of the configured tags is displayed in the I/O field on both the WinCC OPC DA
server and the client. Enter a new value in the I/O field on the WinCC OPC DA server.
The new value is displayed in the I/O field on the WinCC OPC DA client.
Introduction
During the installation of SIMATIC NET, you can select the OPC server to be installed. In the
following example, a connection between WinCC and SIMATIC NET FMS OPC server is
configured. Data from the automation device is made available to WinCC through the
SIMATIC NET FMS OPC server.
In this example, WinCC is used as the WinCC OPC DA client. The OPC Item Manager
displays the indexes of the object list configured for the automation device.
The current value of the tag is displayed in an I/O field. As soon as the value of the tags on
the SIMATIC NET FMS OPC server changes, the new value is reflected on the process
picture on the WinCC OPC DA client. Conversely, a value entered in the I/O field is sent to
the automation device.
Requirements
● A computer with WinCC, SIMATIC NET software.
● A configured SIMATIC NET FMS OPC server. For additional information regarding the
setup of SIMATIC NET S7 OPC servers refer to the SIMATIC NET documentation.
Configuration steps
The following configuration is required in the WinCC project of the WinCC OPC DA client:
1. Configuring a WinCC - SIMATIC NET FMS OPC server connection
Communication Manual
The communication manual contains additional information and extensive examples for the
channel configuration. This manual is available for download on the Internet:
● http://support.automation.siemens.com/
Search by order number:
● A5E00391327
7.4.2.2 How to Configure the WinCC - SIMATIC NET FMS OPC Server Connection
Introduction
In this section, a WinCC tag that accesses an FMS index is configured in the WinCC project
of the WinCC OPC DA client. The tag value is displayed in an I/O field.
Requirement
● Add the "OPC" channel to the WinCC project of the WinCC OPC DA client.
Procedure
1. In the shortcut menu of the channel unit "OPC Groups(OPCHN Unit#1)" on the WinCC
OPC DA client, select "System Parameters". The OPC Item Manager is opened.
2. Choose the name of the computer to be used as the OPC DA server from the selection
dialog. Select "OPC.SIMATICNet" from the list.
Click the "Browse Server" button. The "Filter Criteria" dialog is opened.
3. Click the "Next->" button in the "Filter Criteria" dialog. The "OPC.SIMATICNet.." dialog is
opened. All FMS indexes configured are displayed in a selection list. Select an index.
Click the "Add Items" button.
4. If a connection to the SIMATIC NET FMS OPC server already exists, continue with
step 5.
If no connection has been configured, a corresponding message is displayed.
Click "Yes". The "New Connection" dialog is displayed.
Requirements
● A computer with WinCC, SIMATIC NET software.
● A configured SIMATIC NET S7 OPC Server. For additional information regarding the
setup of SIMATIC NET S7 OPC servers refer to the SIMATIC NET documentation.
Configuration steps
The following configurations are required to establish a WinCC - SIMATIC NET S7 OPC
server connection:
1. Adding Tags to a SIMATIC NET S7 OPC Server
2. Configuring Access to the Tags on a SIMATIC NET S7 OPC Server
Communication Manual
The communication manual contains additional information and extensive examples for the
channel configuration. This manual is available for download on the Internet:
● http://support.automation.siemens.com/
Search by order number:
● A5E00391327
Introduction
In order for the OPC Item Manager to display the tags, they must be added to the address
space of the SIMATIC NET S7 OPC server. The "OPC Scout" program is used for the
configuration. OPC Scout is set up by the SIMATIC NET installer. For this example, the
marker word "0" in the automation device is addressed.
Parameter Value
Data type W
Range byte 0
No. values 1
Item alias MW0
Requirements
● Configure an S7 connection in the SIMATIC NET software. For more information, refer to
the SIMATIC NET documentation.
Procedure
1. Open the "OPC Scout" via Start "Programs" "SimaticNet" "OPCServer"
"OPCScout" .
2. Select "OPC.SimaticNet" under "Local Server(s)". If the SIMATIC S7 OPC server is not
run on the same computer, select "Add Remote Server(s)" in the "Server(s)" shortcut
menu. Enter the name of the computer used as the OPC server in the "Add Remote
Server(s)" dialog, then click "OK" to close the dialog.
3. Select "Connect" in the "OPC.SimaticNet" shortcut menu. The "Add Group" dialog is
displayed. Enter a name for the group. Click "OK" to close the dialog.
4. Select "Add Item" from the shortcut menu of the added group. The "OPC Navigator" is
opened.
5. Select "M" (marker) under "Objects" in the "OPC Navigator". Double-click "(New
Definition)" to open the "Define New Tag" dialog.
6. Enter the parameters from the table in the "Define New Tag" dialog.
7.4.3.3 Configuring Access to the Tags of the SIMATIC NET S7 OPC Server
Introduction
In this section, a WinCC tag is configured in the WinCC project of the WinCC OPC DA client.
This tag accesses the tag "MW0" in the address space of the SIMATIC NET S7 OPC server.
The tag value is displayed in an I/O field.
Requirements
● Create the tag "MW0" using the OPC Scout.
● Add the "OPC" channel to the WinCC project of the WinCC OPC DA client.
Procedure
1. Select "System Parameters" in the shortcut menu of "OPC Groups(OPCHN Unit#1)". The
OPC Item Manager is opened.
2. Choose the name of the computer to be used as the OPC server from the selection
dialog. Select "OPC.SIMATICNet" from the list.
Click the "Browse Server" button. The "Filter Criteria" dialog is opened.
3. Click the "Next->" button in the "Filter Criteria" dialog. The "OPC.SIMATICNet.." dialog is
opened. Select the "MW0" tag. Click the "Add Items" button.
4. If a connection to the SIMATIC NET FMS OPC server already exists, continue with
step 5.
If no connection has been configured, a corresponding message is displayed.
Click "Yes". The "New Connection" dialog is displayed.
9. Close the dialog and save the picture. Enable the WinCC project by clicking the "Activate"
button in the Graphics Designer.
10.The I/O field on the WinCC OPC DA client displays the current value of the S7 tags. The
value is updated every two seconds. Enter a value in the I/O field. The changed value is
passed to the automation device.
Introduction
In this example, an OPC DA client is created in Microsoft Excel using the Visual Basic Editor.
The OPC DA client reads a WinCC tag in the WinCC project of the WinCC OPC DA server
and writes the value into a cell. If a new value is entered in the cell, the value is passed to
the WinCC OPC DA server.
A computer on which both WinCC and Microsoft Excel are installed is used for the
connection.
Configuration steps
The following configurations must be made in Microsoft Excel:
1. Creating an OPC DA client in Visual Basic Editor of Microsoft Excel
2. Configuring access to a WinCC tag in Microsoft Excel
Introduction
To use Microsoft Excel as an OPC DA client, a special script must be created in the Visual
Basic Editor of Microsoft Excel.
Requirements
Basic knowledge of Visual Basic Editor in Microsoft Excel.
Procedure
1. Open Microsoft Excel with a new workbook.
2. In the "Tools" menu of the Visual Basic Editor, click "Macro". The Visual Basic Editor
for Microsoft Excel is opened.
3. In the "Tools" menu of the Visual Basic Editor, select "References...". The "References -
VBAProject" dialog is displayed. Locate entry "Siemens OPC DAAutomation 2.0" in the
list of available references. Select the corresponding check box. Click "OK".
4. Copy the script shown below. This script is only available in the online help.
5. Open a new code window by double-clicking "Sheet1" in the project window of the Visual
Basic Editor.
6. Paste the script into the code window.
7. Select "Save" from the "File" menu. Select "Close and Return to Microsoft Excel" from the
"File" menu.
Script
Option Explicit
Option Base 1
'-------------------------------------------------------------------
--
' Sub StartClient()
' Purpose: Connect to OPC_server, create group and add item
'-------------------------------------------------------------------
--
Sub StartClient()
' On Error GoTo ErrorHandler
'----------- We freely can choose a ClientHandle and GroupName
ClientHandles(1) = 1
GroupName = "MyGroup"
'----------- Get the ItemID from cell "A1"
NodeName = Range("A1").Value
ItemIDs(1) = Range("A2").Value
'----------- Get an instance of the OPC-Server
Set MyOPCServer = New OpcServer
MyOPCServer.Connect ServerName, NodeName
ErrorHandler:
MsgBox "Error: " & Err.Description, vbCritical, "ERROR"
End Sub
'-------------------------------------------------------------------
--
' Sub StopClient()
' Purpose: Release the objects and disconnect from the server
'-------------------------------------------------------------------
--
Sub StopClient()
'----------- Release the Group and Server objects
MyOPCGroupColl.RemoveAll
'-------------------------------------------------------------------
--
' Sub MyOPCGroup_DataChange()
' Purpose: This event is fired when a value, quality or timestamp in
our Group has changed
'-------------------------------------------------------------------
--
'----------- If OPC-DA Automation 2.1 is installed, use:
Private Sub MyOPCGroup_DataChange(ByVal TransactionID As Long, ByVal
NumItems As Long, ClientHandles() As Long, ItemValues() As Variant,
Qualities() As Long, TimeStamps() As Date)
'----------- Set the spreadsheet cell values to the values read
Range("B2").Value = CStr(ItemValues(1))
Range("C2").Value = Hex(Qualities(1))
Range("D2").Value = CStr(TimeStamps(1))
End Sub
'-------------------------------------------------------------------
--
' Sub worksheet_change()
' Purpose: This event is fired when our worksheet changes, so we can
write a new value
'-------------------------------------------------------------------
--
Private Sub worksheet_change(ByVal Selection As Range)
'----------- Only if cell "B3" changes, write this value
If Selection <> Range("B3") Then Exit Sub
Values(1) = Selection.Cells.Value
'----------- Write the new value in synchronous mode
MyOPCGroup.SyncWrite 1, ServerHandles, Values, Errors
End Sub
Introduction
The Excel OPC DA client reads a WinCC tag of the WinCC OPC DA server and writes the
value of the tag into a cell. In the WinCC project of the WinCC OPC DA server, the value of
the tag is displayed in an I/O field. If the tag value in a cell is changed, this alters the value in
the I/O field of the WinCC OPC DA server.
Requirements
● Configure an internal tag named "OPC_Excel" with data type "signed 16-bit value" in the
WinCC project of the WinCC OPC DA server.
● Write the value of the "OPC_Excel" tag to an I/O field on the WinCC project of the WinCC
OPC DA server.
● Enable the WinCC project of the WinCC OPC DA server.
Procedure
1. In Microsoft Excel, enter the name of the computer used as the OPC server in cell A1. In
cell A2, enter the tag name "OPC_Excel".
2. In the "Tools" menu in Excel, select "Macro" "Macros". The "Macro" dialog is opened.
Select the entry "Sheet1.StartClient" from the list of macros. Click "Run" to start the OPC
client.
3. The value of the tag is written into cell B2, the quality code into C2 and the timestamp into
D2.
4. Enter a new value in cell B3. The changed value is displayed in the I/O field on the
WinCC OPC server.
5. In the "Tools" menu in Excel, select "Macro" "Macros". The "Macro" dialog is opened.
Select the entry "Sheet1.StopClient" from the list of macros. Click "Run" to stop the OPC
client.
Introduction
The WinCC OPC HDA server is a DCOM application makings data needed from the archive
system available to the OPC HDA client. Access the data using Item Handles. Read or write
access is enabled. The data can also be analyzed.
The WinCC OPC HDA server supports the OPC Historical Data Access 1.20 specification.
This has been confirmed by the compliance test.
The following chapter explains the design of the data structure, as well as the attributes,
aggregates and functions supported by the WinCC OPC HDA server. This is not a detailed
description, but rather a summary of the most important information. For more information,
refer to the "OPC Historical Data Access 1.20" specification.
Installation
The WinCC OPC HDA server can be selected during the installation of WinCC. It is possible
to select whether access is made to the WinCC archive system with or without write function
. After installation, the WinCC OPC DA server is immediately available for use without any
additional configuration.
In the case of installation without write access, the data in the WinCC archive system can
only be read and analyzed. In the case of write access, data in the WinCC archive system
can be analyzed, added, deleted and updated.
The WinCC OPC HDA server can be implemented on a WinCC server or a WinCC client.
Licensing
In order to operate the WinCC OPC HDA server, the following licenses must be installed on
each WinCC computer implemented as an OPC HDA server:
● WinCC Basic System
● WinCC Option Connectivity Pack
To request for historical values using OPC HDA client, you need to take care of the following
during configuration:
● Select a query cycle in such a way that the client can receive the requested data before
the next query is sent. Too short cycles can lead to high time delays while receiving data.
● CPU load of the WinCC server depends on the number of tags per query.
Introduction
The data on the WinCC OPC HDA server are structured. The available data structures are
listed below. This is not a detailed description, but rather a summary of the most important
information. For more information, refer to the "OPC Historical Data Access 1.20"
specification.
Data structure
Description
Attributes Provide additional quality characteristics for the raw data. Attributes include
data type, specifications re. archiving, etc. For more information, see the
overview of supported attributes.
Assemblies Summarize raw data of a specified time interval. Aggregates include average
value, minimum, maximum, etc. For more information, see overview of
supported aggregates.
StartTime/EndTime Set the beginning and end point for the time interval.
Bounding values Values recorded at the beginning and end. If no bounding values are available,
the values closest to these times are used as bounding values.
Raw data Data from the WinCC archive system of a particular time interval. These data
include a time stamp and quality rating.
Item handle Unique assignment to a WinCC archive tag.
ItemID Unique identifier of the WinCC archive tag. The ItemID can be used to get an
item handle.
Introduction
The following table contains the attributes supported by the WinCC OPC HDA server. For
more information, refer to the "OPC Historical Data Access 1.20" specification.
Attributes
Introduction
The following table lists the aggregates supported by the WinCC OPC HDA server. For more
information, refer to the "OPC Historical Data Access 1.20" specification.
Assemblies
Assembly Description
OPCHDA_COUNT Returns the raw data count for the specified time interval.
OPCHDA_START Returns the initial value of the raw data at the beginning of the
time interval.
OPCHDA_END Returns the final value of the raw data at the end of the time
interval.
OPCHDA_AVERAGE Returns the average value of the raw data for the specified
time interval.
OPCHDA_TIMEAVERAGE Returns the time-weighted average of the raw data for the
specified time interval.
OPCHDA_TOTAL Returns the sum total value for the specified time interval.
OPCHDA_STDEV Returns the standard deviation of the raw data for the
specified time interval.
OPCHDA_MINIMUMACTUALTIME Returns the minimum value of the raw data and its time stamp
for the specified time interval.
OPCHDA_MINIMUM Returns the minimum value of the raw data for the specified
interval.
OPCHDA_MAXIMUMACTUALTIME Returns the maximum value of the raw data and its time
stamp for the specified time interval.
Assembly Description
OPCHDA_MAXIMUM Returns the maximum value of the raw data for the specified
interval.
OPCHDA_DELTA Returns the difference between the first and last value in the
raw data for the specified time interval.
OPCHDA_REGSLOPE Returns the slope of the regression line of the raw data for the
specified time interval.
OPCHDA_REGCONST Returns the regression value of the raw data at the starting
point.
OPCHDA_REGDEV Returns the standard deviation of the regression of the raw
data in the specified time interval.
OPCHDA_VARIANCE Returns the variance of the raw data for the specified time
interval.
OPCHDA_RANGE Returns the difference between OPCHDA_MAXIMUM and
OPCHDA_MINIMUM of the raw data for the specified time
interval.
OPCHDA_DURATIONGOOD Returns the period of time in which the quality of the raw data
was good. The period is indicated in seconds.
OPCHDA_DURATIONBAD Returns the period of time in which the quality of the raw data
was bad. The period is indicated in seconds.
OPCHDA_PERCENTGOOD Returns the percentage of the raw data of good quality.
OPCHDA_PERCENTBAD Returns the percentage of the raw data of bad quality.
OPCHDA_WORSTQUALITY Returns the worst quality of the raw data for the specified time
interval.
Introduction
The following tables list the functions supported by the WinCC OPC HDA server. These
functions can be used by the OPC HDA client for data exchange. For more information, refer
to the "OPC Historical Data Access 1.20" specification.
Read
Function Description
ReadRaw Returns the raw data, its quality and time stamp for the specified time interval.
ReadProcessed Returns the calculated value, the quality of the value and the time stamp for the
specified time interval. The calculated value is determined by the selected
aggregate.
ReadAtTime Returns the raw data, its quality and time stamp for a particular time interval. If no
value is available, the value for this point is interpolated.
ReadAttribute Returns the item attributes and time stamp for the specified time interval.
Introduction
The time interval is specified on the WinCC OPC HDA server by setting the starting and
ending times. The specified time interval determines the observation period for the historical
data. When specifying the times, certain formats must be maintained.
The following options are available for the specification of times:
● Absolute based on UTC
● Relative to the local time of the server
Time format
YYYY/MM/DD hh:mm:ss.msmsms
Parameters
YYYY = year
MM = month
DD = day
hh = hours
mm = minutes
ss = seconds
ms = milliseconds
Input example
2002/06/10 09:27:30.000
Time format
keyword +/-offset1 +/-offset(n)
The offset is the deviation from the local time of the server.
Keywords
NOW = current local time on the server
SECOND = current second
MINUTE = current minute
HOUR = current hour
DAY = current day
WEEK = current week
MONTH = current month
YEAR = current year
Offset
+/-S = deviation in seconds
+/-M = deviation in minutes
+/-H = deviation in hours
+/-D = deviation in days
+/-W = deviation in weeks
+/-MO = deviation in months
+/-Y = deviation in years
Example:
DAY - 1D = previous day
DAY-1D + 7H30 = previous day at 7:30
MO-1D+5H = last day of the previous month at 5:00.
NOW-1H15M = one hour and 15 minutes ago
YEAR+3MO= April of this year
Introduction
Quality codes are used to evaluate the status and quality of the raw data. The table below
shows the quality codes for OPC HDA. For more information, refer to the "OPC Historical
Data Access 1.20" specification.
Introduction
The following table shows the write accesses supported by the WinCC OPC HDA server.
Table element:
Description
Cyclic archive The process values to be archived are stored in a cyclic archive. The cyclic archive consists of a
configurable number of data buffers. The size and a period of time (e.g. in days) for the data buffer
are defined. If all data buffers are full, the process data in the first data buffer is overwritten.
Cyclic archive after In order to protect process data in the data buffers from being overwritten process, it can be
swapping swapped (exported).
Supported by WinCC.
Write Accesses
Yes No When the time period is contained in the cyclic archive, a process
value can be added later.
Yes Yes The data buffer of the corresponding time period is swapped to an
archive backup. Process values cannot be added later to an
archive backup.
No No The cyclic archive is not available. The process value cannot be
stored.
No Yes The cyclic archive is not available. The process value cannot be
stored.
Yes No The process value is added in the data buffer currently valid for the
cyclic archive.
Yes No When the time period is contained in the cyclic archive, a process
value can be deleted.
Yes Yes The data buffer of the corresponding time period is swapped to
an archive backup. Process values can be deleted from an
archive backup.
No No The cyclic archive is not available. The process value cannot be
stored.
No Yes The cyclic archive is not available. The process value cannot be
stored.
Yes No When the time period is contained in the cyclic archive, a process
value can be edited.
Yes Yes The data buffer of the corresponding time period is swapped to
an archive backup. Process values cannot be edited in an
archive backup.
No No The cyclic archive is not available. The process value cannot be
stored.
No Yes The cyclic archive is not available. The process value cannot be
stored.
Introduction
In the example below, a connection between WinCC and the OPC HDA client is configured.
Data from the WinCC archive system are made available via the WinCC OPC HDA server.
The OPC HDA client accesses the data via item handles. To simplify the configuration
process, the OPC HDA browser is used.
The OPC HDA client from the OPC Foundation is used. All OPC HDA clients conforming to
the OPC Historical Data Access 1.20 specification can access the WinCC OPC HDA server.
Requirements
● Create an internal tag named "OPC_HDA" with data type "unsigned 16-bit value" in the
WinCC project of the WinCC OPC HDA server.
● Create a process value archive called "HDA_ProcessValueArchive" in the WinCC archive
system.
● Create an WinCC archive tag called "OPC_HDA_Tag" in the
"HDA_ProcessValueArchive" process value archive. Link the WinCC archive tag to the
internal tag "OPC_HDA".
● In the Runtime list, launch Tag Logging Runtime and disable Graphics Runtime.
● Launch the WinCC project of the WinCC OPC HDA server.
Configuration steps
The following configurations are required to connect WinCC to the OPC HDA client:
1. Configuring access to a WinCC archive tag using the HDA server browser
2. Reading values from the WinCC archive tags
Introduction
The OPC HDA client accesses the tag values via item handles. For ease of configuration,
the WinCC OPC HDA server supports the browser functionality. The OPC HDA client can
use the HDA server browser to search the address space of the WinCC OPC HDA server.
The data are listed hierarchically by process value archive.
Note
Access to a WinCC archive tag without the HDA server browser requires manual
configuration of the item ID.
When addressing WinCC archive tags, the computer name (server prefix) is included in the
path. The ItemID has the following syntax: Server-
prefix::process_value_archive\WinCC_archive_tag.
8.5.3 How to Configure Access to a WinCC Archive Tag Using the HDA Server Browser
Introduction
In this section, the OPC HDA client is used to access a WinCC archive tag. The OPC HDA
client from the OPC Foundation is used. The HDA server browser is used to configure
access.
Note
The OPC HDA client described here is the demo client from the OPC Foundation. The
source code for it is found on the Internet at http://www.opcfoundation.org.
Procedure
1. Copy the " SampleClientHDA.exe " file to a directory of your choice. This application is
only available in the online help.
2. Double-click the "SampleClientHDA.exe" file. The HDA client program is started.
3. In the "Server Name" area, select entry "OPCServerHDA.WinCC.1". Click "Connect".
Confirm the next dialog.
4. Click "Browse" in the HDA client. The "Browse Dialog" dialog is opened. Select
"OPCHDA_FLAT" in the "OPCHDA_BROWSETYPE" field.
Introduction
This section explains how you can access and read WinCC archive tags.
Requirement
● The OPC HDA client must be running.
Procedure
1. Click "Show Items" in the HDA client.
2. Click "Get Item Handles" in the HDA client.
3. Double-click "HDA_ProcessValueArchive_HDA_Tag" in the selection field "Value"
selection field.
4. Enter "NOW-10S" in the "Start Time" field. Enter "NOW" in the "End Time" field.
5. Click "Read Raw". The values, their quality codes and time stamps are shown in the
"Values" selection field.
8.6 Special features of the OPC HDA server in WinCC for acyclic logging
Introduction
Tag logging is performed in WinCC cyclically or acyclically. The WinCC OPC HDA server
works differently depending on the logging method for tags:
● For all cyclically logged values, the OPC HDA server operates in conformity to the HDA
specification of the OPC foundation. The OPC aggregates are linearly interpolated.
● Acyclically logged tags are not included in the HDA specification of the OPC Foundation.
The OPC aggregates are interpolated incrementally. Especially when a tag experiences
no change for a long period of time, no data is available during a time period. The
following should be taken into consideration to nevertheless obtain valid data.
NOTICE
The OPC HDA server is not OPC-compliant for acyclically logged tags. The HDA
specification of the OPC Foundation does not recognize acyclically logged tags and,
therefore, no archive server can handle acyclically logged tags. The supported
aggregates are calculated in conformity to the OPC HDA specification. No non-explicitly
called functions are supported.
Supported aggregates of the WinCC OPC HDA server for acyclically logged tags
The OPC HDA server supports the following aggregates:
● OPCHDA_MINIMUM
● OPCHDA_MAXIMUM
● OPCHDA_AVERAGE
● OPCHDA_END
● OPCHDA_INTERPOLATIVE
● OPCHDA_TIMEAVERAGE
● OPCHDA_TOTAL
● OPCHDA_DURATIONGOOD
● OPCHDA_PERCENTGOOD
Supported functions of the WinCC OPC HDA server for acyclically logged tags
● ReadRaw with "boundings" only. ReadRaw for a tag must always be performed with
"boundings", in order to find the last real stored value for an area without logged value
change.
● ReadProcessed
● DeleteRaw
● DeleteAtTime
● Insert
● InsertReplace
● Replace
Example
The values for "00:59:00", "01:02:00" and "01:03:00" are stored for an acyclical tag logging
tags. An OPC HDA client postulates with "ReadProcessed" an aggregate with the following
parameters:
● StartTime = 01:00:00
● EndTime = 01:04:00
● Interval = 00:02:00
Note
The time period is always 1 µs less than the time stamp at the limit for the calculation
when generating virtual values at limits ("EndTime"/"Interval").
A delta of 1 seconds is used in the following table to provide a better overview. The following
graphic illustrates the example.
The OPC server uses the following "RawData" for the calculation of the aggregate:
Introduction
The WinCC OPC A&E server is a DCOM application. The OPC A&E client is kept informed
of status changes for WinCC messages by means of subscriptions. The OPC A&E client can
apply a filter to the subscription. This filter determines which messages and attributes are
displayed.
The WinCC OPC A&E server supports the specification OPC Alarm&Event 1.10. This has
been confirmed by the compliance test.
The following chapter explains the display of the WinCC message system on OPC A&E, as
well as the attributes supported by the WinCC OPC A&E server. This is not a detailed
description, but rather a summary of the most important information. For more information,
refer to the "OPC Alarms & Events 1.10" specification.
Installation
The WinCC OPC A&E server can be selected during the installation of WinCC. After
installation, the WinCC OPC A&E server is immediately usable without any additional
configuration.
Starting with WinCC V6.2, the WinCC OPC A&E server can be implemented on a WinCC
server and a WinCC client.
Licensing
In order to operate the WinCC OPC A&E server, the following licenses must be installed on
each WinCC server implemented as an OPC A&E server:
● WinCC Basic System
● WinCC Option Connectivity Pack
Server types
The WinCC OPC A&E server supports conditional events and simple events. In addition,
there are tracking events.
Note
Note the following while using redundant systems:
Simple events that switch to internal tags are sent twice while comparing tags.
The first message is triggered by master, the second from standby.
Introduction
During the configuration of the WinCC message system, settings are made to determine
which process events generate a message. This message is shown as an alarm in OPC
A&E. The table below lists the most important parameters of the alarm. It also describes how
the information is made available by the WinCC message system. For more information,
refer to "Alarm Structure".
Overview
Introduction
The WinCC message system informs the user of disturbances and operating conditions in
the process. A WinCC message always belongs to a specific message class and message
type that is related to the event category.
The mapping of the WinCC message system on OPC is configured via the CcAeProvider.ini
file.
Event Category
An event category is created on the WinCC OPC A&E server for every combination of a
message class and type.
An event category is determined by a category ID and a descriptive "Category Description".
The category ID is composed of the WinCC internal IDs for the message class and the
message type; the category description is composed of the message class and message
type.
NOTICE
If the OPC A&E server is run on a WinCC-Client of a connectivity station, the OS servers
linked to it must have an identical configuration of message classes and message types. If
this is not the case, the entered OPC client must access the OS server directly.
The names of the message classes and message types can be ascertained via the alarm
attributes CLASSNAME and TYPENAME.
Introduction
The priority of WinCC messages is displayed by the OPC server to the attribute "Severity".
When configuring alarms in the WinCC messaging system, you can configure a priority
between 0 and 16. The OPC A&E specification defines a value range from 1 to 1000 for the
severity where 1 stands for the lowest and 1000 for the highest severity.
Therefore, the values of the WinCC priority are suitably displayed to the OPC severity. In the
standard mapping, the WinCC priority 0 becomes OPC severity 1. All other priority values
are interpolated in a linear manner up to severity 1000. Other priority mapping rules can be
configured in the CcAeProvider.ini file.
Introduction
The following table lists the OPC attributes of the WinCC message system. The attributes
are configured in the WinCC message system. Some attributes are intended for internal use
in WinCC only and are therefore not relevant to an OPC A&E client. These attributes are not
listed.
Attributes
Introduction
For WinCC, the acknowledgment philosophy is how a message is displayed and processed
from "came in" to "went out". On the WinCC OPC A&E server, this message status is
managed in parameters "ChangeMask" and "NewState".
ChangeMask
The "ChangeMask" parameter keeps track of where the message status was changed.
Parameter values:
● OPC_CHANGE_ACTIVE_STATE
● OPC_CHANGE_ENABLE_STATE
● OPC_CHANGE_ACK_STATE
NewState
The "NewState" parameter indicates the message status after a change.
Parameter values:
● OPC_CONDITION_ACTIVE
● OPC_CONDITION_ENABLED
● OPC_CONDITION_ACKED
Overview
Introduction
Quality codes are used to evaluate the status and quality of a message. The table below lists
the quality codes for OPC A&E.
Quality codes
Introduction
In the example below, a connection between WinCC and an OPC A&E client is configured.
Data from the WinCC message system are made available via the WinCC OPC A&E server.
The OPC A&E client is kept informed of status changes of WinCC messages by means of a
subscription.
All OPC A&E clients conforming to the OPC Alarms&Events 1.1 specification can access the
WinCC OPC A&E server.
Configuration Step
The following configurations are required for connection between WinCC and the OPC A&E
client:
1. Configuring access to the WinCC message system
Introduction
In this section, the OPC A&E client of the OPC foundation accesses the WinCC message
system.
Note
The OPC A&E client described here is the demo client from the OPC Foundation. The
source code for it is found on the Internet at http://www.opcfoundation.org.
Requirement
● Create several internal tags of the "binary" data type in the WinCC project of the WinCC
OPC A&E server.
● Configure the WinCC message system in the WinCC project of the WinCC OPC A&E
server. Link the messages to the internal tags.
● Configure a picture with the Graphics Designer. Add the WinCC alarm control and an I/O
field to the picture. Link the message tags to the graphic objects.
● Enable the "Alarm Logging Runtime" in the start list.
● Enable the WinCC project of the WinCC OPC A&E server.
Procedure
1. . Copy the "SampleClientAE.exe" "binary" file to a directory of your choice. This
application is only available in the online help.
2. Select "OPC" >"Connect..." in the menu bar. Select "OPC.WinCC-AlarmsEvent" in the
"OPC Alarm Server" dialog. Click "OK" to close the dialog.
3. Select "OPC" >"Event Subscription..." from the menu bar. The "Event Subscription" dialog
is opened.
4. Select the check box labeled "Active" in the dialog. Enter "1000" in the "Buffer Time" and
"Max Size" fields. Click "OK" to close the "Event Subscription" dialog.
5. The messages from the WinCC message system are displayed in the OPC Event Sample
Client.
6. Select "OPC" >"Filter" from the menu bar. The "Filter" dialog is opened. Select a category
from the "Event Category" field. Click "OK" to close the "Filter" dialog.
7. The messages meeting the filter criteria are displayed in the OPC Event Sample Client.
Introduction
The OPC-A&E server uses DCOM services for transferring messages between OPC-
capable applications. The OPC A&E server supports the specification OPC Alarm&Event
1.10.
The following chapter explains the mapping of the WinCC message system on OPC A&E
with hierarchical access and the attributes supported by the OPC A&E server. This
documentation includes an overview of the specific information. For more information, refer
to the "OPC Alarms & Events 1.10" specification.
Principle of operation
The OPC-A&E client receives WinCC messages via subscription. You can use the
subscription filter to reduce the number of events that will be transferred with a subscription.
The OPC-A&E client can be set for every event category that displays message attributes.
Installation
The WinCC OPC A&E server can be selected during the installation of WinCC. After
installation, the WinCC OPC A&E server can be used immediately without any additional
configuration.
As of WinCC V6.2, the WinCC OPC A&E server can be implemented on a WinCC server
and a WinCC client.
Licensing
In order to operate the OPC A&E server, one of the following licenses must be installed on
each computer running an OPC A&E server:
● WinCC Basic System
● WinCC Connectivity Pack Add-on
Event types
The OPC-A&E server with hierarchical access supports conditional events, simple events
and tracking events.
Simple events
Simple events are messages that inform the OPC A&E client about events. Simple events
include the launching and closing of programs.
Note
Note the following when using redundant systems:
Simple events interconnected to internal tags are sent twice when tags are updated.
The first message is triggered by the master, the second by the standby.
Tracking events
A tracking event is sent with a operator input message to the OPC A&E client. An operator
input message is triggered by manual intervention in the process.
Note
Documentation on OPC
You can find additional information on OPC in the Chapter "Interfaces > OPC - OLE for
Process Control".
9.5.2.1 Differences between OPC A&E and OPC A&E with hierarchical access
Recommendation
Use an OPC A&E server with hierarchical access when creating a new project.
After a project upgrade to WinCC V6.2 SP2 or higher, OPC A&E Server can be used as
before, or be converted for hierarchical access. The conversion can be undone again without
any loss of data. For further information, refer to "How to upgrade OPC A&E to WinCC V6.2
SP2 or higher".
Introduction
OPC A&E for WinCC V6.2 SP2 or higher was enhanced with functions for hierarchical
access to the message system. The OPC-A&E server with non-hierarchical access remains
the standard.
Introduction
The WinCC message system resulting from the configuration defines which event in the
process will generate a message. This message is shown as an event notification in OPC
A&E.
Mapping the WinCC message system on OPC A&E with hierarchical access
The OPC source of the WinCC user text block "2" and the OPC message of WinCC user text
block "1" are used in WinCC as a default setting for mapping the WinCC message systems.
Overview
The following table shows the most important attributes of the event notifications and the
respective information from the WinCC message system.
The events that use the configured attributes are shown in the third column of the table:
● "S" means a simple event
● "C" means a conditional event
● "T" means a tracking event
Note
If text without wild cards are specified as a filter for the area, only the messages of the area
are returned. If you want to include sources that are located in areas outside the specified
area, you need to use wild cards.
NOTICE
The message classes and message types must be configured identically on the connected
OS servers, if you run the OPC A&E server as follows:
• On a WinCC Client
• On a Connectivity station
If the OS server is not configured identically, the employed OPC client must access the
respective OS server directly.
Introduction
The priority of messages is mapped by the OPC A&E server to the attribute "Severity".
When configuring alarms in the messaging system, you can configure a priority between "0"
and "16". The OPC A&E specification defines a value range of "1" to "1000" for the severity.
In this case, "1" stands for the lowest and "1000" for the highest severity.
Therefore, the values of the priority are suitably displayed to the OPC severity. In the
standard mapping, priority "0" is assigned to OPC severity "1" and priority "16" to OPC
severity "1000". All other priority values are interpolated linearly between "0" and "1000".
Introduction
The following table lists the OPC attributes of the WinCC message system. The attributes
are configured in the WinCC message system. Some attributes are intended for internal use
in WinCC only and are therefore not relevant to an OPC A&E client. These attributes are not
contained in the table.
Attributes
Introduction
The acknowledgment policy in WinCC is how a message from "came in" to "went out" is
displayed and processed . On the OPC A&E server, this message status is displayed in the
"ChangeMask" and "NewState" parameters.
NOTICE
Messages with "System, does not require acknowledgment" message class and "Process
control system" message type are transferred as simple events with the "System message"
event category.
ChangeMask
The "ChangeMask" parameter keeps track of where the message status was changed.
Parameter values:
● OPC_CHANGE_ACTIVE_STATE
● OPC_CHANGE_ENABLE_STATE
● OPC_CHANGE_ACK_STATE
NewState
The "NewState" parameter indicates the message status after a change.
Parameter values:
● OPC_CONDITION_ACTIVE
● OPC_CONDITION_ENABLED
● OPC_CONDITION_ACKED
Overview
Note
Historical alarms and events are not acknowledged. The OPC A&E historical events
interface only has read access.
Introduction
Quality codes are used to evaluate the status and quality of a message. The table below lists
the quality codes for OPC A&E.
Quality codes
Introduction
You can access the archived messages via the OPC A&E server using an OPC client. Two
methods are supported for accessing archived messages:
● Output archived messages from a time period in the past
● Output archived messages from a time period in the past without mentioning end of
period. After the output of archived messages, all other newly generated messages are
automatically sent to the OPC client.
NOTICE
After reading archived messages, you cannot use the returned "ActiveTime" of a
message for acknowledging the message or tracing transitions of the message. To
ensure this, the OPC A&E client must check the "EventType" of a message with the
extra flag "OPC_HAE_HISTORICAL_EVENTFLAG". The "ActiveTime" is incorrect on
archived messages. You can find information on the additional flag under "Identifying
archived messages".
Syntax
OPCHAEServer hMode=(read|advise) htStartTime=szTime [hEndTime=szTime]
[bBounds=(TRUE|FALSE)]
Parameter
hMode = [read|advise]
This parameter is required. Defines how the archived messages and events are to be read.
Read: Outputs archived messages and events of a definite period from the past (comparable
to ReadRaw in case of OPC Historical Data Access).
The following is an example for setting a filter for reading over the last 30 minutes:
OPCHAEServer hMode=read htStartTime=NOW-30M bBounds=TRUE
Advise: Outputs archived messages and events from a definite period, After receiving all
archived messages, new messages are sent in the same way as in the case of an active
subscription (comparable to AdviseRaw in case of OPC historical data access).
In the following example, the messages of the last 30 minutes are read (subscription must be
active):
OPCHAEServer hMode=advise htStartTime=NOW-30M
Note
The following notation is supported for parameters "htStartTime" and "htEndTime":
• Relative notations, for example NOW
• Symbolic values, for example NOW, YEAR, MONTH
• Specification of absolute UTC data/time values according to XML notation: 2006-09-
01T10:00:00.000Z
Using the symbolic notation corresponds to the syntax from OPC historical data access.
htStartTime =
This parameter is required. Defines the time from when the messages and events are to be
read from the archive.
htEndTime =
This parameter is optional. Defines the time up to which the messages and events are to be
read from the archive. With "hMode = read", the default setting "NOW" is used.
bBounds = [TRUE|FALSE]
This parameter is optional. Defines how messages close to the start and end time are to be
handled. The function is identical to OPC historical data access.
bBounds=FALSE:
● The time stamp of the first transferred message >= htStartTime
● The time stamp of the last transferred message >= htEndTime
bBounds=TRUE:
● The time stamp of the first transferred message <= htStartTime
● The time stamp of the last transferred message >= hEndTime
Default setting is FALSE.
Introduction
You can use one of the two read modes to read archived messages:
● Read
● Advise
"Read" mode
"Read" mode is used to read archived messages from a defined period in the past. The
sequence of read messages is always read from the alarms in chronological sequence in
reference to each OS server. By setting the start and end time, you can specify whether the
last message is to be read first or last. If the start time is earlier than the end time, the last
message is last in the output.
To use the "read" mode, you need to run the following functions on the subscription:
1. SetFilter
2. Refresh
"SetFilter" during "Refresh" will be rejected. Activating the subscription during "Refresh" does
not have any effect on refresh.
The historic events continue to be transferred with the Refresh flag.
The newly generated events are transferred according to the standard reaction of an active
subscription:
● Taking into account the set filter values with the exception of "historic" source
"OPCHAEServer"
● Without the Refresh flag
The client can therefore distinguish between the received events based on the Refresh flag.
An event package never contains historic and new events at the same time.
● Event packages with Refresh flag only contain historic events. These events can also be
in queue.
● Event packages without the Refresh flag only contain newly generated events.
"Advise" mode
"Advise" mode is used to read archived messages from a defined period onwards in the
past. After reading all archived messages, new messages are sent in the same way as for
an active subscription. The archived messages are transferred in chronological sequence in
reference to each OS server: The archived messages from a start time onwards are
transmitted. Thereafter, the newly archived messages transferred.
Note that you should not define an end time for "advise".
An active subscription is used for "advise" mode. If you run the "SetFilter" function on an
active subscription, the historical alarms are transferred immediately.
If you run "SetFilter" function on an inactive subscription, the archived messages are only
sent after activating the subscription. If you want to use "advise" read mode with an inactive
subscription, proceed as follows:
1. SetFilter
2. Set subscription to active using SetState
The transmission is interrupted if you deactivate the subscription.
The transmission is ended if you set the subscription to "inactive". "SetFilter" is rejected
when the subscription is active.
A "Refresh" on an active "historic" subscription in the "advise" mode functions in the same
way as for a standard subscription:
All queued condition related events are transferred to packages with Refresh flag. The last
package also contains an additional flag "Last Refresh".
A "Refresh" call has no influence on reading historical alarms in "advise" mode.
General procedure
Archived messages are distinguished using an additional flag in EventType. This flag is
linked to the real EventType via a OR link.
Examples
Example 1
The following source filter is used to output archived messages and events of the last 30
minutes in "read" mode. The oldest message for each OS server is output as the first one.
The low limit value is also sent.
OPCHAEServer hMode=read htStartTime=NOW-30M bBounds=TRUE
Example 2
The following source filter is used to output archived events on September 1, 2006 from
10:00 to 12:00 hours in "read" mode. The newest message for each OS server is output as
the first one. The limits for this time period are also sent.
OPCHAEServer hMode=read htStartTime=2006-09-01T12:00:00.000Z
htEndTime=2006-09-01T10:00:00.000Z bBounds=TRUE
Example 3
The following source filter is used to output archived messages and events of the last 30
minutes in "advise" mode. After reading the archived messages, newly generated messages
are sent in the same way as for an active subscription.
OPCHAEServer hmode=advise htStartTime=NOW-30M
Introduction
Data exchange between a WinCC OPC server and OPC client is completed via DCOM.
After installation of WinCC, the DCOM settings of the WinCC OPC server are correctly
configured.
If a WinCC OPC server or client communicates with an external OPC system, corresponding
adaptations must be performed.
The "Local access" and "Remote access" authorizations must be entered for the user in
"DCOM/Workplace/COM Security/Access rights/Edit default" of User Administration.
10.2.1 This is how you configure Windows accounts for the use of WinCC OPC
Introduction
The OPC client and the OPC server are DCOM applications. A distributed DCOM application
can only be run under the same user account. Therefore the OPC server must recognize the
OPC client's user account and vice-versa.
If the WinCC OPC servers are used with WinCC OPC clients, the correct configuration is
already warranted by the installation.
Requirements
Log on as the administrator to both the WinCC OPC server and OPC client workstations to
configure the user permissions.
Procedure
1. Go to "Control Panel > Administration > Computer Management > Local Users and
Groups".
2. In the "Users" shortcut menu, select "New User".
In the "New User" dialog, enter the user account details of the communication partner.
Click "Create" and close the dialog.
3. Click the "Users" icon. Double-click the relevant user. The "Properties" dialog for this user
is displayed.
4. Select the "Member Of" tab. Click "Add". The "Select group" dialog is opened.
5. Add the group "users".
If you are on a computer that has WinCC installed, also add the group "SIMATIC HMI".
Click "OK" to close all open dialogs.
Introduction
After installation of WinCC, the Windows firewall settings of the WinCC OPC servers are
correctly configured.
If OPC clients access OPC servers in different subnets, you must adapt the configuration of
the permitted network areas to the OPC servers.
10.3 XML
Introduction
The OPC XML server of WinCC is realized as a web service. It makes the PC accessible via
Internet. It is therefore necessary to define appropriate access rights.
Introduction
The Internet Information Services make the PC accessible via the Internet. It is therefore
necessary to define appropriate access rights.
Note
If you have any questions or experience problems with the following settings, contact your
Intranet/Internet administrator.
Procedure
1. Start the Management Console in Windows 2003 via "Control Panel > Administration >
Internet Information Services Manager".
In Windows XP, select "Control Panel" > "Administration" > "Internet Information
Services" and activate the Management Console.
2. Select the virtual directory "WinCC-OPC-XML". Choose the "Properties" option from the
shortcut menu. The "WinCC OPC XML Properties" dialog is opened.
3. Click the "Directory Security" tab. On this tab, select the relevant web server security
features.
4. Click the "Edit" button in the "PLC for Anonymous Access and Authentication". The
"Authentication Methods" dialog is displayed.
Introduction
If you want to use the WinCC-OPC-XML-DA server, ensure you have set the correct version
of "ASP.NET" for the Web site for the installation through which the WinCC-OPC-XML Web
service is linked.
Note
If you have any questions or experience problems with the following settings, contact your
Intranet/Internet administrator.
Procedure
1. Start the Management Console in Windows 2003 via "Control Panel > Administration >
Internet Information Services Manager".
In Windows XP, select "Control Panel" > "Administration" > "Internet Information
Services" and activate the Management Console.
2. Select the virtual directory "WinCC-OPC-XML". Choose the "Properties" option from the
shortcut menu. The "WinCC OPC XML Properties" dialog is opened.
3. Click the "ASP.NET" tab. In this tab, configure the settings for the "ASP.NET" of the Web
server.
4. Click on text selection box for the "ASP.NET version". If version "2.x" is not yet set, select
version "2.x".
5. Close all open dialogs.
6. The Web service needs to be restarted after changes are made.
Introduction
OPC XML-DA makes the OPC process data available as a web page. The web page can be
accessed via the Internet using HTTP. The following section explains how to test the
installation.
Procedure
1. Start Internet Explorer on the computer run as the WinCC OPC XML server.
2. Enter the URL "http://localhost/WinCC-OPC-XML/DAWebservice.asmx" in the address
bar. Confirm your entry with <ENTER>.
3. When the OPC XML DA function requests appear, installation was successful.
10.4 Trace
Introduction
The "Trace" function can be used to log tag values and function calls for purposes of testing
and error analysis.
The entries are stored in a trace file. The trace shows the step-by-step progress of the
establishment of the connection, thus making it easier to identify the source of a connection
problem.
Settings
Trace output must be set in the registry of the operating system. For more information, refer
to the SIMATIC Customer Support.
A F
A&E server Functionality of the OPC A&E server
Mapping WinCC message classes and message Conditional event, 69
types, 73 Simple event, 69
A&E server, 60, 69, 70, 73 Tracking event, 69
Conditional event, 69 Functionality of the WinCC OPC A&E Server
Mapping the WinCC message system, 73 Simple Event, 59
Simple event, 69
Tracking event, 69
A&E Server, 59 I
Condition Related Event, 59
I/O field configuration, 25
Hierarchical access, 70
Example of OPC DA, 25
Mapping of the WinCC message system, 60
Item handle, 42
Tracking Event, 59
Item ID, 42
Acknowledgement theory, 64
Acknowledgment policy, 77
Adding a tag
M
Example of OPC DA, 25
Max size, 67
Message classes on OPC A&E servers, 73
B Message types on OPC A&E servers, 73
Bounding values, 42
Buffer time, 67
N
New user, 85
C
Commissioning, 85, 90
O
Connecting WinCC - OPC A&E client
Example of OPC A&E, 66 OPC, 7
Connecting WinCC - OPC A&E client, 66 Commissioning, 85
Configuring access to a WinCC archive tag using
the HDA server browser, 52
D Configuring access to the WinCC message
system, 67
Defining new tag, 31
Example, 27, 28, 30, 31, 34, 35, 36, 39
Example of OPC DA, 31
Example:, 24, 25, 50
Functionality of the OPC A&E server, 69
Functionality of the WinCC OPC A&E Server, 59
E
Functionality of the WinCC OPC DA server, 21
E-server Functionality of the WinCC OPC HDA server, 41
Functionality of WinCC OPC A&OPC, 17 Functionality of WinCC OPC XML server, 17
HDA server browser, 51
New user, 85
OPC in WinCC, 13
ProgID, 22