mbpoll 将数据写入中继板

凯文192291

我无法使用 mbpoll 将正确的数据写入中继板。它使用Modbus RTU,我需要写入的数据是:01 06 00 01 01 00 D9 9A

我使用的命令是:sudo ./mbpoll -m rtu -b 9600 -0 -t 4:hex -P none -v /dev/ttyUSB0 -1 0001这给了我一个结果:

Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
                        start reference = 1, count = 1
Communication.........: /dev/ttyUSB0,       9600-8N1 
                        t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

[01][06][00][01][00][01][19][CA]
Waiting for a confirmation...
<01><06><00><01><00><01><19><CA>
Written 1 references.

它稍微关闭并且继电器板没有响应。知道如何使用 mbpoll 编写正确格式的数据吗?

非常感谢!!!!!

英国人

您需要请求寄存器 256(您指定的 PDU 寻址-0)。所以以下(使用不同的端口)应该可以工作:

mbpoll -m rtu -b 9600 -0 -t 4:hex -P none -v  /dev/ttymxc0 -1 256

结果是:

Protocol configuration: Modbus RTU
Slave configuration...: address = [1]
                        start reference = 1, count = 1
Communication.........: /dev/ttymxc0,       9600-8N1
                        t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table

[01][06][00][01][01][00][D9][9A]

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章