OPC for Linux
This site contents useful information about development OPC servers/clients under Linux platform and some other articles and specification which may be helpful for you.
What is OPC and why Linux?
  - XML/DA client
  - Java client
  - DCOM implement
  - Intermediate SW/HW solution
  - UA-COM wrappers
  - Python & Pyro
  - PyOPC
OPC FAQ
Downloads
Links and tools

OPC Frequently Asked Questions



OLE for Process Control (OPC) is an international software standard designed to provide business applications with easy and consistent access to industrial plant floor data. OPC defines standard objects, methods, and properties built on OLE/COM technologies for servers of real-time information like PLCs, DCSs and other controllers to communicate the information they contain to standard OLE/COM enabled client applications.

What is OPC?
Who is the OPC Foundation?
Can I use serial port (RS-232/RS-422,485) card expansions or USB-RS converters to communicate with a device?
What is the relationship between DCOM and OPC?
Why can't my OPC application connect to an OPC Server?
What are the standard DCOM error messages?
Why do I get error - failure to obtain a CLSID?
Why do I get COM error 0x80040202 (NOSUBSCRIBERS)?
Why do I get COM error 0x800706BA?
Why do I get COM error 0x80070005 (ACCESSDENIED)?
Do I have to update all computers to the same OPC distributable package?
How can I use OPC across different computer domains?
What DCOM settings are required for connecting OPC Servers between two different domains?
How do Workgroups and Domains affect OPC connectivity via DCOM?
Will making changes to DCOM to accommodate OPC open any security holes?
What are the security holes when working with OPC?
I cannot have access to the OPC server from a remote computer. Why?
How can I acquire data from an OPC Server through a firewall?
How can I acquire data from an OPC Server through a router?
What ports does DCOM use?
How can I diagnose the cause of an OPC interface to stop collecting data?
How do I know when my OPC Server has lost its connection with its data source (such as a PLC, DCS, Analyzer, etc)?
What are the standard OPC error messages?
How many different OPC Servers can be connected to a single OPC Client application?
How many different OPC Clients can connect to an OPC Server?
How many OPC Servers can I install on a single PC?
What is the OPC Interoperability session?
What is OPC self certification?
How does OPC read and write data from and to a PLC?
The update time is not very fast. I lowered polling cycle but found no difference in the update time. What is wrong?
Is there an easy way to configure OPC for multi-tag data structures on PLCs?
When should I consider using an OPC Tunneling product?
Can I use my HMI software to tunnel OPC data between PCs?
Can OPC UA (Unified Architecture) be used on non-Windows Operating Systems?
Can OPC be configured to work on Linux?
Can OPC be configured to work on Microsoft Windows Vista 64 bit?
In light of the OPC UA (Unified Architecture) specification, should I avoid OPC Servers based on the DA (Data Access) specification?
How does the performance of OPC DA using COM compare with OPC UA using Web Services?
How does the performance of OPC compare with communication over a serial line?
How fast can an OPC Server transfer values?
How well does OPC perform from a computer resource perspective?
Why can I not see OPC Servers when 'browsing'?
What is OpcEnum and why do I need it?
Where does OPC get its timestamp from?
Can I run an OPC Server as a Windows service and what would be the benefits?
How popular is the OPC Historical Data Access (OPC HDA) specification? Has it heavily penetrated industry?
What actions and errors must an OPC application log?




What is OPC?
OLE for Process Control (OPC) is an international software standard designed to provide business applications with easy and consistent access to industrial plant floor data. OPC defines standard objects, methods, and properties built on OLE/COM technologies for servers of real-time information like PLCs, DCSs and other controllers to communicate the information they contain to standard OLE/COM enabled client applications.

Who is the OPC Foundation?
The OPC Foundation is an independent, non-profit organization that has the task of governing the OPC standards. Any company, organization or individual can join the OPC Foundation. The charter of the OPC Foundation is: "To develop an open and interoperable interface standard, based upon the functional requirements of OLE/COM and DCOM technology, that fosters greater interoperability between automation/control software applications, field systems/devices, and business/office applications."

Is there a step by step guide on how to configure an OPC Server? What is the DCOM configuration for both the Client and Server?
The various OPC specifications state how an OPC Server should communicate with an OPC Client. However, the OPC specifications do not state how each product should be configured. To find out how to configure a specific OPC application (such as an OPC Server or a Client application), you must consult the specific product documentation.

Can I use serial port (RS-232/RS-422,485) card expansions or USB-RS converters to communicate with a device?
Yes, Windows sees the ports as COM devices.

