In which address - 1004 or 0x1004 ? Do you understand the difference?
Please read something about hexadecimal number format (0xNNN) - without clear understanding it and it difference with decimal numbers you will hardly can use Modbus protocol
reading through the doc's source.. ModbusMaster
you don't have to combine bytes..
getResponseBuffer returns a word not a byte..
if you read 1 register, it's at getResponseBuffer (0), the second at getResponseBuffer (1) and so on..
maybe you need to combine two words into a int32??
int32_t val = (int32_t(bWord) << 16) | int32_t(aWord);
//set word 0 of TX buffer to least-significant word of counter (bists 15.. 0)
Node.setTransmitBuffer(0, lowWord(i));
//set word 0 of TX buffer to least-significant word of counter (bists 31.. 16)
Node.setTransmitBuffer(1, higWord(i));
//slave: write TX buffer to (2) 16-bit regsiters starting at register 0
result = node.writeMultipleRgisters(0,2)
}
i used the code above and managed to write the counter of autonics with arduino