Introduction
When you communicate with hardware through your system, you usually use the RS232 port to communicate. CRC is used for error checking while sending commands to the hardware.
The CRC calculation is done using some algorithm that we will discuss. Before that, here I am going to discuss CRC calculation for the Modbus protocol. A two 8-bit byte CRC code must be generated and sent along with other bytes of data which you are going to send through the COM port.
Here I am going to explain how CRC calculation is done in RTU mode for reading the holding register values.