You are on page 1of 23

PcVue Solutions Training

OPC

Purpose
n Overview of the OPC technology,
n Configure PcVue as an OPC Client,
n Configure PcVue as an OPC Server.
Contents

1. Introduction 3
1.1. PcVue version 3
1.2. Files used in this module 3
1.3. Third party software used in this module 3

2. This feature in PcVue architecture 4


3. Basics 5
3.1. Theory 5
3.2. How does it work? 6
3.3. OPC client configuration in PcVue 10
3.4. Variable mapping 14
3.4.1. What is differentiation? 15
3.4.2. How to define a property using an expression 15
3.4.3. OPC Mapping until differentiation 17

4. Summing-up 23

Module 10 _ OPC 2
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
1. Introduction

1.1. PcVue version

This module applies to PcVue version 15.0.

1.2. Files used in this module

The PcVue project at the end of Module 09.

1.3. Third party software used in this module

We will use the Kepware OPC server and client (Evaluation license).

The Kepware files can be found in the Third Party folder of Module 10.

Module 10 _ OPC 3
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
2. This feature in PcVue architecture

Figure 1

Module 10 _ OPC 4
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
3. Basics

3.1. Theory

l OPC is an acronym for OLE for Process Control.

l OPC is a communication standard based on OLE/COM technology.

l OPC is a widely accepted industrial communication standard that enables the


exchange of data between multi-vendor devices and control applications without any
proprietary restrictions. An OPC server can communicate data continuously among
PLCs on the shop floor, RTUs in the field, HMI stations, and software applications on
desktop PCs. Even when the hardware and software are from different vendors, OPC
compliance makes continuous real-time communication possible.

l OPC provides interoperability between applications for SCADA, command control


and industrial equipment control ( communication card, API, etc.).

l The OPC concept is based upon the COM model’s client/server architecture.

l A client application can call upon several OPC servers simultaneously. Those serv-
ers may be located either on the local station or on remote stations via DCOM
(Distributed COM).

l The OPC Foundation is dedicated to ensuring interoperability in automation by cre-


ating and maintaining open specifications. The Foundation has many members some
of which are main players in automation.

l Arc Informatique is an OPC Foundation member.

l The OPC Foundation has released many OPC specifications:

l OPC Data Access (OPC DA): Dedicated to real time data.

l OPC Alarms & Events (OPC AE): Dedicated to alarm management.

l OPC Historical Data Access (OPC HDA): Dedicated to managing archives.

l OPC XML Data Access (OPC XML-DA): Dedicated to real time data. It uses
SOAP XML technology.

PcVue is an OPC DA Client and Server.

PcVue is an OPC XML-DA Client.

Module 10 _ OPC 5
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
PcVue does not implement OPC AE or OPC HDA.

3.2. How does it work?

Here is a standard architecture:

Figure 2

Communication takes place via the following steps:

1. Connection
The Client connects to the Server.

2. Group creation
The Client creates an OPC group using particular parameters:

l Group Name,

l Polling Period,

l Deadband,

l Others…

Module 10 _ OPC 6
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
3. Item subscription
The Client subscribes to one or more OPC item(s) that belong to the group. An
OPC item corresponds to one data item in the PLC.

4. Notification.
The Server starts the communication (according the polling period) with the
device and sends the value of each subscribed item to the Client.
The Server notifies the Client each time an item value changes (taking into
account any deadband).

When the Server notifies the Client it sends several pieces of information:

l Item name,

l Value (V),

l Timestamp (T): PcVue uses (for display and archives) the timestamp
provided by the server,

l Quality (Q): This property indicates the validity of the item. A quality is
good or bad. For example if the server loses communication with the
device, the quality of the item is bad.

l Item type: Boolean, integer, text…

l etc...

Of course you can implement more complex architectures using OPC.

l A Server can notify many Clients:

Module 10 _ OPC 7
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 3

l A Client can be connected to many Servers:

