A (Partial) Story of OPC URLs

From OPC Labs Knowledge Base
Revision as of 15:09, 10 December 2025 by User (talk | contribs)

Have you ever seen something like this, when connecting to an OPC server?

opcda://TEST-OPC/Kepware.KEPServerEX.V5/{B3AF0BF6-4C0C-4804-A122-6F3B160F4397}

It looks like an URL. But, is it an URL? In this case, you might guess that it refers to an OPC Data Access server, and that the TEST-OPC is the name of the computer, "KEPServerEX.V5" is the OPC server's ProgID, and {B3AF0BF6-4C0C-4804-A122-6F3B160F4397} is its CLSID.

For OPC "Classic" servers, the OPC specification actually do not have a mention of such syntax at all. Yet it seems to be used by various products. The first time I remember seeing this syntax was when playing with the Softing OPC Toolbox Demo Client:

Softing Demo Client with URL

Over the time, I spotted its usage at some other places as well. What's more, people who were not expert in OPC area started to consider such URL-like syntax like a part of the OPC specification, and posted forums questions mentioning the syntax etc. And, customers even used that form when they tried to work with our own products, which did not have a support for it at the time (when specifically dealing with COM servers, we prefer to identify the server directly by the computer name, and the server's ProgID or CLSID).

As it turned out, the probable cause of the proliferation was the OPC NET API, basically a sample code from the OPC Foundation (available to its members) which demonstrates how to create basic OPC servers and clients in .NET. The OPC NET API has a code that displays this syntax at various places to the user, and is able to recognize it as an input to some of its methods. Also, Kepware ClientAce product uses a variant of this syntax.

Things start becoming even more interesting when we put the Internet-based OPC specifications into the mix, because they use the true URLs for connection to the servers. First of them was the OPC XML-DA spec, but now we have OPC-UA with its various transport mechanisms; also, the OPC Xi specifications are based on Web services and thus need URLs.

Below is a short summary of what we could find about the "OPC URL" syntax used in various OPC products.

Softing

Following is the syntax used by Softing for OPC Data Access and OPC Alarms&Events servers, respectively:

opcda://computerName/progId/{clsid}
opcae://computerName/progId/{clsid}

When both ProgID and a version-independent ProgID are available from the server browsing, Softing places just the normal ProgID (version-dependent) to the URL. Note that this is a difference from OPC NET API (described further below). The computerName can be an empty string (for a local computer). Also, the progId may be empty altogether, and the client will simply use the CLSID.

Kepware

Kepware documents following syntax for the URL parameter of their Connect method:

opcSpecification://hostName/serverIdentifier

For OPC Data Access servers, the serverIdentifier has the form below, where the {clsid} is optional:

progID/{clsid}

Originally, Kepware has allowed only "opcda" for the opcSpecification, but as you can see further below, they have later generalized it to support OPC XML-DA and OPC Unified Architecture as well.

Notes from Kepware documentation

For OPC DA servers, the API will attempt to connect using the ClassID first. If the ClassID is not given (or is found to be invalid), the API will attempt to connect using the ProgID.

OPC DA Example

opcda://opcua.demo-this.com/Kepware.KEPServerEX.V5
opcda://127.0.0.1/Kepware.KEPServerEX.V5/{B3AF0BF6-4C0C-4804-A122-6F3B160F4397}

OPC XML-DA Example

http://127.0.0.1/Kepware/xmldaservice.asp

OPC UA Example

opc.tcp://127.0.0.1:49320