ArduinoModbus icon indicating copy to clipboard operation
ArduinoModbus copied to clipboard

Modbus TCP server polling a client with fixed slave ID?

Open jairuz opened this issue 4 years ago • 1 comments

I have a PLC with fixed ID that my Modbus TCP server using MKR1010 is trying to poll. How will I assign the slave ID into the server for communication?

jairuz avatar Apr 13 '21 15:04 jairuz

Did you check id param of begin function ?

int ModbusTCPServer::begin(int id)
{
  modbus_t* mb = modbus_new_tcp(NULL, IPAddress(0, 0, 0, 0), 0);

  if (!ModbusServer::begin(mb, id)) {
    return 0;
  }

pykoon avatar Apr 13 '21 15:04 pykoon