What is the relationship between DCOM and OPC?
Classic OPC relies on DCOM for data transportation. That is, OPC specifies the format of data that transfers between applications that use OPC. For example, each OPC Data Access application must transfer a timestamp, quality level and data value. It is not enough to simply pass along the data value itself. So while OPC states what information must transfer between applications, DCOM handles the transfer itself. DCOM also handles security aspects such as authentication and encryption.

Why can't my OPC application connect to an OPC Server?
There are many reasons an OPC Client application will fail to connect to an OPC Server. The single most common reason is a failure to pass the Windows authentication process.

What are the standard DCOM error messages?
Microsoft Windows defines the standard DCOM error messages. DCOM errors typically begin with a "0x800" code, defined in file winerror.h. There are some errors for an OPC Client application to fail to connect to an OPC Server due to DCOM problems.
0x80004001 The requested operation is not implemented.
0x8007000E Server run out of memory
0x80070006 Invalid handle for connection
0x80004005 Unspecified error
0x80070005 Access denied for client

Why do I get error - failure to obtain a CLSID?
This error appears in the OPC Client application when it fails to find the OPC Server. The two most common causes are failure to find the OPC server in the registry or connect to OPCENUM.EXE, general COM error, DCOM error for CLSID. When an OPC Client application tries to connect to an OPC Server, the OPC Client application must be able to identify the exact application (OPC Server) to which it will connect. Each OPC Server is identified by a Class Identification (CLSID). The CLSID is a type of Globally Unique Identifier (GUID), which is a 128-bit number that identifies an application.

Why do I get COM error 0x80040202 (NOSUBSCRIBERS)?
The 0x80040202 error appears in the OPC Client application when it fails to receive a callback from the OPC Server.

Why do I get COM error 0x800706BA?
The 0x800706BA DCOM error appears in the OPC Client application when the OPC Client has lost connection to the OPC Server, but has status "still connected".

Why do I get COM error 0x80070005 (ACCESSDENIED)?
DCOM Error 0x80070005 appears in the OPC Client application when it succeeds in launching an OPC Server or OpcEnum, but fails to receive a reply from either of the applications.

Do I have to update all computers to the same OPC distributable package?
OPC provides specifications that enable applications to communicate with each other. As vendors release their software, and apply patches and upgrades, they provide different executables (distributable packages). However, to ensure successful OPC communication, users do not need to ensure that all their applications have the same releases. While this may be a good practice in some situations, it is not necessary. OPC compliant applications that support the same release of an OPC specification will be able to communicate with each other regardless of their vendor`s release.

How can I use OPC across different computer domains?
What DCOM settings are required for connecting OPC Servers between two different domains? OPC applications can communicate with each other even when they are on different Windows Domains. The trick to getting communication working is Windows Authentication on both the OPC Client and OPC Server PCs. The OPC Client/Server PC must recognize the User Account of the OPC Server/Client PC. Therefore the User Account of the OPC Server/Client must exist in the Active Directory (located on the Domain Controller) of the OPC Client/Server PC. Alternatively, the OPC Client/Server PC must have a local User Account setup for the OPC Server/Client application.

How do Workgroups and Domains affect OPC connectivity via DCOM?

Computers on a Workgroup do not use an external PC (Domain Controller with the Active Directory) to help with the process of Authentication. Instead, they rely on their own information for Authentication.
Suppose an OPC Client application, which resides on a Workgroup, communicates with an OPC Server on a Domain. In this case, the OPC Client application`s User Account must either exist on the Domain Controller (of the OPC Server PC), or on the OPC Server PC itself. Furthermore, the User Account of the OPC Server must exist on the OPC Client application`s PC.
Suppose that an OPC Client application that resides on a Domain communicates with an OPC Server on a Workgroup. In this case, the OPC Client application`s User Account must exist on the OPC Server PC itself. Furthermore, the User Account of the OPC Server must either exist on the Domain Controller (of the OPC Client PC), or the OPC Client application`s PC.

Will making changes to DCOM to accommodate OPC open any security holes?


What are the security holes when working with OPC?
Making changes to DCOM configuration to accommodate OPC communication does not open any security holes or compromise security. Microsoft`s DCOM provides a highly secure and robust platform for applications to setup their communication. Classic OPC (before OPC UA) uses DCOM as its transportation platform. Therefore, an OPC application is, in essence, a DCOM application. OPC only requires the standard configuration that any other DCOM application requires. When properly configured, OPC applications do not open any new security vulnerabilities for DCOM. Having noted the above, many people disable security to get their DCOM (and OPC applications) working for the first time. This is a valid practice; however, Integrators MUST remember to restore the security back when they are done. Failure to do this will cause a security hole. In this case, it would be the Integrators themselves that are the cause of the security hole and not OPC technology in and of itself.

