I am trying to control a chiller through RS232 with python. I am stuck at generating a checksum as required by the following method.
"The checksum is two ASCII hexadecimal bytes representing the least significant 8 bits of the sum of all preceding bytes of the command starting with the sor."
The "sor" in this case in bytes is "2E".
-Example
For example, the PC requires the chiller mode be set to Stand By. It will transmit the following sequence of bytes.
2E 47 30 4135 0D
Note that 2Eh is the start of header (“.”), 47h is the command (“G”), 30h is the qualifier to set the mode to Stand by. 41h and 35h are checksum bytes representing the ASCII hex for “A5” which is the least significant byte of the sum of 2Eh + 47h + 30h and 0Dh is carriage return.
Does anyone know how to generate the checksum bytes 4135?
Thankyou!!