arduino-libraries/ArduinoModbus

Broadcast transmission blocks for TIMEOUT ms

bobemoe opened this issue · 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 #28