如何在 iPhone 应用程序中与 Modbus 设备通信?
我希望能够开发一个可以与 Modbus 设备通信的 iPhone 应用程序,但我不知道如何继续。有没有人有这方面的经验,或者是否有用于此目的的现有图书馆?
I would like to be able to develop an iPhone application that can communicate with Modbus devices, but I'm not sure how to proceed. Has anyone had experience with this or are there existing libraries out there for this purpose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您首先需要知道如何在您的 iPhone 上创建一个简单的 TCP 客户端,以及如何在您的计算机上创建一个简单的 TCP 服务器,您的 iPhone 客户端将通过 WiFi 与之通信。在进行任何客户端/服务器实验之前,请确保 PING 命令有效并且防火墙不会阻止您的服务器端口,并确保用于实验的服务器端口大于 1024 并且尚未使用。然后去官方网站看看MODBUS TCP规范,熟悉你感兴趣的功能代码,并研究此处的 C 代码。然后制作一个简单的 MODBUS TCP 客户端,它可以向 MODBUS TCP 服务器发送请求并解释答案。最好的方法是开始读取单个寄存器值,然后随着时间的推移并添加更多功能。
You will need first to know how to make a simple TCP client on your iPhone, and a simple TCP server on your computer that your iPhone client will talk to via WiFi. Make sure PING command works and firewall does not block your server port before any client/server experiments, and make sure that server port for experimenting is greater then 1024 and not already used. Then take a look at MODBUS TCP specification from official site, get familiar with function codes you are interested in, and study C code found here. Then make a simple MODBUS TCP client that can send a request to MODBUS TCP server and interprete an answer. The best way is to start reading single register value, then progress in time and add more functions.
我完全做到了上述所有要点,我的 iOS Modbus 库工作正常,应用程序现已在 AppStore 上发布,PLCLink 读取任何 modBus 数据并将其设置到我的 Wago 家庭自动化中。
安装指南:http://pautex.fr/plclink
I do exactly all above points, my iOS Modbus lib works fine, application is now up on AppStore, PLCLink read and set any modBus data into my Wago home automation.
Installation guide : http://pautex.fr/plclink