Professional Documents
Culture Documents
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
4. Summing-up 23
Module 10 _ OPC 2
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
1. Introduction
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 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 OPC XML Data Access (OPC XML-DA): Dedicated to real time data. It uses
SOAP XML technology.
Module 10 _ OPC 5
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
PcVue does not implement OPC AE or OPC HDA.
Figure 2
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 etc...
Module 10 _ OPC 7
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 3
Figure 4
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.
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.
Figure 7
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:
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.
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
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.
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.
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.
There is no hiding the fact that expressions can be complex and sometimes difficult to
understand. An expression can contain many items:
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
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.
l Parent - One level up the template instantiation hierarchy. A single use of Parent
would reference the template instance.
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
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.
Module 10 _ OPC 20
Arc Informatique © Copyright 2020. All rights reserved Updated 12/11/2020
Figure 18
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 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