EMS COBALT C0405 Series Operator's Manual page 57

Table of Contents

Advertisement

Ch ec ksu m
ABx Fast Command Protocol supports the inclusion of an additional checksum byte
that is used to verify the integrity of data being transmitted between host and
controller.
The checksum is calculated by adding together (summing) the byte values in the
command packet (less the header, checksum and terminator), and then subtracting
the total byte sum from 0xFF. Therefore, when the byte values of each packet
element (from command size to checksum) are added together, the byte value sum
will equal 0xFF.
C
H E C K S U M
The following example depicts Command 0x05 (Read Data) using a checksum.
Checksum =
[0xFF – (sum
of these
fields)]
Add the byte values from the command size, command ID, start address, read length
and timeout value parameters together and subtract from 0xFF. Resulting value will
be the checksum.
[ 0 x 0 7 + 0 x 0 5 + 0 x 0 1 + 0 x 0 4 + 0 x 0 7 + 0 x D 0 ] = 0 x E 8
C 0 4 0 5 - X X X - 0 1 O P E R A T O R ' S M A N U A L – R E V . 0 3
E
X A M P L E
C O M M A N D
C O N T E N T S
E L E M E N T
Command Header
0x02, 0x02
0x0007
Command Size
0x05
Command ID
0x0001
Start Address
0x0004
Read Length
0x07D0
Timeout Value
Checksum
0x17
Command Terminator
0x03
The checksum equation is: [0xFF – 0xE8] =
C H A P T E R 6 : C O M M A N D P R O T O C O L S
U S E D I N C H E C K S U M
n/a
0x00, 0x07
0x05
0x00, 0x01
0x00, 0x04
0x07, 0xD0
n/a
n/a
0 x 1 7
P A G E 5 7 O F 7 5

Advertisement

Table of Contents
loading

This manual is also suitable for:

C0405-232-01C0405-485-01C0405-usb-01

Table of Contents