Veichi Electric AC60 series Manual page 186

Table of Contents

Advertisement

values of 16 bits. It is added to the frame after calculated by the transmission
equipment. The receiving equipment calculates CRC who receives frame again,
and compares it with the value of the receiving CRC domain. If both CRC value
are not equal, it means the transmission has mistake.
CRC is firstly stored in 0xFFFF. Then a program is used to process the
continuous 6 or above bytes in the frame and the value of current registers.
Only 8Bit in every character is valid to CRC. Start bit、stop bit and parity
check bit are invalid.
In the process of CRC coming out, each 8 characters independently XOR
with register content. The result moves to minimum effective digit. LSB is
extracted to be detected. If LSB is 1, the register independently XOR with the
the preset value. If LSB is 0, no XOR. This entire process needs to repeat 8
times. After the last bit (the eighth bit) is accomplished. Next 8 bits byte
will independently XOR with register content. All the final bytes in the frame
are CRC value after processed.
This CRC operation method adopts the international standard CRC checking
rule. Users can consult the relevant standard CRC operation while editing the
CRC algorithm to compile out the real CRC calculation program as required.
Now here provide the user a simple CRC operation function (with C language
programming):
unsigned int crc_chk_value(unsigned char *data_value,unsigned char
length)
{
unsigned int crc_value=0xFFFF;
int i;
while(length--)
{
crc_value^=*data_value++;
for(i=0;i<8;i++)
182

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents