Sunteți pe pagina 1din 69

OPC Classic Student Exercise Guide

Guide V2.1
This Guide is a product of Matrikon International

Matrikon International
Suite 1800, 10405 Jasper Avenue
Edmonton, AB T5J 3N4
Canada
Phone:
+1.780.448.1010
Fax: +1.780.448.9191
www.matrikonopc.com

1|Page

Document Revision History:


Date

22-8-14

Document
Version
1.0

Description
Initial document

Author
C.C.

2.0

Added screen shots

W.D.

2.1

Full revamped based on story


line

R.S.

2|Page

DOCUMENT VERSION
Version:

2.1

COPYRIGHT INFORMATION
Copyright 1997 - 2014, Matrikon International All rights reserved. No part of this document may be
reproduced, stored in a retrieval system, translated, or transmitted in any form or by any means, electronic, mechanical,
photocopying, recording, or otherwise, without prior written permission of Matrikon International

CONFIDENTIAL
The information contained herein is confidential and proprietary to Matrikon International It may not be disclosed or
transferred, directly or indirectly, to any third party without the explicit written permission of Matrikon International

IMPORTANT NOTICE
Although every endeavor has been made to ensure that the information contained within this document is up
to date and accurate, Matrikon cannot be held responsible for any inaccuracy or error in the information
contained within this document. Matrikon makes no warranty of any kind with regard to the information
contained within this document and Matrikon shall not be liable for any direct, indirect, incidental or
consequential damages which may arise in connection with the furnishing, reliance, or use of the information
contained within this document.
Specifications and statements as to performance in this document are Matrikon estimates, intended for
general guidance. Matrikon reserves the right to change the information contained within this document and
any product specification without notice.
Statements in this document are not part of a contract or program product licence insofar as they are
incorporated into a contract or licence by express preference. Issue of this document does not entitle the
recipient to access or use of the products described, and such access or use shall be subject to separate
contracts or licences.
The receiving party shall not disclose, publish, report, communicate, or otherwise transfer any information in
this document to any third party, and shall protect all information contained herein from unauthorized
disclosure. The receiving party shall permit access to this document only to its employees, agents,
subcontractors, and affiliates who reasonably require access to such information contained herein, have been
made aware of the confidential nature of this document and have executed a written employment or other
confidentiality agreement party to maintain the confidential status of this document.

LICENSE AGREEMENT
This document and the software described in this document are supplied under a license agreement and may only be
used in accordance with the terms of that agreement. Matrikon reserves the right to make any improvements and/or
changes to product specifications at any time without notice.

TRADEMARK INFORMATION
The following are either trademarks or registered trademarks of their respective organizations:
Matrikon and MatrikonOPC are trademarks or registered trademarks of Matrikon International

OTHER
MatrikonOPC is a brand of Matrikon International

3|Page

Introduction ............................................................................................................................................................... 5
Who Should Use This Guide ................................................................................................................................ 5
Overview of Guide .............................................................................................................................................. 5
Additional Training .............................................................................................................................................. 5
Document Terminology ...................................................................................................................................... 6
Background ................................................................................................................................................................ 7
Mega Corp........................................................................................................................................................... 7
Exercise overall objective........................................................................................................................................... 8
Level 1 OPC Fundamentals ...................................................................................................................................... 9
Module 1 The Evolution of OPC ....................................................................................................................... 9
Exercise 1.1 OPC Client to Server Connection ............................................................................................. 9
Module 2 The OPC Specification for Data Access .......................................................................................... 15
Exercise 2.1 OPC Server Configuration ...................................................................................................... 15
Module 3 The Historical Data Access (HDA) Specification............................................................................. 22
Exercise 3.1 Desktop Historian Tag Management ..................................................................................... 22
Exercise 3.2 OPC HDA Client Application ................................................................................................... 26
Exercise 3.3 Transferring Data ................................................................................................................... 34
Module 4 The OPC Specification for Alarms and Events ............................................................................... 41
Exercise 4.1 Alarm and Event Subscription ................................................................................................ 41
Level 2 OPC Diagnostics and Troubleshooting ...................................................................................................... 47
Module 5 Classic OPC and Windows .............................................................................................................. 47
Exercise 5.1 DCOM in Local Communication ............................................................................................. 47
Exercise 5.2 OPC Tunneller ........................................................................................................................ 51
Module 6 The Windows Security Framework ................................................................................................ 58
Exercise 6.1 The Effect of the Identity Settings on OPC Servers ............................................................ 58
Module 7 OPC Diagnostics and Troubleshooting........................................................................................... 61
Exercise 7.1 Sniffing OPC Communication ................................................................................................. 61
Exercise 7.2 OPC Server for Performance Monitor (Perfmon) .................................................................. 65

4|Page

Introduction
Welcome to the MatrikonOPCTM Training Solutions Level 1 and 2 Workshop!
Level 1 introduces you to the Fundamentals of OPC; the underlying technology that enables OPC, the OPC
Specifications and the functionalities and behaviours they define, and the servers developed from those
specifications and their relevance to modern data-connectivity requirements.
Level 2 covers OPC Diagnostics and Troubleshooting. From techniques and tools to log files and error codes,
this portion of the workshop deals with issues that are relevant to both the OPC components of the Process
Control Network, and the network and machines themselves.
The workshop consists of a series of presentations on the major OPC specifications, a customer example
highlighting how OPC is used to provide extended value, and OPCs application as a solution to some common
issues affecting data connectivity in the modern industrial.
This guide acts as your resource to carry out the practical exercises that are included to reinforce material
presented in the workshop. Should you have further questions, or require additional information, please
contact your instructor.

Who Should Use This Guide


This guide is intended solely for the use of participants in Levels 1 and 2 of the MatrikonOPC hands-on
workshop.

Overview of Guide
The chapters in this document are structured as follows:

Introduction - this introductory chapter.

Level 1 - OPC Fundamentals.

Level 2 - OPC Diagnostics.

Additional Training
Training which is available but not part of this exercise guide:

