Closed Mahalakshmi1298 closed 1 year ago
I'm assuming this is about modbus rtu. The modbus message is limited to 256 bytes. It would not be possible to read 414 registers. You can still make some tweaks in the code and be able to read 414 registers provided you are in control of both master and slave devices.
Thank you @Ashwin-GB for your answer.
We were using libmodbus library and trying to read the bunch of register address from 40101 to 40513. ( data length = 414) since functional code was 40 (read holding register) we were using this below API to read data. int modbus_read_registers(modbus_t ctx, int addr, int nb, uint16_t dest);
case 1: Issue Case
eg: modbus_read_registers(ctx, 100, 414, buff ); // regAdd : [ 101 - 1 ] LengthOfData to Read : [ ( 513 - 101 ) + 2 ]
case 2: Alternate Case
eg: modbus_read_registers(ctx, 100, 50, buff ); sleep(1); modbus_read_registers(ctx, 150, 50, buff ); sleep(1);