Australian Monitor DMA1 User Manual
Page 33
S E R I A L R S 4 8 5 C O M U N I C AT I O N
PA G E 3 3
A M I S - D M A 1 I N S TA L L AT I O N & O P E R AT I O N M A N U A L
9.11 CheckSum (CHK)
CheckSum ensures that packets are complete and not corrupted during
transmission by any noise or interference induced on the RS485 bus.
The CheckSum is calculated summing the hexadecimal values of the ASCII
characters contained in the data packet (excluding the control code). The
two least signifi cant characters (in hexadecimal) of the result represent the
CheckSum value, and are added to the end of the packet (before any CR and
LF characters).
NOTE: CheckSum is enabled by the CMCK parameter of the
confi guration fi le confi g.txt.
• If CMCK=1, CheckSum will be calculated automatically and added to
the reply packet (any packet beginning ’STX’). When a packet is received,
the DMA1 calculates the CheckSum of the received packet locally and
compares it with the one contained in the packet itself. If the calculated
CheckSum is identical to the received CheckSum the DMA1 perform the
command, otherwise an error packet is transmitted (packet beginning
with ‘NAK’).
• If CMCK=0, CheckSum will not be appended to transmitted packets and
will not be compared (also because it is missing in the data) in the
received packets.
The following fi gure shows an example of the calculation of a CheckSum in a command packet delivered by the control system
ADD CMD
DATA
CHK
05H 30H 31H 35H 30H 30H 31H 33H 32H 38H 43H
E
N
Q
0 1
5 0
0 1 3 2
8 C
30H + 31H + 35H + 30H + 30H + 31H + 33H + 32H = 18CH