Thursday, February 23, 2012 : Process Analytical Technology - Multivariate Statistics, Regulatory Guidance, Good Manufacturing Practice, Quality Assurance

processanalyticaltechnology

Photo Gallery

Browse for OPC Servers on Remote Computer

Browse for OPC Servers on Remote Computer

Published: 10/25/2010 by Randy Kondor, OPC Training Institute

» PAT Articles

1. Cause

This error appears in the OPC Client application when it fails to find the OPC Server. The two most common causes are:

  1. Failure to find the OPC server in the Windows Registry
  2. Failure to connect to OPCENUM.EXE

2. Symptoms

When an OPC Client application is unable to find the OPC Server, users receive an error informing them that the OPC Client application could not obtain the CLSID of the OPC Server. Depending on the software product that you are using, this error may appear in various different formats as follows:

  • CLSID not found in Registry
  • OPC Server CLSID not found in Registry
  • Cannot browse for OPC Servers on remote PC
  • Unable to connect to the data source, COM error
  • Failed to intialise Server Object. Invalid Class String
  • Failed to obtain a valid CLSID for server [OPC Server name]
  • DCOM error for CLSID 13486D44-4821-11D2-A494-3CB306C100000
  • Unable to find any OpcEnum server on ; CLSID returns 800706BA

3. Background

The inability to establish the first connection with an OPC Server is both the first and most common error that Integrators encounter when using OPC. 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. A CLSID is similar to your own government-issued identification, such as a Social Security Number (SSN) or Social Insurance Number (SIN), which identifies a specific person.

Most OPC Client applications attempt to display a list of available OPC Servers on the target PC. This process is called Browsing, and is the process whereby the OPC Client application is able to view the OPC Servers that are installed on the remote PC. When the OPC Client performs a Browse, it actually connects to a copy of OpcEnum, which resides on the remote PC, and retrieves the list of available OPC Servers (refer to Figure 1). This list includes the ProgID (human friendly name) and the CLSID (the numerical identification) of each OPC Server. At this point, the OPC Client does not actually connect to the OPC Servers directly. Consequently, the retrieval of the list is independent of the state of each OPC Server and whether it is operational or not.

If the OPC Client application is unable to find the CLSID, for any reason, it will not be able to connect to the OPC Server and use any of the messages in Section "2 Symptoms" (above). The OPC Client application typically retrieves the CLSID from one of two sources:

  • The Windows Registry
  • A Windows application called OpcEnum (on the target PC)

4. OPC Marketplace Observations

A failure to interact either with the Registry or with OpcEnum will result in an error. Section "6 Repair Procedure" (below) explains how to fix the problems that either of the above causes. Nevertheless, keep the following in mind when working with software products that do not seem to behave as you expect.

4.1 Preferred OPC browsing

OPCTI recommends that all programmers enable their OPC Client applications to behave as follows:

  1. Enable users to connect to a copy of OpcEnum on the target PC. If this step succeeds it will provide users with a powerful and flexible method to dynamically browse for OPC Servers on any PC.
  2. If the above fails, the OPC Client application should attempt to connect to the Windows Registry of the target PC. The user of the OPC Client application must have Administrator access rights to connect and browse the Windows Registry. Providing users with Administrator access rights is a security risk.
  3. If the above fails, the OPC Client application should provide users with the ability to manually input a CLSID without having to install new software or modify the Windows Registry in any way. This method enables users to establish an OPC connection with minimal technical knowledge.

4.2 Some applications are unable to connect to OpcEnum

OPCTI recommends that all programmers enable their OPC Client applications to connect to either a local or remote copy of OpcEnum, as per section "4.1 Preferred OPC browsing" (above). However, there are many OPC Client applications that cannot connect to OpcEnum. This is because the programmers who wrote these OPC Client applications decided not to use OpcEnum for browsing. If this is the case integrators will have to do one of the following:

  • Dangerous: Provide the users of the OPC Client applications with Administrator privileges on the target PC to enable them to browse the remote Windows Registry. OPCTI does not recommend this method because it may provide too many people with Administrator access to various PCs, which is a potential security threat.
  • Tedious: Manually copy the OPC Server’s CLSID to the PC on which the OPC Client application resides. This method will not enable the OPC Client application to dynamically browse remote PCs for their list of OPC Servers. However, it does provide a solution that works in a static environment.

4.3 Some applications can’t connect to the Windows Registry

Some OPC Client applications are unable to connect to the Windows Registry regardless of the user’s identity. This is because the vendor did not add this functionality. These applications can typically only connect to a list of OPC Servers that the vendor preselected. There is typically nothing that the user can do in this case because the limitation lies with the application and not with OPC or DCOM.

5. Repair Procedure

Download the whitepaper for the complete solution here: (Full Article).