Libnodave: connectPLC returns -1

蹲街弑〆低调 提交于 2020-01-05 07:44:07

问题


I'm trying to connect to a Siemens CPU315-2 DP via Ethernet by a CP 343-1 Lean using Libnodave dll.

I've tried the example program "simpleISO_TCP.cs" contained in the download file. The function openSocket works just fine but the function connectPLC always returns -1 wich means that the connection to the PLC fails.

Anyone knows what could cause this problem?

PS: I'm using Visual Studio 2012 in Windows 7 64 bit.


回答1:


A few things for you to check:

  • Is the correct hardware configuration downloaded to the PLC
  • Can you ping PLC IP Address
  • If Simatic is installed have you disabled Port 102 service
  • Is your rack and slot number correct

I would try to use the testISO_TCP.exe located in the win folder. Run it from cmd prompt with IP Address and -w flag which will write to some memory addresses(ensure that it safe to do this if it is a production PLC)

I was just doing some work with this library and it was fine using a CPU 317-2 PN/DP with a CP343-1 (6GK7 343-1EX11-0EX0)



来源:https://stackoverflow.com/questions/14247313/libnodave-connectplc-returns-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!