I downloaded and started using your Modbusino code for a project and I believe there is a couple of easily fixable bugs that you should be aware of.
i in reply() should be 16 bit not 8, when it is 8 bit the program will lock up if you try and read a register above 255.
nb_reg should also be 16 bit not 8, it is in a number of locations, comes into play when reading registers above 255.
if (address + nb > nb_reg) {
rsp_length = response_exception(
slave, function,
MODBUS_EXCEPTION_ILLEGAL_DATA_ADDRESS, rsp);
}
in reply() should be followed with an else that is closed before send_msg(rsp, rsp_length);
As if it is not there the program will still form a reply and you can read memory beyond your register table, this is not desirable.
Checking for Arduino environment 1 is required as WProgram.h has been replaced with Arduino.h
I downloaded and started using your Modbusino code for a project and I believe there is a couple of easily fixable bugs that you should be aware of.