Level 3 OPC Architecture Design and Implementation.

Level 4 OPC UA Fundamentals.

Level 5 OPC Security and Threats.

5|Page

Document Terminology
The following table provides a list of definitions for terms used throughout this guide.
Term/Abbreviation

Description

A&E

Alarms & Events OPC specification. Provides access to process alarm


and event data.

COM

Component Object Model. A method for organizing software, specifying


how to build components that can be dynamically interchanged.

DA

OPC Data Access. Provides access to real-time process data.

DCOM

Distributed Component Object Model.

DCOMCNFG

Windows DCOM Configuration Utility Component Services.

DDE

Dynamic Data Exchange.

DMCONFIG

MatrikonOPC Data Manager Configuration Utility.

GUI

Graphical User Interface.

HDA

OPC Historical Data Access. Provides access to historical process data.

HMI

Human Machine Interface. Device that allows interaction between the


user and machine. Typically used in process control applications.

Matrikon

Matrikon International

MatrikonOPC or
Matrikon OPC

A brand of Matrikon International

ODH

MatrikonOPC Desktop Historian.

ODM

MatrikonOPC Data Manager.

OPC

A communication standard. Refer to https://opcfoundation.org for


more information.

ORB

MatrikonOPC Redundancy Broker.

ProgID

Windows program ID.


Table 1 - Terms and Definitions

6|Page

Background
Throughout the level 1 and 2 exercises we will be referring to Mega Corp., a fictitious company derived from
many years of customer experience. The exercises will emphasize how OPC can provide value by providing a
solution to real world problems. You will work though the entire Mega Corp. solution from leaning about
business needs too implementing a solution.

Mega Corp.
Mega Corp. is a multi-national company and has numerous sites of various ages and types. They compete in
the tough modern world economy by providing good service and a quality product. Not all of their sites have
lived up to their vision and are now the focus of targeted enhancements. Our project has to do with one of
the older sites and an effort to increase its operational effectiveness.
The site, Station 3, is one of the older and smaller sites in Mega Corp.s portfolio. The market it serves has a
growing demand and prefers to source locally. Station 3 is the only local supplier and is situated well in terms
of market demand and competition.
Mega Corp. needs Station 3 to solve two immediate problems to satisfy the corporate targeted
enhancements. First, the high tech industry moving into the area requires their supplies to be on time and a
consistent grade for their Just-In-Time (JIT) operations to be effective (and profitable). This is an immediate
need of the customer base. Second, the drain on the aging power grid is starting to affect all industrial
consumers and as such energy costs are rising sharply.

Receiving

Processing

Inspection

Packaging

Shipping

Line 1

Over the past six months Mega Corp.s Station 3 engineering staff has researched all aspects of the plant and
feels they have come up with a winning solution to their immediate problems. Since a JIT manufacturing
process ramps up and down in real time based on customer need predicting future production is hit and miss.
To keep availability the energy consuming machinery is constantly on, even in periods of low usage. The
solution is to add control mechanisms to the machinery where they can be controlled based on the inflow of
source materials allowing them to use less power and still maintain availability. This will also allow the
planning of production around short periods of very high power costs.
Specifically the engineering staff found that source material coming into Station 3 was directly related to
orders. It is also directly related to the energy required to produce product. If the source material volume is
low machinery can be set to idle to save costs while still being able to process the incoming materials, abet at

7|Page

a slower rate. Looking at historical order trends the engineering staff feels they may be able to reduce energy
consumption by 50% with <1% variance in delivery.
The ERP system contains the production requirements and current orders. The existing DCS system is able to
retrieve this information and will be used to control a new Modbus PLC running the production equipment.
The PLC will then provide real time OPC data through the MatrikonOPC Server for Modbus. The DCS will use
its existing OPC client to collect the data and from there will feed data to the existing OPC Desktop Historian
and the HMI. An additional benefit is that local operators will be able to pull up data in Matrikon OPC Trender
or perform calculation on it in Matrikon OPC to Excel.
Control Network Line 1
Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

When the system is in place and order volume varies the DCS will be able to control production machinery
accurately. This will solve the immediate operational effectiveness requirements of Station 3 for Mega Corp.

Exercise overall objective


The Exercises contained in this workbook are designed to be used with the supplied software. Each step will
be described in text as well as shown in screen shots. There may be slight variations on in the software
compared to the text descriptions and screen shots. The intent is not that you are able to follow the steps in
the exercises but to understand what the exercise is teaching. If you have any questions when completing an
exercise please ask the instructor or a classmate for assistance.
The architecture diagram shown above is repeated for each exercise. The area of focus will be highlighted. As
the exercises progress we will be building a simulated architecture on your computers representing Mega
Corps. architecture.

8|Page

Level 1 OPC Fundamentals


Module 1 The Evolution of OPC
Exercise 1.1 OPC Client to Server Connection
Purpose:
When designing an architecture for connecting the DCS to the production equipment an OPC connection was
chosen because of the DCSs existing OPC client capability. To understand how OPC makes a connection we
need to get some hands on experience so we can better determine how the components will communicate
and where in our architecture the components will sit. Were going to start with two of the most common
OPC products available today, the MatrikonOPCTM Explorer as the OPC client application which will connect to
the MatrikonOPCTM Server for Simulation and Testing.
Objectives:
This exercise demonstrates the mechanics of establishing a connection to an OPC server using an OPC client
application. For this exercise you are required to use the MatrikonOPCTM Explorer as the OPC client application
to connect to the MatrikonOPCTM Server for Simulation and Testing.
1.
2.
3.
4.
5.
6.

Create a connection between an OPC client application and an OPC server.


Create an OPC group object.
Select items to add to the OPC group.
Validate and add the selected OPC items.
Read and write values.
Note the OPC server and OPC group properties.
Control Network Line 1
Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

Procedure:

9|Page

1. Open OPC Explorer:


Start All Programs MatrikonOPC Explorer OPC Explorer
2. Select MatrikonOPC Explorer.

