Skip to content

unit_id=0 is not treated as broadcast (for TCP->RTU gateway) #56

Open
@vanDrunen

Description

@vanDrunen

When using a ModbusTCP to RTU gateway, the unit_id is used to indicate the slave address on the RS-485 bus.
Slave address 0 is for broadcasting, for which no answers from the slaves should be expected, but pyModbusTCP threats unit_id=0 just like all the other values and waits for a response.

The only way to send a series of broadcast messages right now is to set the timeout value very low (approx. the time it takes for the frame to transmit on the RS-485 bus) and to ignore the return value of the write function.

Many devices using ModbusTCP (that are not RTU gateways) often ignore the unit_id value or use unit_id=0 as a regular target, so I understand the reason why it's implemented this way.
It would be a good feature though to be able to indicate somehow that the target is a RTU-Gateway, where unit_id=0 is treated as a broadcast message and the write function just returns True when the transmission is done.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions