OPC as Communication Layer in Industrial Automation
The basic principle is quite simple. The Control Web application connects to the OPC server using the OPC
client (driver). The OPC server stores the data written by
Control Web and allows other clients to read
them. Similarly, Control Web application can read
data stored on OPC server, written by other clients. The OPC
server should have the capability to store data items—the OPC server for Control Web
drivers can provide this feature by very simple OPC Storage
Driver, which is supplied with the server.
OPC Server for Control Web Drivers
The OPC server for Control Web
drivers is quite new product. It uses drivers compatible
with Control Web to communicate with industrial
devices. That means the OPC server can provide OPC interface for
every industrial device, for which the Control Web driver exists.
The OPC Storage Driver is included as a part of the
product beginning from version 1.2. This driver does not
communicate with any I/O device, it only stores values
written to its channels and allows reading of these values.
A kind of data storage is then created by the driver. This
storage can be used to pass data among various OPC clients. All
clients connected to this server share the same values.
Channels, their numbers and data types are defined during
driver configuration. This process also defines the size and type
of data storage. The following image shows driver
configuration.

Data storage driver configuration
If the driver is connected to the OPC server, all its channels
become a part of the server's name space. It is of course
possible to connect multiple storage drivers to the OPC server
(the number is not limited) so it is possible to create multiple
storages on single server.
OPC Server as Data Storage
The OPC server is not used for communication with any
particular I/O device, but only to exchange data among
different software layers. It is of course possible to combine
both ways—one OPC server can act as a data
storage and also can communicate with hardware devices.
It is also possible to access the OPC server from remote
computers (on the LAN) thanks to the DCOM (Distributed COM)
technology. So the access to data storage as well as hardware
devices is not limited to single computer.
Example
Let's demonstrate a simple example of the whole system
configuration—creation of Control Web 5 application and OPC server configuration. Our task
is to allow access three variables (logical, numeric and string),
defined in Control Web 5 application, by OPC
clients.
Step 1—Installation
It is necessary to install the following products
in the first step:
Control Web 5 The
Control Web Runtime should be installed for
real application, but the development and testing should be
performed in the development version of Control Web 5.
The OPC client driver for Control Web 5
OPC server for Control Web
drivers
Appropriate license numbers must be entered and all
products must be activated. Individual product documentation
describes these steps thoroughly.
Step 2—OPC Server
Configuration
It is necessary to define OPC server parameters now.
First it is necessary to create data storage, that means to
define data elements, which will be used to exchange data. We
need to create three data elements: logical, numeric and
string.
Run the OPC server and open its configuration window (if
the OPC server is run for the first time after installation,
it opens configuration window automatically). Run the
Device connection wizard (menu item
, ). Enter the data
storage name in the first step, for instance demo.
Choose the OPC Storage driver from the list of
available drivers in the next step.
The driver configuration is run when the wizard finishes.
We must add three new items in the sheet (click the text
add) and set the channel type according to the
following figure.
It is necessary to store the OPC server configuration now
(menu , ).
Step 3—OPC Client Driver for
Control Web 5 Configuration
We will configure the OPC client driver for Control Web 5 in the next step. Run the OPC Driver
Configuration Tool (choose the ,
from the Windows
, menu).
Connect the configuration tool application to the OPC
server (menu , and select Control Web driver OPC DA
v 2.0 server).
There is a tree of all data elements offered by the
connected server on the left side of the configuration tool
window. Insert all three data elements (1, 2 and 3) to driver
configuration (double-click the element name in the tree).
Assign channel number to all elements (the Channel
number column in the sheet). The configuration is shown
on the following figure.
Channels are used for exchanging data with the device
(using the driver) in the Control Web
environment. Thus channels allow communication between
application and OPC server. Every channel is uniquely
identified by a number in Control Web— 1, 2 and 3 in our
case.
Save the configuration now (menu ). Two
files are created on the disk—one with
PAR extension and the second with DMF extension. These files
are used when creating Control Web
application.
Step 4—Control Web 5 application
Run the Control Web 5 and create new
application. Insert the OPC driver into the application and
use the already created PAR and DMF files for its
configuration. Name the driver for instance opc.
Add three virtual instruments into the application in the
next step. The switch instrument sets logical
value, the control instrument sets numeric
value and the string_control instrument sets
string value. Define the output property of all
instruments and set the appropriate driver channel as its
value. For instance the switch instrument will
have the output properly defined:
opc.1
This instrument will write to the first channel. OPC client
driver will pass the value to the OPC server. OPC server
stores the value to the data storage and allows other OPC
clients to read it.
Conclusion
Although the configuration requires some steps to be performed,
it is not very complicated. Control Web
application data can be easily accessed by other OPC clients
now.
Another OPC-related articles:
|