Checksum (Chk) - inout RePlay 01 User Manual

Table of Contents

Advertisement

10.12 CheckSum (CHK)

The CheckSum makes sure that the packs are complete and not corrupted during their
transmission by any noise induced on the line.
The CheckSum is calculated summing the hexadecimal value of the ASCII characters
contained in the data area defined for the CheckSum. The two least significant characters
(in hexadecimal) of the sum represent the CheckSum which is introduced into the two
dedicated ASCII characters at the end of the pack (before any CR and LF characters).
Note ! The sum of the value in decimal of the ASCII codes, converted into hexadecimal,
must give the same result. Introduction and management of CheckSum is established by
the CMCK parameter of the configuration file.
If CMCK=1 has been set, CheckSum will be calculated automatically and added to the
term of the reply pack (the one beginning 'STX') when this is delivered. When a pack is
received, Replay calculates the new CheckSum and compares it with the one
contained in the pack itself; if it agrees, Replay goes on to perform the command,
otherwise it delivers an error pack (pack beginning with 'NAK').
If CMCK=0 has been set, CheckSum will not be delivered in transmission and will not
be compared (also because it is missing in the data) in the received messages. The
following figure shows an example of calculation of CheckSum in a command pack
delivered by the master.
Replay User Manual v.
ADD
CMD
E
0 1 5 0
N
Q
35H
05H
30H
31H
30H + 31H + 35H + 30H + 30H + 31H + 33H + 32H = 18CH
1.2
DATA
0 1 3 2
30H 31H 33H 32H 38H
30H
Page 37
CHK
8 C
43H

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents