Error while reading holding registers using Modbus protocol.

Hello Everyone,
Library used: ModbusMaster
I am using Arduino Mega as a Master to connect to a display(slave).When i try to read the value of my holding register using Modbus rs485 protocol i am getting a error(“ku8MBInvalidCRC block”).
The hardware connections are perfectly working and i checked them using RealTerm.
Hardware connection(Atmega2560(Master)->max485->display(slave))

In the display(slave) manual it is specified as “The error checking fiels contains a 16-bit value implemented as two 8-bit bytes”

Below i am attatching my code along with CRC computation prebuilt inside modbus library.

Hope anyone can help me,
Thanks in advance.

CRC.txt (653 Bytes)

Below i am attatching my code along with CRC computation prebuilt inside modbus library.

Believe me, the ModbusMaster library implements the CRC correctly. So my guess is that the hardware is wrong or you did something wrong in your sketch. As you failed to provde a wiring diagram of your setup as well as to post your code we cannot check that.

The hardware connections are perfectly working and i checked them using RealTerm.

I doubt that you can check a Modbus connection by RealTerm. If you see human readable values there your device (for which you also failed to post a link to yet) probably doesn't use Modbus RTU but any other protocol.

I would not say that the hardware is wrong but it may be using a different formula to calculate the CRC.

Can you confirm that it responds to commands? That would check that the formula in your outgoing CRC is correct.