3. Select Matrikon.OPC.Simulation.1 from the list of OPC servers installed on Localhost.

10 | P a g e

4. Connect to the selected OPC server by clicking the Connect button on the right-hand side of the
display.

5. Create an OPC group object within the selected OPC Server by double-clicking on the selected server.

Note: There are multiple mechanisms for connecting OPC Explorer to an OPC server, and for adding
groups and items. A complete listing of the methods available for each are listed in the Users Manual for
OPC Explorer and for the specific OPC server.

11 | P a g e

6. Note the properties in the Add Group window. Click on the OK button to accept the default properties
and create the group.

7. The Add Items window opens. Navigate to the SimulationItems.Random branch using the Browse
Tree on the left-hand side of the window.

8. Select all items under the Random branch to add to the recently created OPC group:
a. Select the Random branch under Simulation Items in the Available Items in Server window.
b. Right-click in the Available Tags area.
c. Select Add All Items to Tag List from the displayed menu.
d. Click on the OK button or the
icon. This adds all selected items to the group and reverts
to the main OPC Explorer display.

9. Once you have the data items being displayed in the data area of OPC Explorer, arrange the columns
so that ItemID, Value, Quality, and Timestamp are all clearly displayed.

12 | P a g e

10. Right-click on one of the items displayed in the data area. Note the options available in the displayed
menu.

11. Select the Properties item.


a. Note the status of the Write Access attribute.

12. Close all open applications.

Questions:

1. If Mega Corp. adds additional OPC Servers in the future can they connect to multiple OPC servers from
the one OPC client in the DCS?

2. If you can connect to more than one OPC server how many OPC servers can one OPC client connect to?

3. If Mega Corp. adds additional OPC client based products how many OPC clients can connect to the one
OPC Server connected to the coal feeder?

4. To show Mega Corp. that OPC will be a viable in solving their connectivity issue what are the

13 | P a g e

indications in the OPC Explorer GUI that the connection to the selected OPC server has been
established?

5. Is it possible to access the data items within the OPC server without first creating the group object?

6. Mega Corp. has numerous items they want to collect out of the production equipment but would like
to get them at different rates based on different priorities. This is done by using different group
objects. How many group objects can be created within an OPC server?

7. What item data types are available in OPC?

8.

When showing Mega Corp. that the OPC data can be trusted by looking at the quality of each item
what are some possible qualities in OPC Mega Corp. would be interested in?

9. Mega Corp. is concerned that any solution be interoperable with other vendors and industry standards,
Can OPC Explorer or any OPC client connect to all vendors OPC servers? If so, why?

10. Will the DCS OPC client application display the same information as OPC Explorer? What will be
common between the two OPC clients?

14 | P a g e

Module 2 The OPC Specification for Data Access


Exercise 2.1 OPC Server Configuration
Purpose:
The Mega Corp. engineers in the local area of the plant need to keep tabs on the equipment and how
production is running. They have a local PC connected to the control network and will be able to show real
time values in MatrikonOPC Explorer from the newly installed Modbus PLC. Having local access to the data
means the process engineers can make decisions faster with more accurate data.
Objectives:
This exercise demonstrates the configuration of an OPC server to connect to a data source. It goes on to
provide an understanding of OPC communication between OPC client and OPC server, groups, OPC items and
the functions being called.
1. Configure an OPC server to connect to a device and establish communication with the device.
2. Using an OPC client application, create a Local connection and a Remote, DCOM-managed connection
to the OPC server.
3. Using the appropriate settings in an OPC client, poll the OPC server for the values in the device.
4. Using the appropriate settings in an OPC client, configure the OPC server to provide only those values
from the device which change.
5. Change the Update Rate of the group and observe the effects on Synchronous and Asynchronous
communications.
6. Observer the effects of a loss of communication
a. between server and device, and
b. between client and server.

Control Network Line 1


Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

15 | P a g e

Procedure:

1. Start the MDBUS Modbus device simulation program. The simulator is located in the OPC Classic
folder on the desktop. Click OK in the about box if it appears.

The configuration of the simulator can be verified by clicking on the Configuration menu item.

2. Select the File Ident. button and the OPCTrain.CFG file. Press the Load File(s) button. Click OK.
The Simulator is now configured for the training exercises.

16 | P a g e

3. On the main window select the On menu item to start the simulator. The operating system may ask
for permission to allow firewall access. Accept access.

4. From the Start Menu, launch the configuration of the MatrikonOPC Server for Modbus.
Start All Programs MatrikonOPC Modbus MatrikonOPC Server for Modbus

5. From the Start Menu, launch OPC Explorer


Start All Programs MatrikonOPC Explorer MatrikonOPC Explorer

6. Connect to the Matrikon.OPC .Modbus.1 server.

7. Add all the Configured Aliases tags.

17 | P a g e

8. Change the value of the Cyle_Rate tag to 80.

Note that the Timestamp of the items that change are updated in OPC Explorer. What does this

18 | P a g e

indicate concerning the attributes of this group?

9. Right-click on the OPC group in the OPC Explorer server list area. Select Properties.

10. In General type, select Synchronous I/O from the drop-down list. Click on OK.
What change is noted in the update behavior of the data in the client?

11. Stop the Modbus Simulator by selecting the Off menu item.

What is the effect of this on the data in OPC Explorer?

12. Start the Modbus Simulator by selecting the On menu item.

19 | P a g e

What is the effect of this on the data in OPC Explorer?

17. Open the Windows Services panel.


Start Control Panel Administrative Tools Services

18. Stop the service for the MatrikonOPC Server for Modbus.

What is the effect of this on the connection between OPC Explorer and the OPC Server for Modbus?

19. Re-start the service for MatrikonOPC Server for Modbus.

Does the connection to the OPC Server for Modbus come back with the restart of the server?

20. In OPC Explorer, connect to Matrikon.OPC.Modbus.1. Add all the Configured Aliases tags.

20 | P a g e

21. Open the Group Properties window and increase the Update Rate to 5000 ms.

