I am struggling with modbus rtu protocol as well.
read wikipedia, Nicks' tutorial, everything whats written in arduino website.
But can not understand how are the registers send.
For example, from http://arduino.cc/playground/Code/ModbusMaster
what does these do in the loop function? :
static uint32_t i;
uint8_t j, result;
then we have the line :
// slave 1: write TX to (2) 16-bit registers starting at register 0
result = node.WriteMultipleRegisters(0, 2);
I understand that the protocol should send two 16 bit info, but what does it send? any random bits? Because there is no info, saying what exactly it is beeing sent, and where is that info taken from.
Any help is much appreciated.