Issue: Message Function CoCreateInstanceEx failed is Displayed
When you attempt to start the OPC server by an OPC client, the message Function CoCreateInstanceEx failed might be generated (depending on the OPC client you are using) and the OPC server cannot be started.
This behavior may have different causes that are described in the following paragraphs with possible solutions.
The OPC server has not been registered correctly in the Windows operating system. This may occur if the OPC server has been installed repeatedly or the OPC server installation has been exchanged by copying and overwriting the installation files.
Step |
Action |
---|---|
1 |
Enter cmd in the Windows command line (Windows > Start > Execute...). |
2 |
Navigate to the OPC server directory. By default, the directory is C:\Program Files (x86)\Schneider Electric\EcoStruxure Machine Expert\Tools\OPC Server. |
3 |
Enter the command WinCoDeSysOPC /unregserver to remove registrations. |
4 |
Enter the command WinCoDeSysOPC /regserver to register the OPC server as COM server as it is based on COM technology. |
NOTE: Whenever manual registration is required to solve an issue, make sure that these tasks are only performed by qualified personnel.
NOTE: The path of the WinCoDeSysOPC.exe file is used for installation. Thus, the call up may only be performed from a local path.
NOTE: If several OPC servers have been installed in different directories, you have to unregister them individually. To achieve this, execute the command WinCoDeSysOPC /unregserver in each installation directory.
NOTE: The command unregserver also removes the service from the control panel. However, with the command /regserver it is not installed. To reinstall the service, enter the command WinCoDeSysOPC /Service in the command line. Reconfigure the service and start it. Once started, the service is executed until the system is shut down. The communication with the configured controllers is maintained. The service is installed in the same directory as the OPC server.
No OPCServer.ini is available in the OPC server folder.
Make sure that the OPCServer.ini is available at C:\Program Files (x86)\Schneider Electric\OPC-Server.