mbpoll 将数据写入中继板

mbpoll writing data to relay board

我无法使用 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]