I´m a little bit lost at the moment..
Can you explain me what this means:
modbusWriteSingle(client, 40303 + 12, 50 * 100);
modbusWriteSingle is the function. What does this "client" mean in this case?
int modbusRequest(Client& client, byte uid, unsigned int addr, byte len, short *regs)
const byte CODE_IX = 7;
const byte ERR_CODE_IX = 8;
const byte LENGTH_IX = 8;
const byte DATA_IX = 9;
byte request[] = {0, 1, 0, 0, 0, 6, uid, FNC_READ_REGS, (byte) (addr / 256), (byte) (addr % 256), 0, len};
Here you create a modbus Request. What does this "Client&client" mean.
int res = modbusRequest(client, 240, 41002, 16, regs);
What does dies 240 mean? This is the uid byte i think. But why 240, or for what i will need this one?