Invalid Check sum In Response

Hi, I implemented a mod bus communication between PIC16F887 as a slave and the com test pro software tool as a master.
While establishing the communication between these i am facing invalid check sum in response error.
Below are the attached files for code and errors what i faced.
 

Attachments

The issue is not (only) an invalid checksum. The response bytes in your images are nonsensical garbage and not even the correct length.

I think you need to take a few steps back and start at the beginning.

How are you connecting your computer to the PIC16F? Are you using RS-485, RS-232, etc.? Are you using a USB adapter on the computer? Do you have a TTL to RS-485 (or RS-232) adapter/module on the PIC16F?

Can you write a simple "Hello World" program on the PIC16F that simply outputs the text "Hello World!" to the UART and see that on your computer using a terminal emulator, such as PuTTY? After that, try writing a simple echo application that echos the text that you type from the terminal emulator. This will confirm that both your receiving and transmitting code are working properly on the PIC16F.

After doing this successfully, then move on to trying to do Modbus communication. But start simple. Start with trying to read only a single register (you can even hard-code the response data in your code).

Additionally, when coding a Modbus slave, it is important to reference the specification, and make sure you are looking at all the correct bytes for each field. The Modbus specifications are available here:
https://modbus.org/specs.php
 
Top