22. From OPC Explorer, write a value to the Cycle_Rate tag.


What is the delay in the new value appearing in the tag?

23. Close all windows and applications.

21 | P a g e

Module 3 The Historical Data Access (HDA) Specification


Exercise 3.1 Desktop Historian Tag Management
Purpose:
Mega Corp. uses MatrikonOPC Desktop Historian (ODH) to store process data for later analysis or reporting.
The new data collected from the process equipment needs to be stored along with all the existing data.
Adding new OPC tags to collect in ODH is easy to configure and provides Mega Corp. with a level of assurance
that data will be available to satisfy any regulatory agency or manager needing a specific report generated.
Objectives:
Like all process historians, the MatrikonOPCTM Desktop Historian (ODH) is comprised of several modules
depending upon the required functionality of the historian. This exercise demonstrates the configuration of
the OPC client component of ODH
1. Using the ODH configuration panel, add and modify OPC items in the OPC DA client component.
2. Using the Excel add-in for the OPC Desktop Historian, load all tags in the ODH archive into the
spreadsheet.

Control Network Line 1


Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

Procedure:
1. Open the OPC Desktop Historian configuration tool.
Start All Programs MatrikonOPC Desktop Historian MatrikonOPC Desktop Historian.

22 | P a g e

2. In the ODH configuration utility, select and expand Desktop Localhost OPC Desktop Historian
Data Collection Management. Then select Configure.

3. The Data Collection Management tab opens on the right-hand side of the screen.
4.

In the Tag Browser on the left hand side of the configuration panel:
a. Under Source Data Server, click on the ellipsis, navigate to and select the local OPC Server for
Simulation and Testing.
b. Click on the Browse button.
c. Browse to the Simulation Items/ BucketBrigade branch by clicking on each item in turn.
d. Select the BucketBrigade.Int2 and BucketBrigade.Int4 tags.
e. Add these tags to the tag list by clicking on the Add Selected Tags button at the bottom of the
Tag Browser panel.
Note: For use in a future exercise, these two new tags are to be configured as blank tags.

23 | P a g e

5. Delete the Source Name and Process Name attributes for these new tags.

6. Change the Item Name attribute to a name appropriate for archiving data from another database
(e.g., Store1).
7. Ensure that the Archiving attribute is selected.
8. In the lower right-hand corner of the configuration panel, click on the Commit button.
9. These two tags are now added to the tag data base, but are not associated with a data source. No
values are being stored for these tags.
10. Close the ODH configuration window.
11. Open a blank Excel spreadsheet.
Note: If you are using Office 2003, there are additional menu headings for Excel Reporter and Desktop
Historian. If you are using Office 2007 / 2010, these same two add-ins are located in the Add-ins tab

24 | P a g e

group on the ribbon.

12. Select the Add-Ins Desktop Historian Load Tags item.

13. The Load Tags window appears. This allows you to choose the item attributes you wish to display in
the spreadsheet. For this exercise, accept the default, which is to include all of the attributes. Click on
the OK button.

14. All of the configured tags from ODH appear in the Excel spreadsheet. In this application, you are able
to add, modify and delete OPC tags from the tag database.
15. The functions of the ODH Tag Manager Add-in for Excel are described in detail in the ODH Users
Manual. You may use this document as a reference for additional practice if you so choose.

25 | P a g e

Exercise 3.2 OPC HDA Client Application


Purpose:
Mega Corp. local control engineers and technicians would like to be able to access the data and perform
calculations and simple trends without having to request it from the corporate office. MatrikonOPCs Excel
Reporter on a local workstation allows just that giving them access to data when and how they want it.
Objectives:
This exercise demonstrates how to use an OPC HDA client to connect to an OPC HDA-compliant historian and
perform Raw and Processed reads. For this exercise, we are using the MatrikonOPCTM Desktop Historian as the
historian. ODH includes provides an OPC HDA server that we will connect to using MatrikonOPC Excel
Reporter as the OPC HDA client.

1. Using Excel Reporter:


a. Perform a Raw Read.
b. Perform a Processed Read.
c. Create a chart showing updating historical values.

Corporate Network

HMI

ODH

Excel
Reporter
Workstation

ERP

DCS
OPC
Explorer
Tunneller
CSC
DCS Machine

Procedure:
1. Open a blank Excel spreadsheet. If you are using Office 2003, there are additional menu headings for
Excel Reporter and Desktop Historian. If you are using Office 2007, these same two add-ins are located
in the Add-ins tab group on the ribbon.

2. Select cell A1.

26 | P a g e

3. Click on the Add-Ins Excel Reporter Raw History menu item. The Raw History window opens.
Any item not specifically dealt with in this section is to be left at the default value.

4. In the Data Source area, add the OPC HDA server:


a. Click on the ellipsis button next to the Server field.
b. Select My Computer from the drop-down list in the Computer window.
c. Select the Matrikon.OPC.DesktopHistorian.1 OPC server.

27 | P a g e

5. Add a tag using the following procedure:


a. Click on the ellipsis beside the Tags window.
b. Ensure the Matrikon.OPC.DesktopHistorian.1 OPC server is displayed in the Data Source
window.
c. In the Search String, do not change from the default value of *.
d. Under Browse Tree, select and expand the root node. Select LOCALHOST.
e. Under Browsed Tags, select the tag you wish to read.
f. To add a tag to the Selected Tags column, double-click the desired tag name from the
Browsed Tags window. For this exercise, we will be using the Sample_Int1 and Sample_Int2
tags.
g. Click on the OK button.

28 | P a g e

6. The next step is to configure the start and end times (time range) for the data read call. See the
MatrikonOPCTM Analytics Excel Reporter Users Manual for further instructions on this feature. Select a
time range of 1 hour during a period when the system was powered on, typically between 8 and 9
a.m. of the current day. Leave the Cell field blank.

7. The Maximum # of values is to be left at 0.


8. In the Show area, select Qualities as Text.

9. Click on the OK button.