Figure 4

l A Client can be located in a computer other than that of the Server:

Module 10 _ OPC 8
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 5

Exercise 1.
Create a basic architecture (cf. "Basics" on page 5) using Kepware OPC Server and Cli-
ent. The Kepware package includes an OPC server and a sample OPC Client useful for
testing purposes.

1. Install the Kepware package:

a. Run the Kepware installation program KepServerEX.exe. It can be found in


the Third Party folder of Module 10.

b. In the Select features dialog box, expand the Drivers node and select the
Simulation Suite driver.

Figure 6

Module 10 _ OPC 9
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
a. Click the Next buttons until the end of the Wizard.

1. Load the Server configuration file:

a. Select File / Open.

Select: Module10\Third Party\Server_Configuration.opf.

You should have the following screen:

Figure 7

If you click on BUILDING.FLOOR_01.ROOM_001.AC then in the right-hand panel you can


see that three items have been configured:

Name Type Simulated Access mode

CMD Boolean No Read / Write


SETPOINT Word No Read / Write
TEMP Word Yes Read only

We will configure PcVue to read these items.

3.3. OPC client configuration in PcVue

PcVue is a standard OPC Client, so the configuration procedure is similar to that of the Kep-
ware Quick OPC Client.

Module 10 _ OPC 10
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
1. Step 1 Create and configure a connection to the OPC server:

a. Open the Application Explorer and expand the configuration tree to


display the OPC node.

Figure 8

b. From the task pane, select Add an OPC server. The OPC Server dialog
opens.

Module 10 _ OPC 11
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 9

c. Enter an Alias for the server. This is the name that it will be known by
in PcVue.

d. Select the server program identifier ( Server ProgID). Clicking the


arrow adjacent to this field displays a list of known servers.

e. Click OK and the dialog closes and the new server is added. If con-
nection is successful the state will show as Connected.

Module 10 _ OPC 12
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 10

2. Step 2 Create and configure an OPC group:

a. Still using the Application Explorer, select the OPC server and, from the task
pane, select Add an OPC group. The OPC Group Configuration dialog
opens.

Figure 11

Module 10 _ OPC 13
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
a. Click OK to create a new OPC group with default properties.

Figure 12

Exercise 2.
Using the Application Explorer configure a connection to the Kepware OPC server
using default settings. Add an OPC Group, again using the default settings. Save the
configuration and check that the connection is OK. Close the Application Explorer.

3.4. Variable mapping

Variable mapping is the final step in displaying values from an OPC server in PcVue’s vari-
ables. During variable mapping we link the real-time value of a variable to an Item in the
OPC Server.

Variable mapping can be done either using the Application Architect or the Application
Explorer. We will do it using the Application Architect.

By now you have probably noticed a fundamental problem when generating variables (for
example, with Description property) using the Application Architect. Because they are gen-
erated from a template all properties are the same.

We solve this problem in the Application Architect by using a technique called dif-
ferentiation.

Module 10 _ OPC 14
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
3.4.1. What is differentiation?

Differentiation is the general name given to the mechanism in the Application Architect by
which the value of a property is not a fixed value. There are three options for dif-
ferentiating the value of a property:

Input

No value is given at the template level. Instead the value is entered each time the template
is instantiated. In the Architect, a property defined in this manner is marked with a small
red icon .

Expression

The property value is defined by an expression which is evaluated each time the template
is instantiated. An expression can include fixed values and context sensitive operands such
as the template name. In the Architect, a property defined in this manner is marked with a
small green icon . This is the technique we will use for our alarms.

Parameter

The property value is defined by the value of a parameter. The same parameter can be
used any number of times in one or more templates. In the Architect, a property defined in
this manner is marked with a small blue icon . We will cover this technique in a later mod-
ule.

3.4.2. How to define a property using an expression

1. Step 1 Open the Application Architect and select the Templates tab.