I cannot have access to the OPC server from a remote computer. Why?
To have access to the remote server you have to adjust the security. Run "dcomcnfg.exe" and choose the appropriate OPC server. Click on Properties. Select "Interactive User" on the Identity Tab.

How can I acquire data from an OPC Server through a firewall?
To configure OPC communication to pass through a firewall, you must open a port for DCOM communication and provide application exceptions. Specifically, you must configure your firewall as below. OPC Client/Server PC configuration: you must provide exceptions for DCOM communication, which occurs on TCP port 135. You must also provide exceptions for the OPC Client/Server application. DCOM will take over from there, and will only require enabling 4 ports to establish communication, DCOM will find these ports automatically.

How can I acquire data from an OPC Server through a router?
OPC works seamlessly through most routers. However, any router that provides NAT (Network Address Translation) services will stop DCOM from working. This is because the OPC Server PC must be able to address the OPC Client PC directly. In practice, most routers that are internal to a site/company do not use NAT. However, Routers that provide communication to the Internet typically use NAT and will stop OPC communication. If your OPC applications are separated by a router that uses NAT, you will have to either use Tunneling technology or use OPC UA (which uses web-services to establish communication instead of DCOM).

What ports does DCOM use?
DCOM uses Port 135 to establish communication. Once the OPC Client and Server are able to communicate, they will negotiate new port numbers for communication dynamically. OPC applications typically use 4 ports. Once, the OPC Client and OPC Server applications find the available ports, they use them and release traffic from port 135.

How can I diagnose the cause of an OPC interface to stop collecting data?
First, look at the log files of both OPC applications. Often they will indicate if the application failed to receive a request, or failed to receive a reply. The log files will also indicate whether or not the application sent a request for a reply. This will help you to isolate the cause of the problem and determine whether the source of the miscommunication was on the OPC Client or Server end. Note that the amount of information in a log file is controlled by that application`s vendor. OPC specifications do not specify the type of information to log. Nevertheless, logging any information that would help a person find the cause of problem is good practice. Second, look at the Windows event log to find out if there were any errors logged by Windows. This will also help you to isolate the cause of the problem. Third, use a third-party application to log the OPC communication between the OPC Client and OPC Server. These applications (often called "sniffers" or "loggers") simply capture the communication between the OPC Client and server and record all the calls in a log file. The integrator can then read through the file and determine the cause of the problem.

How do I know when my OPC Server has lost its connection with its data source (such as a PLC, DCS, Analyzer, etc)?
OPC Servers that lose communication with their data source (such as a PLC, DCS, Analyzer, etc), should indicate that the process values now have "Bad Quality". In addition, they should also indicate the reason for this "Bad Quality". For example, an OPC Server can indicate the Quality value is "Bad" because it lost communication with the data source, or the item in question is "out of range" or there was a "Sensor Failure", etc. These quality values can clearly indicate that the loss of communication was due to a failure between the OPC Server and its data source, rather than a communication problem between the OPC Client and OPC Server. Vendors can choose to implement this type of diagnosis in their OPC Server or not. Therefore, some OPC Servers provide no diagnosis at all. The ability to diagnose problems and pass the results in a Quality parameter is an important feature that will help you to differentiate between various vendors. OPC specifications provide a list of possible error values.

What are the standard OPC error messages?
OPC specifications provide a list of possible error values and messages. Vendors can choose whether or not they want to implement these.
The ability to diagnose problems and pass the results in a Quality parameter is an important feature that will help you to differentiate between various vendors.

How many different OPC Servers can be connected to a single OPC Client application?


How many different OPC Clients can connect to an OPC Server?

How many OPC Servers can I install on a single PC? OPC specifications do not limit the number of OPC Servers to which a Client can connect. However, vendors might set their own limits for various commercial, performance, security, and other reasons.

What is the OPC Interoperability session?
The OPC Interoperability session is an event the OPC Foundation hosts three times every year. During the event, OPC vendors gather to ensure their OPC Clients and OPC Servers can communicate with each other. Thus, Vendor X tries to connect their OPC Client application to vendor Y OPC Server and also the OPC Server by Vendor Z. The success and/or failure results are posted on the OPC Foundation`s web site. You should ask all OPC vendors who state their applications are OPC compliant about the last time they attended an OPC Interoperability session and the results of the test.

