Checksum (Check Character) - Honeywell CM4 Technical Handbook

Four-point continuous monitor
Hide thumbs Also See for CM4:
Table of Contents

Advertisement

CM4 Four-Point Continuous Monitor
The collection of the three bytes in our message (0x42, 0x41, 0x44)
may be referred to as a packet, since these bytes are always associated
with each other.
Just as all words are not the same length (number of letters), packets
may also vary in length. One way to denote the size of the word is
to put the number of letters you have in the word as the first number
in your packet. Your data packet containing the word (or command)
"BAD" will then become 0x03, 0x42, 0x41, 0x44.

Checksum (Check Character)

During transmission of the packet, an error could change the value of
the data. Suppose in our example, for instance, the packet 0x03, 0x42,
0x41, 0x44 is actually 0x03, 0x42, 0x30, 0x44. How can you determine
that the numbers you get are the same as the numbers sent? Using
a check-character is a method of assigning a value to the packet to
check if any bytes have been modified.
If all the data bytes are added together and this sum made into a
byte, that byte could be called a check character, or more commonly
referred to as a checksum. For the CM4 instrument, the checksum
is the negated sum of all the bytes in the packet. In our example,
the packet is 0x03, 0x42, 0x41, 0x44, 0x36. For this packet, the sum
modulo 0x100 of all the bytes added to the checksum must equal zero
(0). Any other result indicates there is an error with the data.
The slave's data contained within the packet is interpreted in a
somewhat different manner than our example. The data is composed of
two sections, a command and one or more parameters. The command
indicates what type of information is being transmitted in the packet.
The parameters contain specific arguments or data values to be
interpreted. Parameters for most CM4 instrument's packet require
at least four bytes for the Date and Time stamps. This information is
important to provide a date and time reference for each communication
CM4 Technical Manual
from the instrument. You should ensure that the date and time have
been set accurately in each CM4 monitor.
Every packet sent by the CM4 instrument also contains an address, a
length, a command and its associated parameters, and a checksum.
The CM4 instrument assumes that the master's address is 0 (zero).
You assign a unique address to each slave which communicates with
the master.
ACK/NAK Handshake
Each slave (CM4) uses a handshake scheme between itself and the
master. The simplest response back from the instrument is called an
ACK (an abbreviation for ACKnowledge). When the slave receives
a command packet from the equipment, it will send back an ACK
response if the command is received, but no additional data has been
requested in the command.
If however, the checksum does not match, the slave will send a NAK
(an abbreviation for Negative AcKnowledge). A NAK indicates that a
data packet has been received, but the checksum did not match with
the packet data. The master may send the request again. An example
of an ACK packet is 0x40, 0x00, 0x05, 0x20, 0x9B (40 + 0 + 5 + 20
+ 9B = 0x100).
E-4

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents