Closed cturqueti closed 11 months ago
No, I am not going to add this to the library.
The public functions of this library are, for the most part, intended to accurately reflect the supported functions in the Modbus protocol. There is no readSingleInputRegister
function in the Modbus protocol.
However, a single input register can be read using the existing functions:
uint16_t inputValue;
modbus.readInputRegisters(deviceId, inputRegisterAddress, &inputValue, 1);
This is demonstrated in ModbusRTUMasterProbe example program.
I made a small modification to the library so I can read a single input Register, maybe it will be useful for someone else: