COM / DCOM Technology

Microsoft COM (Component Object Model) enables inter-process communication between software components. It uses a Client/Server Architecture: a COM Client connects to a COM Server, the COM Server has COM objects with several interfaces that the Client can use. When COM was made available for components on 2 different computers in a network, it became DCOM (Distributed Component Object Model).

When a COM Server is installed on a Windows operating system, it needs to register a class identifier in the registry (CLSID). The COM client can start the server using the CLSID.

Classic OPC uses COM/DCOM communication. The OPC specifications define the COM object hierarchy of an OPC Server, and also define COM Objects as well as the interfaces and methods that need to be implemented by OPC Clients and OPC Servers.

For more information, please visit the Microsoft webpages on COM and DCOM technologies.

When a COM Client makes a call to a remote COM Server, Windows security on the remote machine checks if the user of the call is allowed to access the COM Server, therefore it is always necessary to be aware of the user of the Client or Server application. Windows security can be configured for DCOM components in the Windows component services (DCOMCNFG).

OPC Client and OPC Server
Figure 1. OPC Client and OPC Server

Callback

Asynchronous communication in COM is done via the callback mechanism. In this case the COM Server calls the COM Client to transmit data. This reverses the Client/Server concept of the COM communication with the COM client also acting as server.

For security settings this is very important:

  • A “normal” interface call requires authentication of the COM Client Windows user on the COM Server’s operating system. (> Synchronous communication)

  • For a callback the OPC Server, Windows user needs to authenticate on the OPC Client’s operating system

DCOM security and firewall on Client operating system has to be configured to allow the servers callback.

DCOM Callback
Figure 2. DCOM Callback

In Proc / Out Proc

COM components can be implemented as OutProc or InProc components. OutProc (Out-Of-Process) servers have their own Executable, whereas an InProc (In-Process) COM component is implemented in a library (DLL).

Advantage of InProc OPC Servers:

  • DCOM calls are much faster between OPC Client and InProc Server, since they are part of the same process.

Disadvantages of InProc OPC components are:

  • InProc OPC Servers can only be connected locally

  • Setting up Windows security is more difficult, since it might be difficult to see under which process and user your OPC Client or Server is executed

Not many InProc OPC Servers or clients exist in the process industry, since it is more complex to implement them.