ArduinoModbus icon indicating copy to clipboard operation
ArduinoModbus copied to clipboard

Broadcast transmission blocks for TIMEOUT ms

Open bobemoe opened this issue 2 years ago • 0 comments

When sending broadcast message (as per modbus spec to server ID 0) the endTransmission() blocks and timeouts, the function returns failed even though all the servers successfully receive the transmission.

ModbusRTUClient.beginTransmission(0, HOLDING_REGISTERS, 0x00, 3);
ModbusRTUClient.write(0);
ModbusRTUClient.write(a);
ModbusRTUClient.write(b);
ModbusRTUClient.endTransmission(); //  broadcast always returns false :/

The issue I am having is that timeout is 1000ms and I can't afford that much delay in my code. Normal transmissions take about 18ms.

Modbus spec says broadcasts should not have replies so there is no need to wait for timeout and the function should return (success) immediately.

It is not even possible as a workaround to change the timeout because https://github.com/arduino-libraries/ArduinoModbus/issues/28

bobemoe avatar Jul 28 '23 19:07 bobemoe