ModbusMaster icon indicating copy to clipboard operation
ModbusMaster copied to clipboard

Share code example read/write multi slave ?

Open haidvams opened this issue 3 years ago • 3 comments

can someone help me?

haidvams avatar Jun 13 '21 16:06 haidvams

Dear all, I am also interested in using two (slave) RS485 sensors with a ESP32. Thanks a lot in advance !

besbar avatar Apr 06 '22 07:04 besbar

Hi, this is how I do it:

void testRead(uint8_t addr) { node.setSlaveID(addr); if (node.readHoldingRegisters(17, 35) == node.ku8MBSuccess) { for (uint8_t j = 0; j < 35; j++) { data[j] = node.getResponseBuffer(j); Serial.print(j); Serial.print(": "); Serial.println(data[j]); } } }

setSlaveID is a function I added from https://github.com/4-20ma/ModbusMaster/pull/111.

JoeEarlam avatar Jul 18 '22 09:07 JoeEarlam

Hello friend this is single master and slave We have the log for two device inverter is slave and display is master. Have read payload but this Comunication Gtil2 inverter not Hare modbus? A this link i have shared log https://github.com/cent0/Extend-wired-system-serial-uart-to-wifi/issues/1 Any help for decode this?

https://youtu.be/46qE9sLV13M

cent0 avatar Oct 28 '22 22:10 cent0