Closed dgoo2308 closed 3 years ago
Thanks for the PR! Overall I like the idea, but still not sure that a simple request echo will work as expected in all situations. No doubt it will be correct for force single coil/register functions, but force multiple coil/register functions responses are different from simple request echo, not saying read functions. Do you have some examples of Modbus TCP client software that is expecting such responses for broadcast requests?
@3cky
are the ones I run into and I'm aware of.
I get your point, I'll setup some testing with other writes beside force single coil/register functions and study the responses, I didnt think about that, but yes it falls under 'a write' and thus can have a broadcast.
Thanks
Hello @dgoo2308,
I merged your PR with some small fixes. Please note I decided to change the semantics of replyonbroadcast
config file option. Now it should have a value y
or yes
to enable reply on a broadcast.
Thank you again!
@3cky thanks, looking good.
Reply on Broadcast
Purpose
Some ModBus libraries don't support Broadcast
unitId=0
over tcp/ip what creates timeout and/or error condition in the tcp client. Whilembusd
is already prepared not to wait for a reply on a Broadcast,mbusd
does not send an answer to the client.Change:
This merge request adds the option
-b
tombusd
startup options andreplyonbroadcast
as config file option to enable the reply on a Broadcast, defaulting toNO REPLY ON BROADCAST
. Updates theman mbus
andmbusd -h
or usage:Test w pymodbus
Remark: Without the pymodbus.client
broadcast_enable=True
, to simulate libraries that don't have thebroadcast_enable
on a tcp modbus connection.original or new without
-b
mbusd -b
test libmodbus
ModBus version:
3.1.6
original or new without
-b
mbusd -b