dimanche 14 janvier 2007

OPC Data Access Specification: Handling real-time data according to the OPC Standard

OPC DA is acronym of OPC Data Access. This is the first specification published by OPC Foundation. It represents the most important one. Released versions include 1.0a, 2.05 and 3.0. But, the most used version is 2.05.

OPC DA is a set of interfaces that handle real time data by making available for read and/or write device’s information according to OPC standard format.

A typical architecture of the OPC DA communication is as follows: First an OPC DA Server is installed on the production level acting as a supervisor for a given manufacturer’s device in respect with OPC standard that defines I/O operations. Therefore, all information retrieved from the device via its specific API by the OPC Server will be exposed as OPC data. Then and to allow access and manipulation of this data, one or many OPC DA Clients are installed anywhere in the manufacturer’s local network. An OPC DA Client will have the possibility to perform read/write operations from/to the OPC Server.

Above is just a brief presentation of OPC DA standard. I guess you have a lot of questions that may include the following:

1. What is the type of information exposed by the OPC DA Server?
2. How can an OPC Server allow data access to any OPC Client?
3. Does an OPC Client have the possibility to get the current value of a tag without adding an OPC group?
4. What are the different operations that can be performed by an OPC Client?
5. What are the different read modes offered by an OPC Server?
6. Are updates made by an OPC Client available for other clients?
7. How can we customize the rate at which an OPC Client receives last values?
8. What is the difference between synchronous and asynchronous modes?
9. In which case we need to use asynchronous mode?
10. Is it possible to communicate OPC Server and OPC Client installed on different machines in the LAN?

In the following, I tried to answer briefly to all these questions:
1. What is the type of information exposed by the OPC DA Server?
An OPC DA Server is designed to collect and control real time data from any device. It makes retrieved data available to any OPC DA Client that complies with the same OPC specification supported by the OPC Server.

2. How can an OPC Server allow data access to any OPC Client?
The OPC Server retrieves the useful information (data points) from a given device by using its API calls. Then, these data points are represented, at the OPC Server level, as tags and may be gathered in branches. That’s called server address space.
Thus, a tag is simply a logical representation of a real data point in the device. Tag names are unique.
Go back to the OPC Client, firs of all, it connects to the OPC Server
and then gets a reference to requested tags to perform requested processing. That’s what we call DA item. Thus, a DA item is reference to a tag in the server address space available by:
- firstly adding a group that present a logical collection of the tags added by the OPC Client on the OPC Server side
- secondly adding an item to this group

3. Does an OPC Client have the possibility to get the current value of a tag without adding an OPC group?
No in the old specifications (1.0 and 2.0), but it became possible in the new one (3.0). The OPC DA specification offers an interface that allows the OPC Client to read the current value and other properties of any tag in the server address space. Available tag’s properties are defined by the OPC Server including:
- access rights
- engineering unit information

4. What are the different operations that can be performed by an OPC Client?
An OPC Client can:
- Retrieve information about the OPC server status
- Browse the server address space and read tags’ properties
- Read current items values
- Write new value to an added item

5. What are the different read modes offered by an OPC Server?
The OPC DA specification offers two (2) read modes:
- Read on demand: the OPC Client requests for reading data synchronously or synchronously
- Data changes: In this case, the OPC Client is informed of new data values by the PC Server whenever changes occur

6. Are updates made by an OPC Client available for other clients?
The OPC Server maintains a client session per connection. Every client session has its own groups and items. But write requests sent by an OPC Client are executed on real data points accessible as items. That’s why other connected OPC Clients are informed with these changes in case they added the same tags.

7. How can we customize the rate at which an OPC Client receives last values?
Items are gathered in groups to share common aspects such as read mode, write mode and the rate or frequency at which the OPC Client receives data values change. This frequency is the update rate of the group. It is expressed in milliseconds.
Example, you add an OPC group with an update rate of 1000 ms to receive data changes every 1 second.

8. What is the difference between synchronous and asynchronous modes?
In synchronous mode (read or write), the OPC Client sends the request and waits for the response to resume its processing. A synchronous call is blocking.
Whereas, in asynchronous mode, we distinguish two types of operations: call and callback.
The call is the request to send to OPC Server where all requested inputs are specified.
The callback is the response sent by the OPC Server at the appropriate moment.
In this case, the call is not blocking and the OPC Client can send its request without being dependant of the immediate response of the server.

9. In which case we need to use asynchronous mode?
In case of frequent data values change, it is recommended to use asynchronous mode to avoid blocking the OPC Client application.

10. Is it possible to communicate OPC Server and OPC Client installed on different machines in the LAN?
OPC standard is based on COM/DCOM technology. Therefore, the OPC solution can be deployed in a distributed environment.
In such case, OPC Server and OPC Client installed on different machines communicate through DCOM.

If you have questions not shown in the list above, please do not hesitate to send them to my email: hassen.kouki@gmail.com. I will be more than happy to answer you within hours.

2 commentaires:

Ignescence a dit…

I've found your presentation very interesting cause I've just started working on OPC Specifications. Thanks for making some concepts clearer for me.

Nataraj J.V a dit…

Very good info.