Checksum calculation, Emo-500 – AW Gear Meters EMO-500 User Manual

Page 34

Advertising
background image

EMO-500

Operation and Programming Manual

33


>01J03340F3587XXcr

^.....................start of string must use the > sign

^^..................unit number

^..................write command J (use K to read)

^^^^...........address to write into

^^...........byte written to 0334

^^.........byte written to 0335

^^.......byte written to 0336

^^.....checksum

.....carriage return

If the operation was successful, the EMO-500 answers with: Acr.

The following error messages have been implemented in the EMO-500 protocol:

NO1cr - Undefined command (something other than K/J)

NO2cr - Checksum error

NO3cr - Non printable ASCII character

OPTO 22 has published a booklet on the protocol format.

Checksum Calculation

The calculation for the string variables in the read command would be as follows:

>01K0F3404XXcr

^^^^^^^^^.......these characters are used in the calculation.

Add the values for the ASCII Decimal variables.

HEX 0 + 1 + K + 0 + F + 3 + 4 + 0 + 4

ASCII 48 + 49 + 75 + 48 + 70 + 51 + 52 + 48 + 52 = 493

To calculate the final checksum, convert the decimal number 493 into HEX (493=1EDh) and take the last
two characters (ED) for the checksum. The final string would look like this:

>01K0F3404Edcr

Advertising