|
|||||||||||||||||||||
|
|||||||||||||||||||||
|
Announcements
Chapters
Services
Feature Zones
|
Note: This is an unedited contribution. If this article is inappropriate,
needs attention or copies someone else's work without reference then please
Report This Article
Contents
IntroductionCOM/OLE applications are widely used in Industrial Automation and Process Control domains. Since not many programmers are aware of these technologies, I thought to share my experience in OPC and most developers would love to expand their knowledge about COM/OLE application areas. This is my first ever article on Code Project, so if you feel anything needs to be improved, drop me a line. Your suggestions and comments are most welcome. The goal of article: Give simple & understandable overview of OPC. More detailed information and specifications can be downloaded from OPC Foundation and websites mentioned in Resources section. So first, about the above diagram...
Theory about Figure 1:Now back to our OPC course. This article gives an overview of OPC and covers following topics. Source code is not available, since most of server code is specific to hardware. And client would still need a server to connect to. But yes, if you want to experiment with OPC, check out the Resources section below. History of OPCIn 1996, a group of companies Rockwell Software, Intellution, et. al. came together to form a consortium that defined a standard for process control. SCADA and similar standardization efforts were being made at that time in process control and automation industry. This group created an initial draft that was based on Microsoft's Object Linking and Embedding (OLE). It was called OLE for Process Control (OPC). OPC Foundation publishes specifications and manages everything that goes into OPC technology. Today more than 300 companies are part of OPC Foundation. Microsoft, GE, Siemens, Rockwell, ABB, Ford, Honeywell and more are members that actively contribute and consume OPC technology. In 2005, OPC Foundation released OPC Unified Architecture draft. There are predecessor drafts released before - OPC HDA, OPC DX, OPC AE, OPC Commands, OPC Security. We will briefly study them in this article. By now, you must have a question in your mind. Let me answer it below...
Refer to figure 2. It shows the devices and software application that were in action on this particular petrochemical plant.
Now, someone like me :) came to them and said, "hey guys, why don't we think smart and implement as in Figure 3?". Observe the reduced complexity. Now all software applications talk only to the OPC Servers. And all devices also respond only to the OPC server. OPC Server provides the Black Box for software applications around hardware.
As you observed correctly, the benefits are:
OPC Concepts & TerminologyOPC specification defines a consistent terminology to identify various entities involved. The best analogy to OPC way of data representation is that of a file system hierarchy. OPC calls it as OPC Address Space. Within this address space every entity can be uniquely identified by its "full-path". For example, refer to figure 4. OPC Address Space is hierarchical. It starts with a root. Then there are logical folders and sub-folders. Leaf nodes are OPC Items or Tags. Generally your sensors and actuators form the leaf nodes. This is an important point to understand and we will spend some time on it. For example, you have a device that can sense temperature, Pressure, and Humidity. Then these attributes are generally mapped as leaf nodes under some folder-subfolder hierarchy. We will see what that hierarchy can be in a moment. If you have an actuator (say, Turn_ON_Boiler), then that also becomes a leaf node. You can write to Turn_ON_Boiler values of 1 or 0 for example, and necessary action will be taken - of course we just assumed that your hardware control mechanism behaves this way. You can read from Temperature to know sensed value.Hope we are all clear till this point. Now let's understand this "logical" folder stuff. The logical folders and sub-folders are used to represent state of your Industrial Automation system. This configuration can actually map to some physical configuration or even geographical setup. Let's spend some time to understand this one as well. For example, in this diagram we have an ethernet communication channel to which a wireless meter is connected. And within wireless meter, there are two classes "Average" and "Channel1". These folders and sub-folders are very effective means of grouping your process control parameters and values. This address space is "published" to all clients of OPC server. The OPC clients can be simple spreadsheets like Excel, process historians that keep record of data coming from various industrial plant entities. Every client can create a logical entity called as group inside OPC server. Each OPC Group can contain a set of OPC Items.
Synchronous & Asynchronous OPC Item reading OPC Component Categories Enumeration issue is addressed by requiring OPC servers to implement component categories. For example, all servers that are OPC DA 1.0 (more about this in later sections) compliant implement COM category with CatID {63D5F430-CFE4-11d1-B2C8-0060083BA1FB}. Similarly the servers compliant with OPC Data Access 2.0 implement category with CatID {63D5F432-CFE4-11d1-B2C8-0060083BA1FB}.So OPC Foundation distributes a Windows Service called as OPCEnum. Enumerating OPC Servers OPCEnum.exe runs as a Windows Service and provides enumeration functionality. Using OPCEnum, the client applications can query available OPC Servers on local as well as remote networked machines.Now let's look at server component interfaces.
IOPCBrowse This interface has methods that allow browsing OPC Address Space. Client can query level by level folders and subfolders till the leaf nodes. The hierarchy looks like shown in figure 4. IOPCItemIO Interface is used for performing OPC Item read and write operations. Now let's understand how OPC Client interacts with the OPC Server. Important steps involved are summarized in figure 6, below.
As you may have identified these IOPCSyncIO etc interfaces that are relevant for synchronous and asynchronous OPC Item read and write operations. OPC Group Components also support connection point container for events that are used for client notifications. At least you have some idea by now that OPC is just another COM application in action - just that it is a standard meaning all OPC Clients and OPC Servers are bound by design contract. OPC ComplianceOPC Foundation provides compliance test applications. Using these suites one can execute certain number of test cases on OPC Server and determine their compliance to particular OPC Specifications. There are several OPC specifications available (explained in next section). A typical compliance report looks like as shown in figures 8 & 9.
OPC SpecificationsOPC Foundation is responsible for maintaining and releasing new specifications. It is a body made up of industry experts, companies that produce OPC products and organizations that consume OPC products. So far OPC Foundation has released following specifications.
Most recently OPC Foundation has released a draft for OPC Unified Architecture that attempts to provide even more integration of process control data and software with other industrial software systems like ERP. ResourcesThere are plenty of resources available on the web about OPC.
| ||||||||||||||||||||