7. Interfaces and Communication
- 220 -
7
Ƶ
CRC Check
,Q0RGEXV578PRGHDPHVVDJHLQFOXGHVD&5&EDVHGHUURUFKHFN¿HOG7KH&5&¿HOG
FKHFNVFRQWHQWRIHQWLUHPHVVDJH7KH&5&¿HOGLVWZRE\WHVFRQWDLQLQJDELWELQDU\
YDOXH7KH&5&¿HOGLVFDOFXODWHGE\WUDQVPLWWLQJGHYLFHDQGWKHQDGGHGWRPHVVDJH
The receiving device recalculates a CRC value after receiving message, and compares
WKHFDOFXODWHGYDOXHZLWKWKH&5&YDOXHLQWKHUHFHLYHG&5&¿HOG
7KH&5&LV¿UVWVWRUHGWR[))))7KHQDSURFHGXUHLVLQYRNHGWRSURFHVVWKHVXFFHVVLYH
8-bit byte in the message and the value in the register. Only the eight bits in each
character are used for the CRC. The start bit, stop bit and the parity bit do not apply to the
CRC.
During generation of the CRC, each eight-bit character is in exclusive-OR (XOR) with the
FRQWHQWLQWKHUHJLVWHU7KHQWKHUHVXOWLVVKLIWHGLQWKHGLUHFWLRQRIWKHOHDVWVLJQL¿FDQWELW
/6%ZLWKD]HUR¿OOHGLQWRWKHPRVWVLJQL¿FDQWELW06%SRVLWLRQ7KH/6%LVH[WUDFWHG
and examined. If the LSB was a 1, the register then performs XOR with a preset value.
If the LSB was a 0, no XOR is performed. This process is repeated until eight shifts have
been performed. After the last (eighth) shift, the next eight-bit byte is in XOR with the
register's current value, and the process repeats for eight more shifts as described above.
7KH¿QDOYDOXHRIWKHUHJLVWHUDIWHUDOOWKHE\WHVRIWKHPHVVDJHKDYHEHHQDSSOLHGLVWKH
CRC value.
The CRC is added to the message from the low-order byte followed by the high-order
byte. The CRC simple function is as follows:
unsigned int crc_chk_value
(
unsigned char *data_value,unsigned char length
)
{
unsigned int crc_value=0xFFFF;
int
i;
while
(
length--
)
..
{
crc_value^=*dat+;
IRU L LL
{
..
LI FUFBYDOXH [
{
..
FUFBYDOXH FUFBYDOXH!! A[D
..
}
..
else
{
..
crc_value=crc_value>>1;
}
. }
}
UHWXUQ FUFBYDOXH
}
Summary of Contents for MD290 Series
Page 1: ......
Page 79: ...3 Electrical Installation 78 3 ...
Page 80: ...4 Operating Panel Keypad Display 4 1 Introduction 80 4 2 Inbuilt LED Operating Panel 80 ...
Page 92: ...5 Quick Setup 5 1 Get Familiar With Operating Panel 92 5 2 Setup Flowchart 93 ...
Page 227: ...7 Interfaces and Communication 226 7 ...
Page 285: ...10 Troubleshooting 284 11 ...
Page 349: ......
Page 350: ......