What is OPC self certification?
The OPC Foundation provides a test harness for OPC Client and OPC Server applications. Vendors use this harness to ensure that their OPC applications can pass all the tests. If the OPC application passes all the tests, the Vendor can state that their application is OPC Compliant. They are also able to post the results of their tests on the OPC Foundation`s website. You should ask all OPC vendors who state their applications are OPC compliant about the last time that they attended an OPC Interoperability session and the results of the test.

How does OPC read and write data from and to a PLC?
An OPC Server provides data to an OPC Client application (such as an HMI, Historian, etc) using OPC. However, an OPC Server always uses a non-OPC method to exchange data with a PLC. For example, suppose an OPC Server communicates with a PLC using the Modbus protocol. In this case, the OPC Server will ask the PLC for specific memory addresses that contain the data that the OPC Server requires. This is done using the Modbus protocol. The PLC provides all the responses to the OPC Server using Modbus as well. This way, the OPC Server can read data from, and write data to the PLC using Modbus. The OPC Server then converts the data it retrieves from the PLC (using Modbus), to OPC "format," and sends the data to an OPC Client application. In every case, the OPC Server must know something very specific about the PLC to which it connects. At minimum, it needs to know the protocol/API spoken by the PLC. However, in most cases, the integrator needs to configure the OPC Server for the specific information the PLC contains, which will change from project to project. In every case, once the integrator configures the OPC Server properly, any OPC Client application can retrieve data from the OPC Server without having to know anything about the PLC or its configuration.

The update time is not very fast. I lowered polling cycle but found no difference in the update time. What is wrong?
The polling cycle may be set to a large time interval. Try to lower the polling cycle to get the desired response time. But remember, the device with which the server is communicating has its own response cycle. If you go beyond the answering capability of the device, there is no improvement of the refresh time.

Is there an easy way to configure OPC for multi-tag data structures on PLCs?
The beauty of OPC is that once the OPC Server has information, any OPC Client can easily retrieve it without having to worry about the specific PLC format. However, configuring an OPC Server to communicate with a PLC takes some work. A common issue is what to do about data sources (PLCs or DCSs) that have a specific structure for the data. With OPC Data Access (DA), the most common mechanism to describe the data is to simply use a common naming convention. Thus, "FIC101.PV" provides the Process Variable, "FIC101.SP" provides the Setpoint, etc. Some OPC Servers are aware of structures in the device to which they are supposed to connect. In this case, the OPC Server can configure itself automatically for the scenario above. Other OPC Servers do not have a predetermined structure and require Integrators to set these up repeatedly for each project. The ability for an OPC Server to automatically configure itself to a PLC, or do so with minimal integrator interaction is a key differentiator between OPC Servers.

When should I consider using an OPC Tunneling product?

DCOM provides a versatile and secure platform for OPC communication. It is also freely available with Windows. However, there are instances where DCOM does not or cannot provide an acceptable solution, and Integrators prefer to pay money to install an OPC tunneling product from a vendor. The following lists the scenarios in which DCOM OPC tunneling technology is preferred over DCOM:
Integrators don`t know how to configure DCOM. (This is the most common reason people use OPC Tunneling.)
Integrators don`t know how to configure the firewall. (This is the second most common reason people use OPC Tunneling.)
There is a requirement to use only a single port for OPC communication. (DCOM typically uses 4 ports.)
Communication timeouts must be closely controlled. (Note that DCOM recovers very quickly in most cases, but there are reported circumstances where timeouts take longer.)
Communication has strict bandwidth restrictions that can only be overcome with OPC Tunneling. (This is sometimes the case when bandwidth is restricted such as in off-shore communication, or wireless telemetry communication.)
You should consider the following if you decide to use OPC Tunneling:
Does the Tunneling product provide Encryption services, or does it send data "in the clear?" If Encryption is available, does it provide an acceptable level of encryption? DCOM provides encryption services that enable it to keep communication secret on a network.
Does the Tunneling product provide Authentication services, or does it allow anyone to connect? Authentication prevents unauthorized users from connecting to a data source.
Does the Tunneling product provide centralized administration of security aspects, or must security be handled at each PC? When using a Domain, DCOM enables users to have a single point for all aspects of security.

Can I use my HMI software to tunnel OPC data between PCs?
Many products can be used to as an OPC tunnel. Some people use an HMI or even their Historian to provide OPC Tunneling services. However, in most cases, an OPC tunnel provides a far easier way to transfer data since the OPC tunnels are typically preconfigured for the specific task of transferring data rather than visualizing or storing it.

Can OPC UA (Unified Architecture) be used on non-Windows Operating Systems?

Can OPC be configured to work on Linux?
Classic OPC was based solely on Microsoft`s DCOM for data transportation. Consequently, OPC applications typically reside on Windows. There are ports of DCOM to other operating systems (such as Linux). Consequently, OPC will work on those systems as well. With OPC UA the OPC Foundation wrote its own services for the data transportation. The OPC Foundation is providing source code to developers who can then port the technology to any operating system.

