NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

modbus 在用Write Multiple Registers时的问题

我使用的modbus库,使用Write Multiple Registers时总是出错,但使用Write Single Holding Register就没问题,这是怎么回事?

a3.jpg

a4.jpg

a1.jpg

a2.jpg

0 项奖励
1 条消息(共 4 条)
3,605 次查看

看错误码,在建立通信上就出了问题,你的ID设置的是否有误呢:

To set the slave address in the newer Modbus library, use Set Unit ID in Modbus -> Modbus Master -> Utilities.

0 项奖励
2 条消息(共 4 条)
3,524 次查看

报错代码56 为时间报错,因为程序在设定的时间里没有得到任何的相应。

您可参考这链接来解决该问题。

0 项奖励
3 条消息(共 4 条)
3,510 次查看
主从ID是没问题的,使用Write Single Holding Register时就没有问题,再换成Write Multiple Registers就出问题,就是其他参数都不变的情况下只能写单个寄存器,不能写多个寄存器
0 项奖励
4 条消息(共 4 条)
3,484 次查看