10. A warning message appears notifying you that you have not limited the number of returned values, so
there may be a significant number of values returned. This is anticipated and is correct for this
exercise. Click on the OK button.
11. The values for this item will be written into the spreadsheet.

12. Select cell G1 (or the next empty cell in row 1).
13. Click on the Excel Reporter Processed History menu item. The Processed History window opens.
Items not specifically dealt with in this section are to be left at the default value.

29 | P a g e

14. Use the same Data Source and Tag as the Raw History retrieval.

15. In the Read Method area, select the INTERPOLATIVE aggregate and a Resample Interval of 1 second.

30 | P a g e

16. Set the same Time Interval as the Raw History retrieval.

17. Show the Qualities as Text.


18. Click on the OK button.
19. The values for this item will be written into the spreadsheet. Note the difference in the Quality
between the two types of read.
20. To create a trending chart within Excel Reporter, go to the Add-ins tab group and under Excel
Reporter, select Quick Chart.

Note: In order keep the spreadsheet uncluttered, it is a good idea to start this Quick Chart on
a new spreadsheet.

21. In the Quick Charting windows, select the Desktop Historian server as both the historical and real-time
OPC server.

22. Select the Sample_Int2 tag, and ensure that the Continuously update with latest value checkbox is
selected.

31 | P a g e

23. Click on the OK button.


24. View the resulting chart in the spreadsheet. Verify that the chart is updating every five seconds.

25. Close the Excel spreadsheet without saving the changes. Ensure all Desktop Historian windows are
closed.

Questions:

1. For the values returned from the Raw Read:


a) What is the timestamp interval between the returned values? Why?

b) How do the OPC qualities for the returned values differ from the qualities of DA items we have
seen in previous exercises?

c) Do the OPC timestamps of the returned values match the requested time range?

2. For the values returned from the Processed Read:


a) How do the OPC qualities of the returned values differ from those of the Raw History retrieval?

b) Are the OPC qualities of all of the returned values the same? What is the reason for this?

32 | P a g e

c) How would Mega Corp. use the ability to have different qualities? What advantage is there to
having different qualities?

33 | P a g e

Exercise 3.3 Transferring Data


Purpose:
Mega Corp. head office also needs the production data for billing and forecasting. MatrikonOPC Hub and
Spoke guaranteed data delivery mechanism is used to push the data from the local ODH to the corporate
enterprise historian. Keeping the data local while also having it in the corporate head office means anyone
needing the data has direct access to it. It also means that Station 3 has direct access to its data but is isolated
from other plants enhancing security.
Objectives:
This exercise demonstrates how to use an OPC HDA-based application to affect the transfer of archived data
from one historian to another. During Exercise 3.1 Desktop Historian Tag Management, a pair of blank tags
was created in the OPC Desktop Historian on your machine. Using OPC HistoryLink, you will transfer data from
your partners Desktop Historian to the blank tags in your Desktop Historian. If this isnt possible due to
classroom conditions then you will transfer data from yourself back to yourself using the same mechanisms.
1. Use HistoryLink to transfer data from one historian to another.
2. Configure HistoryLink to recover from a disruption of network connectivity.

Control Network Line 1


Headquarters
Corporate Network
Control Network Line 2
ODH

History
Link

Tunneller
CSC

Tunneller
SSC

Enterprise
Historian

Matrikon
OPC HDA
Explorer

Procedure:
1. Open HistoryLink.
Start All Programs MatrikonOPC HistoryLink MatrikonOPC HistoryLink

2. Expand the MyMatrikonOPC node.


MyMatrikonOPC HistoryLink Scheduled Transaction Options Configure

34 | P a g e

3. Ensure the Maximum Message Window Lines is 100 and click apply.

4. Go to the Management Configuration page.


MyMatrikonOPC HistoryLink Scheduled Transaction Management Configure

35 | P a g e

5. On the right-hand side of the configuration window, click on the New button.

6. The Transaction Edit window appears. In the Item Mapping Summary area, click on the Edit Item
Mappings button.

7. The Item Mapping Editor window appears. Configure the Data Source using the following settings;
a. Type OPC HDA Server
b. Name Localhost Matrikon.OPC.DesktopHistorian.1
c. Click on the Browse button twice, leave the Browse Filter blank.
d. Select the Sample_Int2 item. The item will be highlighted and will remain so when you switch
to the Data Destination area

8. Configure the Data Destination using the following settings;


a. Type OPC HDA Server
b. Name <Destination Machine> Matrikon.OPC.DesktopHistorian.1
c. Click on the Browse button 2x, leave the Browse Filter blank.
d. Select the blank item configured during exercise 3.1. The item will be highlighted.

36 | P a g e

9. Upon selection of the destination tag, the Map Selected button will become active. Click on this
button to create the link between the two selected items.

Note: Ensure that the selected OPC items are of the same data type.

10. Click on the Accept button in the lower right-hand corner of the window. The Item Mapping Editor
window disappears.

11. In the Data Window Configuration area, configure the data range that will be selected for transfer
within the source database. This will be configured By Start and End Time.
12. Adjust the Start Time and End Time for a 15 second data window. Ensure that you use the current
date, and times that are not in the future.

37 | P a g e

13. In the Schedule Transaction area, select Sliding Window.


14. In the Scheduled Start window, set a time (in the very near future) for the transactions to start. Click
on the Accept button.

15. Observe that the transaction messages appear in the window below indicating that the transactions
are taking place.
16. In the Transaction list, observe that the Next Execution time increments by the window size.
17. To ensure that the writes are taking place in the destination archive, use Excel Reporter to view the
data in the destination tags.
Note: If you are using a Remote Desktop Connection to a Virtual Machine in this class, do not perform
the next series of steps. Disconnecting the physical media from your machine results in a loss of
connection to the remote machine.
18. Upon completion of several transactions, interrupt network connectivity, either by pulling the network
cable or disabling the network connection.

38 | P a g e

