Replay User Manual v.
1.2
Page 37
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.
O
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’
).
O
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.
0 1
5 0
0 1 3 2
E
N
Q
05H
35H
30H
30H
31H
30H 31H 33H 32H 38H
ADD
43H
CMD
DATA
CHK
8 C
30H + 31H + 35H + 30H + 30H + 31H + 33H + 32H =
18C
H
Содержание RePlay 01
Страница 1: ...USER MANUAL Replay Version 1 2...
Страница 14: ...Replay User Manual v 1 2 Page 13...