1
votes

I'm working on developing an OPC client application for a Windows 7 system which is talking to an OPC server running in Rockwell RSLinx Classic.

The RSLinx Classic package includes an OPC Test Client. The Client program produces a list of OPC Servers to which I can connect (there are a few extra servers on my machine from National Instruments, I'm not sure how they got there). I choose a server and connect. I can monitor items on the server which update in real-time. So I know that I have a working client-server connection.

Now I want to write my own client. How can I get that OPC Server list myself? My research suggests that the Rockwell and/or the National Instruments software installed a program on my computer called OpcEnum.exe in the folder C:\Windows\SysWOW64. It’s not on the PATH. The OpcEnum service shows up on the System Services registry, and it's running. If you execute OpcEnum.exe directly from its folder, it runs... but outputs nothing to the console. What does it do? It has no -h or –help command line option. Presumably, it updates a data file somewhere which enumerates the server names.

I cannot find any documentation which describes OpcEnum.exe in enough detail to understand it.

Any advice you have is appreciated, thanks!

1
Paying the OPC Foundation membership may not be required for you. What is your end goal for using the OPC dlls. I may be able to send you in a different direction will save you a lot of time and hassle. Will you be talking to more than one PLC manufacturer or just using RSLinx?CTGControls

1 Answers

2
votes

OPCEnum is not specific to Rockwell. It is part of common OPC infrastructure, and described in OPC "Classic" specifications (https://opcfoundation.org/developer-tools/specifications-classic/data-access/ ).

There you will find that it exposes its functionality as a COM component. So, if you want to use it, you need to create an instance of a specific COM object (by its CLSID), acquire the documented interface(s), and use their methods to obtain list of COM servers on the computer, or other information about them.

OPCEnum can be installed as part of some software installation (by Rockwell), but it comes from "OPC Core Components" by OPC Foundation (https://opcfoundation.org/developer-tools/samples-and-tools-classic/core-components/ ).

The information about the servers is stored in the registry. In fact, OPC servers use mainly a standard Microsoft COM registration and their information is stored the same way as other COM components, but OPCEnum know the component category/categories of the servers, so it can filter out just the OPC Servers for you; and in OPC 1.0 the servers were not classified into component category, so OPCEnum relies on an extra registry key ("OPC") to find them.