CMB27 / ModbusRTUMaster

A library to implement the master/client portion of the Modbus RTU protocol on Arduino
MIT License
48 stars 7 forks source link

How to send a coil to all clients? #3

Closed saiid2020 closed 1 year ago

saiid2020 commented 1 year ago

There is no code for broadcast?

CMB27 commented 1 year ago

There is a way to send broadcast messages. Use 0 as the slaveId. Note this only works with the write functions: writeSingleCoil, writeSingleHoldingRegister, writeMultipleCoils, and writeMultipleHoldingRegisters.

e.g.

writeSingleCoil(0, 5, true);

To set coil 5 true on all the slave/server devices connected to the bus.