emelianov / modbus-esp8266

Most complete Modbus library for Arduino. A library that allows your Arduino board to communicate via Modbus protocol, acting as a master, slave or both. Supports network transport (Modbus TCP) and Serial line/RS-485 (Modbus RTU). Supports Modbus TCP Security for ESP8266/ESP32.
Other
534 stars 190 forks source link

how to read modbusTCP slave device with modbusTCP Master On ESP8266 #291

Closed aandrie77 closed 1 year ago

aandrie77 commented 1 year ago

Hi, may i ask to this? how to read slave ModbusTCP device with Library ModbusTCP Master on ESP8266 ? Read value Slave ModbusTCP Device? and can used specif for ID Device Slave like this attachment image

modbusTCP multiID

emelianov commented 1 year ago

In terms of ModbusTCP slave_id is unit_id (last argument):

uint16_t readCoil(IPAddress ip, uint16_t offset, bool* value, uint16_t numregs = 1, cbTransaction cb = nullptr, uint8_t uint = MODBUSIP_UNIT);