2. Step 2 Navigate the templates configuration tree and open the properties grid
that contains the property concerned.

3. Step 3 Right click on the property name (left column) and, from the pop-up menu,
select Define by and Expression. The value of the property will change to the
equality sign and it will be marked by a green icon.

Module 10 _ OPC 15
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 13

4. Step 4 Click the down arrow button that now appears, adjacent to the value field,
and enter the expression using the Expression Edit dialog.

About expressions and the Expression Edit dialog

There is no hiding the fact that expressions can be complex and sometimes difficult to
understand. An expression can contain many items:

l String or numeric values - For example ”Meter Fault” or 100.

l Operators – For example + (addition) or NOT (logical not).

l Functions – For example StrLeft (left part of a string).

l The value of a parameter. Parameters are covered in a later module.

l A property of a configuration element - The syntax is Navigation.Property. For


example TemplateInstance.Name.

The Expression Edit dialog has a very useful feature that is worth knowing about. After you
enter a Navigation keyword a drop down list automatically appears with the range of pos-
sible properties.

Module 10 _ OPC 16
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 14

Some commonly used expression items

There are many Operators and Functions a lot of which you will probably never use.
However you will almost certainly use + which add two numbers or, more usefully, con-
catenates two strings.

But the most commonly used item is probably the property of another configuration ele-
ment. The syntax in this case is Navigation.Property.

Some common Navigation items:

l Parent - One level up the template instantiation hierarchy. A single use of Parent
would reference the template instance.

l TemplateInstance - The instance of the template.

l Template - The template itself.

Some common Properties:

l Name – The name of the element.

l Branch – The branch of the element.

l Description – The description of the element.

3.4.3. OPC Mapping until differentiation

1. Step 1 Using the Application Architect select the template and then the con-
figuration element (variable) that is to be mapped. Change the Source property

Module 10 _ OPC 17
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
to OPC. More properties, related to mapping, appear.

Figure 15

2. Step 2 We must configure the Server and Group. Clicking on the button adjacent
to each property displays what is available (that you previously configured). For
example for Server there is Server01. Select the Server as Server01 and the
Group as Group01.

3. Step 3 The final OPC property is the ItemID. This is the identifier of the item within
the OPC server. The items in the OPC server use the same naming rules as
PcVue. We will configure this property as Define by Expression. Its value will be
automatically calculated by the expression Me.FullBranch.

Module 10 _ OPC 18
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 16

4. Step 4 In the Instances tab, click on an instance of the ACtemplate. Check the cal-
culation of expressions. The ItemIDs are the same as those defined in the Kep-
ware OPC server and in PcVue.

Module 10 _ OPC 19
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 17

5. Step 5 Save the configuration and generate.

Exercise 3.
Modify AC and LT templates in order to add a few variables with an OPC source. Map
the variables to the appropriate OPC items.

a. Open the Application Architect and select the Templates tab. Select AC tem-
plate.

b. Select a variable and set its Source to OPC.

c. Fill in Server and Group properties.

d. Set up an expression in the field ItemID.

Module 10 _ OPC 20
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 18

e. Check the calculation of expressions in Instances tab.

f. Start again for ALL AC and LT variables except for AC.Info

g. Save the changes and generate.

Close and switch off the Kepware Server. What happens


in PcVue? (Hint use File.Exit and shutdown in the OPC
Server menu)?

Module 10 _ OPC 21
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Module 10 _ OPC 22
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
4. Summing-up

l OPC provides interoperability between applications.

l PcVue is a OPC DA Server and Client and also an OPC XML-DA Client.

l There are three steps to configuring any OPC Client: Connection, Group creation, Item
subscription.

l All items subscribed in single group are refreshed according the polling period and
the deadband of the group.

l The OPC Server notifies the client(s) only when the item value changes taking into
account the deadband.

l An item notification includes three main properties: Value, Timestamp, Quality (VTQ).

Module 10 _ OPC 23
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020

You might also like