19. Observe that the transactions continue, with errors. In the destination archive, verify that data is no
longer being written to the destination tags.
20. Re-establish the network connection.
21. Observe that the transactions now show no errors, and that data is being written to the destination
tags. A gap should appear in the data in the destination tag.
22. Select TRN0 in the Transaction list. The Transaction Edit window appears.
23. In the Schedule Transaction area, check the box beside Retry the same sliding window if failed. Set
the Retry Interval to 1 Minute (this is the default value).

24. Click on the Accept button.


25. Using the same method as Step 18, interrupt the network connection.
26. Observe that;
a. The transactions do not continue every 15 seconds, rather the same transaction attempts to
execute every minute
b. The Next Execution increments by 1 minute

27. After 5 minutes, re-establish the network connection.

28. Observe that HistoryLink will schedule and execute all missed transactions until a transaction is
scheduled that has not yet occurred.
29. Delete the transaction and close all windows.

Questions:
1. What is the purpose of the Expanding Window?

39 | P a g e

2. How does it work?

3. Which method works better for network interruption recovery, the Sliding Window with the Retry the
same Sliding Window if failed option selected or the Expanding Window? Based on Mega Corps
requirements which do you think they should use?

40 | P a g e

Module 4 The OPC Specification for Alarms and Events


Exercise 4.1 Alarm and Event Subscription
Purpose:
Hardware monitoring and system maintenance are important to Mega Corp. The new hardware being used to
host the MatrikonOPC Server for Modbus is running in the manufacturing plant away from the normal IT
personal. They have requested a mechanism to monitor and historize some of the system metrics. We will be
doing this already with OPC data so we will provide the Health Monitoring data as OPC data as well.
In addition the needs of IT the Control Engineers want to be immediately informed if there is an issue with the
normal operation of the hardware. For this we can use the alarming mechanism in OPC and provide the data
as OPC Alarms when the chosen system metrics are outside set parameters.
Objectives:
The OPC Specification for Alarms and Events was developed to allow for the creation of OPC servers that
would expose event notification information in devices and control systems and permit OPC A&E clients to
access this information. This exercise demonstrates the establishment of the connection between Event
source, OPC A&E server and an OPC A&E client.
1. Create an event source.
2. Connect to the source using an OPC A&E Server.
3. Subscribe to the event server with an OPC A&E client.

Control Network Line 1


Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

Procedure:

41 | P a g e

1. Open the OPC Server for Events.


Start All Programs MatrikonOPC OPCEvents MatrikonOPC Server for Events

2. Expand the MyMatrikonOPC node.


MyMatrikonOPC Localhost Event Server Events Configure

3. At the top of the page, in the Event Sources area, click on the Event Sources button. The Event
Source Configuration window will open.

42 | P a g e

4. Create an event source, name it MyCPU.

5. On the right-hand side, click on the Add a Condition to this Event Source button. The Condition
Configuration window will open.

6. Configure a condition with the following settings;


a. Name CPUHigh

43 | P a g e

b. Value
c. OPC Item

\\Localhost\Matrikon.OPC.Perfmon.1\localhost\Processor\_Total\% Processor Time

d. Greater Than
e. Constant Value
f. 10

7. Click on Ok.

8. Create a second Event Source named OverUnder. Add a condition based on the Value of the OPC item
Simulation Server \Random.Int1 being Greater Than a Constant Value of 75.
9. After clicking on the Ok button the Event Configuration display returns. On the right-hand side, click
on the New OPC Event button.
10. The Create an OPC Event window opens. Create an event from the MyCPU event source. The Category
is CPU Warning Event (you will have to create this category by typing it in).
11. Enter a message to be displayed in the OPC A&E client when the event is triggered. Select a Severity
Level for this event.

12. Click on the Ok button.


13. The Create an OPC Event window opens. Create an event from the OverUnder event source. The
Category is OPC Warning Event.

44 | P a g e

14. Enter a message to be displayed in the OPC A&E client when the event is triggered. Select a Severity
Level for this event.
15. Click on the Ok button. Minimize the OPC Server for Events configuration window.
16. Open OPC Explorer.
Start All Programs MatrikonOPC Explorer MatrikonOPC Explorer

17. Connect to Matrikon.OPC.OPCEvent.1.

18. Create a subscription to the Event server by clicking on the Add Alarms button.
19. The Add Subscription window opens. Name this subscription CPUHigh, and accept the default settings
on the Subscription Settings tab.
20. On the Filtering tab, accept all of the defaults in the Events area, and CPU Warning Event in the
Categories area.

45 | P a g e

21. Click on the Ok button.


22. Repeat steps 18 21, creating a subscription to the OverUnder event, in the OPC Warning Event
category.
23. Observe that as you select each of the subscriptions under the Event Server, the warning message will
appear every time the event is triggered.

Questions:

1. Why would Mega Corp. use event data instead of monitoring an item value on a HMI faceplate?

2. What other attributes of the Event are displayed in OPC Explorer?

3. For the subscribed events, is there any indication of the Condition that caused the Event to trigger?

4. What does this indicate about the OPC Event server and A&E client?

46 | P a g e

Level 2 OPC Diagnostics and Troubleshooting


Module 5 Classic OPC and Windows
Exercise 5.1 DCOM in Local Communication
Purpose:
Understanding and correctly setting the permissions used by OPC is very important for Mega Corp. It helps to
stay secure against attack and also with the robustness of the communication in times of system outage and
periodic maintenance. A reliable and secure system is the heart of Mega Corps plan to enhance the overall
manufacturing system.
Objectives:
In creating a connection between a COM client and server that are installed on the same machine, it is not just
COM that is involved. This exercise demonstrates the effect of DCOM permissions on a local connection.

Control Network Line 1


Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

Procedure:
1. Open the DCOMCNFG utility.
Start RUN DCOMCNFG

47 | P a g e

2. In the DCOMCNFG utility, open the DCOM permissions configuration GUI for the MatrikonOPC Server
for Modbus Devices by right clicking and selecting Properties.

3. On the Launch and Activation Permissions and Access Permissions of the OPC Server for Modbus
Devices, set the Interactive User permissions to Deny.

