ArduinoModbus
ArduinoModbus copied to clipboard
Modbus TCP server polling a client with fixed slave ID?
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?
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;
}