-
Hi. First a big thank you for this great tool. It is very powerful. I am currently trying to emulate an existing Modbus RTU server whose client sends all commands using the broadcast unit 0 while the server responds from unit 1. When using ModbusTool Server allowing device id 0 will give me a response from that. Luckily the real device still accepts this, but ideally I want to replicate the original behavior. So I was wondering whether there would be a way to instead recognize 0 as broadcast and respond from 1. My understanding is that servers are not supposed to respond to broadcast messages to begin with. However this seems to not be an uncommon pattern if it is known that only one server is on the bus. That way you do not have to bother with finding out the proper device id. Maybe adding the standardized broadcast behavior with an option to allow responses anyways might be a way to go here? I already peeked at the code a bit but was wondering what would be the best way to add this to the tool or if there is even interest in doing so. Or maybe I'm completely on the wrong track and this stuff should be done in scripting? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Hello. Very good question about broadcast address. In case of single Modbus TCP server (with IP address and port) unit/slave address is useless but some devices require to use hardcoded Need to think how to deal with broadcast address. |
Beta Was this translation helpful? Give feedback.
-
I thought about it, but unfortunately it requires reworking the interface of the ModbusLib library subproject. So for now I'm putting it off for the future. |
Beta Was this translation helpful? Give feedback.
Broadcast request is not intended for any response. It is indended for write/set some parameters/bits/registers (not for read, not for any response).
Modbus network is build on RS-485 physical interface (only 2 wires) in most cases.
Master/client initiate request and set unit/address for Modbus parcel and put it into the network. Many slaves/servers are listening the network and when one of them recognize that unit/address is indended for itself it parses the parcel and respond, other devices is simply ignoring the parcel.
So if all devices in the network are recognized broadcast address and will try to respond simultaneously it would be a disaster because they interfere each other and cl…