K
Hi
I am working on a modbus slave application. I am using RTU message format. For testing purposes I am using ModScan32 software as my Master.
When the ModScan32 software sends a frame with a valid modbus command (ex: read Holding registers) the slave program is able to receive the modbus message frame. The slave successfuly validates the message frame by calculating the Checksum. To calculate the Checksum, I am using the lookup table and the algorithm given in the "Modbus over serial line specification and implementation guide" downloaded from modbus.org. I am using CRC16() function as I am following RTU message format.
The problem comes when I am trying to send a data frame back to the master side (here to the Modscan32 s/w) The ModScan32 says, "Checksum error in response message". I am using the same algorithm (the one used to calculate the checksum of the message received from the master) to calculate the checksum that I needed to attach with the message frame before sending it to the master (modscan32 s/w). I did check the way I am attaching the checksum to the message frame and it is correct. I am not sure what is going on to get the checksum error message.
If anybody has any idea or suggestion, please let me know. Thanks in advance
Kelly
I am working on a modbus slave application. I am using RTU message format. For testing purposes I am using ModScan32 software as my Master.
When the ModScan32 software sends a frame with a valid modbus command (ex: read Holding registers) the slave program is able to receive the modbus message frame. The slave successfuly validates the message frame by calculating the Checksum. To calculate the Checksum, I am using the lookup table and the algorithm given in the "Modbus over serial line specification and implementation guide" downloaded from modbus.org. I am using CRC16() function as I am following RTU message format.
The problem comes when I am trying to send a data frame back to the master side (here to the Modscan32 s/w) The ModScan32 says, "Checksum error in response message". I am using the same algorithm (the one used to calculate the checksum of the message received from the master) to calculate the checksum that I needed to attach with the message frame before sending it to the master (modscan32 s/w). I did check the way I am attaching the checksum to the message frame and it is correct. I am not sure what is going on to get the checksum error message.
If anybody has any idea or suggestion, please let me know. Thanks in advance
Kelly