AC90 TENSION CONTROL FREQUENCY INVERTER MANUAL BASIC OPERATION AND TRIAL RUN
183
If odd/even checking has not been allocated, there will be no checking bit during the transmission, and no checking
detection. One additional stop bit will be filled into the character frame in transmission.
2.
CRC-16
(
cycle redundant check
)
While the RTU frame form in use; the frame has included the frame error detecting domain which calculates base on
the CRC method. The CRC domain checks the content of the entire frame. The CRC domain is two bytes, containing
binary 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
lowest effective bit, and then the highest effective bit is filled with “1”. LSB is extracted to be detected. If LSB is 1, he
register independently XOR with the preset value. If LSB is 0, don’t need 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 CRC calculation program which is really
meet the requirements.
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^=*dat+;
for(i=0;i<8;i++)
{
if(crc_value&0x0001)
{
crc_value=(crc_value>>1)^0xa001;
}
else
{
crc_value=crc_value>>1;
}
}
}
return(crc_value);
}