我正在运行下面的modbus从模拟器http://www.modbusdriver.com/diagslave.html以及下面的modbus poller http://www.modbusdriver.com/modpoll.html。奇怪的是,我不想让他们发现彼此。下面是从模拟器输出的
Protocol configuration: Modbus RTU
Slave configuration: address = -1, master activity t/o = 3.00
Serial port configuration: /dev/ttyS0, 19200, 8, 1, even
Server started up successfully.
Listening to network (Ctrl-C to stop)
....................下面是modbus计票器的输出。
Protocol configuration: Modbus RTU
Slave configuration...: address = 1, start reference = 1, count = 1
Communication.........: /dev/ttyS0, 19200, 8, 1, even, t/o 1.00 s, poll rate 1000 ms
Data type.............: 16-bit register, output (holding) register table
-- Polling slave... (Ctrl-C to stop)
Reply time-out!
-- Polling slave... (Ctrl-C to stop)如您所见,modbus从仿真器和modbus poller都有相同的值,应该能够找到对方。但是他们做不到,我觉得很奇怪。有没有人对导致这种情况的原因有任何建议?
发布于 2015-07-21 10:44:00
超时可能出于各种原因,例如
-Check在主服务器上设置的超时时间。您可能已经将其设置为非常低的值,因此正在错过来自奴隶的响应。
希望这能有所帮助。
发布于 2022-06-09 07:07:49
我最近有一个关于Modbus的案例,有两个例子,你可以参考。
https://github.com/asgardpz/Hsl
Readme.md有程序的屏幕,您可以看到它是否是您想要的示例。
https://stackoverflow.com/questions/26765400
复制相似问题