Checksum (Chk) - inout Dinplayer D01-MKII User Manual

Table of Contents

Advertisement

8.13 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 the 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, DINplayer calculates the new CheckSum and compares it with the one
contained in the pack itself; if it agrees, DINplayer 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.
DINplayer User Manual v.2.3
ADD
CMD
E
0 1 5 0 0 1 3 2
N
Q
05H
30H
31H
35H
30H + 31H + 35H + 30H + 30H + 31H + 33H + 32H = 18CH
DATA
8 C
30H
30H 31H 33H 32H 38H
Page 35
CHK
43H

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents