libnodave:connectPLC 返回 -1 [英] Libnodave: connectPLC returns -1

查看:57
本文介绍了libnodave:connectPLC 返回 -1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Libnodave dll 通过 CP 343-1 Lean 通过以太网连接到 Siemens CPU315-2 DP.

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

我已经尝试了下载文件中包含的示例程序simpleISO_TCP.cs".函数 openSocket 工作得很好,但函数 connectPLC 总是返回 -1表示与 PLC 的连接失败.

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:我在 Windows 7 64 位中使用 Visual Studio 2012.

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

推荐答案

一些需要检查的事项:

  • 下载到 PLC 的硬件配置是否正确
  • 你能ping通PLC的IP地址
  • 如果安装了 Simatic,您是否禁用了端口 102 服务
  • 您的机架和插槽编号是否正确

我会尝试使用位于 win 文件夹中的 testISO_TCP.exe.运行它带有 IP 地址和 -w 标志的 cmd 提示将写入一些内存地址(确保如果它是生产 PLC,这样做是安全的)

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)

我只是对这个库做了一些工作,使用 CPU 317-2 PN/DP 和 CP343-1 (6GK7 343-1EX11-0EX0) 没问题

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)

这篇关于libnodave:connectPLC 返回 -1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