I'm trying to interface .NET (C# or VB doesn't matter) with a Siemens PLC S7 200. I can't however get a connection set up. I'm working on a Win7 64bit machine but can't seem to get it working on 32bit either. I got two files:
Interop.OPCSiemensDAAutomation.dll Siemens_s7-200.dll
From another project which I'm trying to migrate to a newer system. However I get a com exception all the time.
Retrieving the COM class factory for component with CLSID {01704EBD-44B5-11D3-9C09-00105A3DD3AC} failed due to the following error: 80040154.
I've already tried libnodave and can't seem to get that working either. Can somebody provide me with some pointers (please no XKCD humor on that one) to where to look?
I couldn't get Siemens PC-Access to install on this machine, will try on a WinXP 32bit later. I read something about I need an OPC server or something on the machine?
Please bear with me, first time interfacing with a PLC :/
The COM exception is a fairly generic error that indicates that the COM library itself or one its dependencies could not be loaded. Some things I would check are:
Unfortunately this about all the help I can provide in solving your specific problem. However, I can point out that you can use the following products which act as OPC servers and have drivers that are compatible with the Siemens S7. These would be alternatives to using the Siemens OPC server.
I have used both products in the past and I am pretty sure I used one of them (I cannot remember which one) to talk to a Siemens S7.
Also here is a really good website with information about using OPC in .NET.
I've looked into doing this type of thing before. If you try to get at the controller directly, you could run into all kinds of proprietary issues. Automation software companies tend to keep a very tight reign over their protocols. If it's only the data you're after, then OPC is probably the best way to go. However, from what I've found, that's not free either. The OPC Foundation (opcfoundation.org) has a .NET API that's available at a cost in the $1-2K range I believe.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With