TComPort 和 Modbus-RTU?

发布于 2024-11-14 13:36:15 字数 222 浏览 2 评论 0原文

是否可以使用TComPort for modbus RTU协议读取和发送数据?

我已阅读 modbus 的 wiki http://en.wikipedia.org/wiki/Modbus,但是3.5c 空闲开始和结束是什么意思?

我用的是C++Builder2009

It is possible to read and send data with TComPort for modbus RTU protocol?

I have read wiki http://en.wikipedia.org/wiki/Modbus for modbus, but what mean start and end with 3.5c idle?

I use C++Builder2009

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

同尘 2024-11-21 13:36:15

当然有可能。

MODBUS ASCII中,很容易确定消息的结束,因为通过通信线路传输的单个字节使用2个字节(字节以其ASCII十六进制表示形式传输),但在MODBUS RTU中strong> 你有 1 个字节用于传输单字节,这意味着他们必须以某种方式知道消息已经结束。因此,只要字节之间的停顿少于 3.5 个字符,就会将字节添加到新消息中。当暂停大于 3.5 时,消息就结束了,您可以解析该消息、处理它,并为新消息做好准备。该空闲时间以字符为单位测量,因为这是唯一的常数。超过 9600 和超过 115200 传输 1 个字符的时间段不一样,对于 9600-8N19600-8E2,因此您必须根据 COM 端口设置调整该时间。

Of course it's possible.

In MODBUS ASCII it is easy to determine end of message since 2 bytes are used for single byte transmitted over communication line (byte is transmitted as it's ASCII hexadecimal representation), but in MODBUS RTU you have 1 byte used for single byte transmitted which means that they had to know somehow that messages has ended. So, bytes are added to a new message as long as pause between them is less then 3.5 characters. When pause is greater then 3.5, you have an end of a message and you can parse the message, process it, and get ready for new one. This idle time is measured in characters since that is the only constant. Time period of 1 character transmitted over 9600 and over 115200 is not the same, and it is also not the same for 9600-8N1 and for 9600-8E2, so you have to adjust that time based on COM port settings.

咽泪装欢 2024-11-21 13:36:15

是的,可以使用 modbus 协议发送数据。
有各种软件包,例如 RXTXcomm.jar、comm.jar,它们提供使用 com 端口与从设备通信的功能

yes its possible to send data with comport using modbus protocol.
There are various packages for that like RXTXcomm.jar,comm.jar which provide functions to communicate with slave device using com port

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文