.NET interaction with Siemens PLC S7 200

I am trying to establish a .NET interface (C # or VB does not matter) with Siemens S7 200. However, I cannot establish a connection. I work on a 64-bit Win7 machine, but cannot make it work on a 32-bit one. I got two files:

Interop.OPCSiemensDAAutomation.dll Siemens_s7-200.dll

From another project I'm trying to upgrade to a new system. However, I get the 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 have already tried libnodave and it seems I can’t work like that. Can someone provide me some pointers (please not XKCD humor on this) where to look?

I could not get Siemens PC-Access to install on this computer, later I will try to use WinXP 32bit. Did I read something that I need an OPC server or something on the machine?

Please refrain from me by first contacting the PLC: /

+4
source share
3 answers

The COM exception is a fairly common error, indicating that the COM library itself or one of its dependencies cannot be loaded. Some things I would like to check out are as follows:

  • Is the COM library registered on the computer? You can use regsvr32 to register COM dlls.
  • Does the COM library require other dependencies that may not be present on the computer? You can use dumpbin / dependents to figure this out.
  • Should Siemens PC-Access software be installed on the machine? You said you could not install it, which probably explains why the COM library could not be loaded.

Unfortunately, this applies to all the help that 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 compatible with Siemens S7. This would be an alternative to using the Siemens OPC server.

I have used both products in the past, and I'm sure I used one of them (I don’t remember which one) to talk with Siemens S7.

Also here is a really good site with information on using OPC in .NET.

+4
source

I have studied this before. If you try to contact the controller directly, you may encounter all types of property. Automation software companies typically have very tight control over their protocols. If this is only the data you use, then OPC is probably the best way to go. However, from what I found, it is also not free. The OPC Foundation ( opcfoundation.org ) has a .NET API, available at a price in the range of $ 1-2K, which I consider.

+2
source

Try again. I have successfully used libnodave with S7 200, 300 and even 400 and 400H (standby). I have no experience with C #, but it works 24/7 (steelshop and blast furnace) in my Linux daemons and in Delphi and Lazarus Windows applications. If you can't do this, get ready to spend $$$$ on an OPC server for S7 200 (Kepware, Matrikon ...) and for the OPC client library in C #.

+2
source

All Articles