48 | P a g e

4. In the same utility, open Windows Services.

49 | P a g e

5. Stop the OPC Server for Modbus Devices using the Windows Services panel.
6. Note that if the OPC Server for Modbus Devices process either does not stop, or it re-starts
automatically it is due to an OPC client reconnecting to the server and restarting it.

7. Attempt to connect OPC Explorer to the OPC Server for Modbus Devices. Note the results.
8. Change the Access Permissions for the Interactive User on the OPC Server for Modbus Devices to
Allow.

9. Attempt to connect OPC Explorer to the OPC Server for Modbus Devices.
a. Note that OPC Explorer can now connect to the OPC Server for Modbus Devices.
10. Reset the permissions for the OPC Server for Modbus Devices to their original values
(Allow Launch and Activation permissions) and stop the service from the service panel.

50 | P a g e

Exercise 5.2 OPC Tunneller


Purpose:
Networking OPC is not simple and potentially not secure if passing through a firewall is a requiring. Mega
Corp. requires that they stay secure and lock down the firewalls. MatrikonOPC Tunneller is the best option to
pass data from one host to another without lowering the security policies in place. Tunneller allows Mega
Corp. to securely pass data back and forth from their different networks with ease. See the network diagram
in Exercise 3.3 Transferring Data for how it can also be used for historical data.
Objectives:
To demonstrate the effect of using OPC Tunnelling to allow connection between OPC server and client.
1. Establish a connection between MatrikonOPC Tunneller components on remote machines.
2. Using an OPC client, connect to the Tunneller connection to the end OPC server.
3. Compare the effects of a communication failure on an OPC connection using DCOM and an OPC
Tunneller connection.

Control Network Line 1


Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

Procedure:
1. Set-up:
a. The trainer will assign you a partner for this exercise. Ask for your partners machine name.
b. Ensure that you can establish a DCOM connection to your partners machine by opening OPC
Explorer and connecting to the Network Neighborhood [Node Name]
Matrikon.OPC.Simulation.1 server.
2. Navigate to Start All Programs MatrikonOPC Tunneller.

51 | P a g e

3. Open the Tunneller Client Side Gateway Configuration (CSC) Utility. Use the Run as Administrator
option.

4. Add a Tunneller connection to the OPC Tunneller Server-Side Component on your machine by
selecting the File menu item and select Add Remote Tunneller Connection from the displayed menu.
Again, be aware that there are multiple mechanisms for performing this function. Consult the
MatrikonOPC Tunneller Users Manual for a complete listing.

52 | P a g e

5. Select your computer name from the drop-down list. Usually this is the machine name that appears in
the window by default. Once connected, all of the installed OPC servers on your machine are listed
under the computer name in the display.

53 | P a g e

6. Once you have successfully added your local machine, add a remote Tunneller connection to your
partners machine using the same procedure as in the previous steps in this exercise.

7. Close the CSC utility window. This will close the configuration utility, but not the configured Tunneller
connections.

8. Open OPC Explorer. You will see that in addition to the OPC servers installed under localhost, you will
now have Tunneller connections to the OPC servers on both yours and your partners machine. The
syntax is as follows:

54 | P a g e

9. Under localhost, select and connect to:

Tunneller:<partnercomputername>:Matrikon.OPC.Simulation.1.

10. Create a group and add all of the Random items from this server.
11. Connect to the same OPC Server for Simulation using a DCOM-managed connection through the
Network Neighborhood. Create a group and add all of the Random items from this server.

55 | P a g e

12. Once you have made the connection and have Good quality in all of the OPC items in both OPC
groups, pull the network cable from your machine. If the cables are not conveniently located, you can
simulate this by disabling the network connection using Windows utilities.
a. Note the following:
i. The DCOM-managed connection to your partners OPC Server for Simulation and
Testing has been destroyed.
ii. Although OPC Explorer is still connected to the Tunneller connection, all qualities of
the items in this connection are Bad.

13. Reconnect the network cables or enable the network connection.


a. Note the following:
i. The DCOM connection to your partners OPC Server for Simulation and Testing is not
restored.
ii. OPC Value, OPC Quality, and OPC Timestamp updates resume for all OPC items
configured in the Tunneller connection.

56 | P a g e

14. Ensure that all applications and configuration windows are closed.

Questions:

1. Will any vendors Tunneller Client-Side work with another vendors Tunneller Server-Side? Why or why
not?

2. Will OPC Tunneller work with all vendors OPC clients and OPC servers?

3.

Mega Corp. will need more than one Tunneller node installed. How many will they need based on the
network diagram above? Why?

57 | P a g e

Module 6 The Windows Security Framework


Exercise 6.1 The Effect of the Identity Settings on OPC Servers
Purpose:
This is a deeper dive into the security settings for COM. Understanding these settings will greatly enhance the
ability to customize the behaviors of the OPC servers. Knowledge of custom behaviors allows Mega Corp. to
tune their system architecture but also allows troubleshooters to identify and fix issues which may
inadvertently come up after maintenance.
Objectives:
The Launch and Activation and Access permissions determine who has authorization to call functions on the
COM object in question. The Identity configuration determines the permissions (i.e., authorization) that the
COM object itself is granted when attempting to perform this same function. There are certain behaviors
associated with these settings that affect the functionality of your OPC architecture. This exercise
demonstrates some of these behaviors.
1. Configure the MatrikonOPC Server for Simulation and Testing to run as an application.
2. Examine the effects of running the OPC Server for Simulation and Testing as the Interactive User.
3. Examine the effects of running the OPC Server for Simulation and Testing as the Launching User.

Control Network Line 1


Corporate Network

MatrikonOPC
Modbus OPC
Server

Tunneller
SSC

MatrikonOPC
Perfmon OPC
Server

HMI

ODH

ERP

DCS

Modbus
PLC

OPC
Explorer
OPC
Explorer

MatrikonOPC
Server for Events

Tunneller
CSC
DCS Machine

OPC Machine

Procedure:
1. Working with a partner, use one machine as the client machine, one as the server machine.