Can OPC be configured to work on Microsoft Windows Vista 64 bit?
Classic OPC (based on DCOM) works on any operating system that supports DCOM. Microsoft Vista supports DCOM (even in the 64 bit version), thus OPC will work on Windows Vista 64 bit. In addition, OPC also functions properly between 32 and 64 bit systems.

In light of the OPC UA (Unified Architecture) specification, should I avoid OPC Servers based on the DA (Data Access) specification?
There is no need to delay purchases of OPC DA to wait for OPC UA products. This is because OPC UA is backwards compatible with OPC DA. As well, Integrators and vendors will be able to retrofit any OPC DA product with an OPC UA wrapper that the OPC Foundation provides.

How does the performance of OPC DA using COM compare with OPC UA using Web Services?
Initial tests with the binary data transportation for OPC UA show that Classic OPC (based on DCOM) is faster for small messages, while OPC UA is faster for large messages. Nevertheless, context is most important. Both Classic OPC and OPC UA can transfer tens of thousands of values per second, whereas most control systems are unable to keep up with a fraction of this data transfer rate. Consequently, OPC UA is not expected to add another bottleneck to the communication system; just as classic OPC (OPC before Unified Architecture) does not add a communication bottleneck today.

How does the performance of OPC compare with communication over a serial line?


How fast can an OPC Server transfer values?
OPC can transfer tens of thousands of values per second. Some OPC Servers have been clocked at over 100,000 values per second. On the other hand, serial communication typically provides data transfer rates of around 300 values per second, or a little more. Thus, OPC does not add a new communication bottleneck. Typically bottlenecks are a result of non-OPC related factors such as external network limitations.

How well does OPC perform from a computer resource perspective?
There are many factors that affect computer resource usage. Nevertheless, consider the following. Applications that use DCOM abound in the world of IS (Information Systems). This is the reason the OPC Foundation selected DCOM as the platform of choice for OPC. Also DCOM is already loaded in Windows by default. Therefore, the amount extra resources used by OPC applications are minimal.

Why can I not see OPC Servers when 'browsing'?

What is OpcEnum and why do I need it?
When an OPC Client application connects to a remote computer and attempts to browse for OPC Servers, it is actually connecting to a copy of OpcEnum on the remote PC. OpcEnum retrieves the list of OPC Servers on the computer on which it resides. The inability to connect to OpcEnum is typically a result of authentication failure. There are other causes for a failure to connect to OpcEnum.

Where does OPC get its timestamp from?
OPC Servers always send OPC Client applications information on the Value, Quality, and Timestamp of an item. But some control systems do not provide a timestamp. In this case, the OPC Server sends the PC timestamp, which is the only timestamp it has available. When the OPC Server connects to control systems that have information on the timestamp, the OPC Server has a choice. It can either use the timestamp from the control system, or it can use the timestamp from the PC. Some OPC Servers even enable the integrator to make this choice. The ability to use the timestamp from the control system and even to select the source of the timestamp is a differentiating feature amongst OPC Servers.

Can I run an OPC Server as a Windows service and what would be the benefits?
An OPC Server can execute as a Windows service. The benefit of this operation is the OPC Server will start with the Operating System. It will even take the identity of the Operating System which is desirable in some cases. Some OPC Servers cannot execute as a Windows Service. This will either require a user to be logged on to the PC, or some other application to initiate the operation of the OPC Server.

How popular is the OPC Historical Data Access (OPC HDA) specification? Has it heavily penetrated industry?
The most popular OPC Specification today is OPC Data Access (DA). OPC HDA is a distant second, while OPC Alarms & Events (A&E) is a very distant third. Nevertheless, as more users demand standardized access to their historical process data, OPC HDA continues to gain ground. Already all the major historian vendors support OPC HDA.

What actions and errors must an OPC application log?
OPC Specifications do not require applications to log any data specifically. Nevertheless, logging any information that would help a person find the cause of a problem is good practice. Most OPC applications provide some logging facilities.


Main | XML/DA client | Java clients | DCOM implement | Intermediate SW/HW solution | UA-COM wrappers | Downloads | Links and tools

2008, authors of this site don`t carry any responsibility of use this content.