Types of ActiveX objectsThe DCOM (Distributed COM) allows you to access ActiveX objects on another computer
. ActiveX object is object that is created by Microsoft specification of the COM object.
Note: OPC-DA server is also ActiveX object and the following text is valid for it the same way as for other ActiveX objects.
ActiveX objects can hold the following forms:
1) in the form of a DLL or OCX library and the object is created in the context of the calling process.
2) in the form of an EXE program and the object creates its own new process (on the same computer).
3) in the form of an EXE program and the object creates its own new process on the remote computer (by means of the DCOM).
The usage of DCOM in the PROMOTIC system
The installation of DCOM
doesn't relate to the PROMOTIC system, it's a matter of setting OS Windows
and the ActiveX object. Then the PROMOTIC system only uses such installed ActiveX object.
The DCOM in the PROMOTIC system can be used in objects PmaActiveX (see Configuration of the DCOM interface for ActiveX) and PmaOpcDaClient (see Configuration of the DCOM interface for OPC-DA server). In the configurator for object selecting it is possible to enter except the object name, the computer on which the object is created (see the "Run on computer" configurator). The computer can be specified by the computer name or the computer IP address.
Creating objects on other computer by means of the DCOM is suitable for the objects (programs) whose interface was designed and optimized for that purpose. The number of accesses to methods and properties of remote objects should be as low as possible. For example, if 100 values have to be get from the remote object, then all 100 values should be got by calling the sole method that returns all required values, for example, in the array. The interface of OPC components was optimized by this way.
Principle of remote access to common ActiveX objects by means of DCOM
By means of the DCOM
only ActiveX objects can be used that are correctly registered so that they are shown in the OS Windows
configuration tool DCOMCNFG.EXE
. The object must be registered on both the server side (the computer on which the instance of the ActiveX object runs), and the client side (the PROMOTIC application that accesses the remote ActiveX object). In addition there must be enabled the creation of the ActiveX object by means of the DCOMCNFG.EXE
program on the server side from other computers, further there must be set the appropriate access rights to this object for clients and also the context of the Windows
user, in which the ActiveX object will be created. Without this configuration the ActiveX object cannot be created from another computer because the remote computer has no rights for this (like on sharing files it is necessary to enable sharing the appropriate folder and further to set the suitable access rights to shared files).
Configuration of remote access to ActiveX objects by means of DCOM
In order to configure the DCOM
it is necessary to have the OS Windows
administrator rights. The configuration of both DCOM
server and client is similar.
1) Server and client: If the computer of the server and the client is not in the domain, then it is necessary to create the user on the server with the same name and password as the user on the client computer (shared user).
Server and client: If the simplified file sharing in OS Windows XP
is swithced on, then the "Access denied"
error occurs when trying to access the remote OPC server
. Therefore it must be turned off.
See Start > Control Panel > Folder properties > View > Detailed settings > Use simplified file sharing.
Server and client:
Launch the console Start > Programs > Administrative Tools > Local Security Policy.
In the console go to Local Policies > Security Options
Check the following settings:
- Network access: Let Everyone permissions apply to anonymous users is enabled
- Network access: Sharing and security model for local accounts is set to Classic.
4) Server and client: Install ActiveX object (in the form of EXE).
5) Server and client: Launch the DCOMCNFG.EXE configuration tool (located in OS Windows subfolder system32), that represents the DCOM administration console.
Server and client: In the console, go to Component Services > Computers > My Computer
and display the Properties
(by the right mouse button). Here you can manage the configuration of the common parts of COM
and default values for each COM
On the "Default properties"
tab, check the settings:
- Enable Distributed COM on this computer is enabled
- Default Authentication Level is set to None
- Default Impersonation Level is set to Identify.
On the "COM Security"
tab check the settings:
- In Access Permissions > Edit Limits for Everyone the Local Access and the Remote Access are both enabled
- In Access Permissions > Edit Default for the common user (same for client and server) the Local Access and Remote Access are both enabled
- In Launch and Activation Permissions > Edit Limits for Everyone the Local Launch, Remote Launch, Local Activation and Remote Activation are all enabled
- In Launch and Activation Permissions > Edit Default for the common user (same for client and server) the Local Launch, Remote Launch, Local Activation and Remote Activation are all enabled
Server and client: Configuration of the ActiveX
object. In the console go to Component services
> My computer
> DCOM Config
and display the Properties (by the right mouse button).
a) On the "General" tab check if is set Authentication Level to None.
b) On the "Location" tab check if is set Run application on this computer.
c) On the "Security" tab check if all options are set to Use Default. The options are Launch and Activation Permissions, Access Permissions and Configuration Permissions.
d) On the "Identity" tab check whether the Interactive user is set. It is also possible to configure the login details for specific common user, that allows independent access from the client computer regardless of the Windows user that is currently logged in/out on the server.
Setting of messages for PROMOTIC depends on the location of the PROMOTIC software on the disk. If the PROMOTIC software is moved to another location, then the DCOM
stops working (the other functions of the PROMOTIC system may continue to work correctly). If there are multiple PROMOTIC versions on the disk and the user needs to switch between these versions then (from the DCOM
configuration point of view) it is recommended to have the active version of the PROMOTIC always in the same folder (e.g. C:\Promotic\PmActive