2. On the server machine, set the OPC Server for Simulation and Testing to run as an application by

58 | P a g e

performing the following steps:


a. Open an elevated command line interface by selecting Start cmd , then use the Run as
Administrator option to launch the command-line-interface.
b. Navigate to the OPC Server for Simulation and Testing installation folder:
cd C:\Program Files\Matrikon\OPC\Simulation
c. Unregister the server:
Opcsim -unregserver
d. Register the server as an application:
Opcsim -regserver
e. Open the Windows services panel and ensure that MatrikonOPC Server for Simulation and
Testing is no longer listed as a service.

3. On the server machine, use DCOMCNFG to set the Identity of the OPC Server for Simulation and
Testing to the Interactive User.

4. Log off of the server machine.

5. On the client machine, attempt to connect to the OPC Server for Simulation and Testing on the server
machine using DCOM.
6. On the server machine, log in to Windows.
7. On the client machine, connect to the OPC Server for Simulation and Testing on the server machine
using DCOM.
8. On the server machine, log off of Windows. Observe the effect on the connection between client and
server.

Note: For the next part of this exercise it may be necessary to create additional users.

9. On the server machine, log back on to Windows. Open DCOMCNFG and change the Identity of the
OPC Server for Simulation and Testing to the Launching User.

10. On the server machine, open Task Manager and select the Processes tab.
11. On the client machine, use the Run As option to launch at least three instances of OPC Explorer using
different identities for each instance. For each instance, connect to the OPC Server for Simulation and
Testing on the server machine using DCOM.

59 | P a g e

12. On the server machine, set the OPC Server for Simulation and Testing to run as a service by
performing the following steps:
a. Open a command line interface by selecting Start Run and typing cmd.
b. Navigate to the OPC Server for Simulation and Testing installation folder:
cd C:\Program Files\Matrikon\OPC\Simulation
c. Register the server as a service:
Opcsim -service

Questions:

1. With the OPC Server for Simulation and Testing using the Interactive User identity:
a) How many instances of the server are running?

b) How would this setting affect everyday operations of the OPC servers in use at your plant?

2. With the OPC Server for Simulation and Testing using the Launching User identity:
a) How many instances of the OPC Server for Simulation and Testing are running?

b) What is the User Name listed for the OPC Server for Simulation and Testing?

c) What permissions are associated with this server and how would these affect daily operations?

60 | P a g e

Module 7 OPC Diagnostics and Troubleshooting


Exercise 7.1 Sniffing OPC Communication
Purpose:
There are times when knowing what is being communicated between OPC Client and server can help diagnose
issues. This is often the case when a connection can be created but reads or writes are not working. Often it
is the client asking for something invalid and/or the server returning an error. Being able to see the actual
communication may give you the information needed to be a success.
Objectives:
Using MatrikonOPC Sniffer as a communication logger, make a connection between OPC Explorer and OPC
Simulation server.
1. Connect OPC Explorer to OPC Sniffer.
2. Configure Sniffer to connect to Simulation Server.
3. Review the communication between OPC Explorer and OPC Sniffer.
Procedure:
13. Open OPC Explorer:
Start All Programs MatrikonOPC Explorer OPC Explorer
14. Select MatrikonOPC Explorer.

61 | P a g e

15. Select Matrikon.OPC.Sniffer.1 from the list of OPC servers installed on Localhost.

62 | P a g e

16. Connect to the selected OPC server by clicking the Connect button on the right-hand side of the
display.

17. A console window will appear as well as the configuration screen for OPC Sniffer. Select
Matrikon.OPC.Simulation.1 and hit Continue. Logging will scroll in the console window.

63 | P a g e

18. Browse, Add Items, Read, Write, all will show in the log window.
19. Exit OPC Explorer. Sniffer will also exit.

Questions:
1. OPC Communication is logged. What other information is logged in the OPC communication?

2. Does OPC Sniffer require a license to use it as a troubleshooting tool?

64 | P a g e

Exercise 7.2 OPC Server for Performance Monitor (Perfmon)


Purpose:
Monitoring the host operating system is something IT does regularly. The problem comes when the control
engineering side of the business needs long term tracking of the host performance. Windows performance
monitor can log data to be imported in Excel. Thatll work but its often not practical. What is easier is to use
Matrikons OPC server for Perfmon. It runs as an OPC server and exposes all the Windows performance
monitor data as OPC tags. This way data can be used in your process, alarmed on, or recorded for long term
analysis be an OPC Historian like OC Desktop Historian. An additional useful feature is that it can monitor
many remote hosts at once.
Objectives:
We want to track the total CPU available on the host computer. We will attach to it with OPC Explorer to view
the %CPU used by the idle process to determine what the CPU availability is.
1. Start OPC Explorer and connect to the OPC Server for Perfmon.
2. Browse the available tags and find the CPU idle process metric (there are lots, it may take some
searching).

Procedure:
1. Open OPC Explorer:
Start All Programs MatrikonOPC Explorer OPC Explorer
2. Select MatrikonOPC Explorer.

65 | P a g e

3. Select Matrikon.OPC.Perfmon.1 from the list of OPC servers installed on Localhost.

66 | P a g e

4. Connect to the selected OPC server by clicking the Connect button on the right-hand side of the
display.
5. Create a group in OPC Explorer and browse to the item localhost\Processor\_Total\% Processor
Time.

67 | P a g e

6. Add the item to OPC Explorer.

7. Start and Stop Microsoft Word and notice the CPU usage go up and down.
8. Exit out of OPC Explorer.

Questions:

68 | P a g e

1. What host metrics would you need to use to know if an automation piece of software had deadlocked
(halted but not exited)?

2. Could you also use the same metric to determine if the automation piece of software was overloading
the computers CPU?

3. Could you do the similar things with memory? What can you detect?

4. If combined with the OPC Server for Events which generates OPC Events could you create an automatic
system to help determine the health of the hosts on a network?

69 | P a g e

S-ar putea să vă placă și