![Savch S2800 Series User Manual Download Page 94](http://html.mh-extra.com/html/savch/s2800-series/s2800-series_user-manual_1203757094.webp)
91
J. CRC Checking-CRC(cyclical Redundancy Check)
In RTU frame format, the frame includes frame incorrect test field based on CRC
computing. The CRC field detects the content of whole frames. The CRC field is 2
bytes and includes 16-binary. It is added to frame after being computed by
transmission equipment. The receiving equipment recalculates the CRC which has
received frames and compare it with values in the received CRC field. If the two CRC
values are different, it indicates that there is transmission error received.
In CRC checking mode, it saves in 0xFFFF first, then uses a procedure and
processes the continuous 6 more than bytes in frames together with current register.
Only the 8-bit data in every character is available to CRC, the start bit, end bit and
parity checking are all unavailable to it.
In CRC production course, every 8-bit character is different from the register content
separately or(XOR). The result moves to the direction of lowest effective bit. And the
highest bit is filled with 0. LSB is picked up to test. If LSB is 1, the register is different
from the preset value alone. If LSB is 0, no actions. The whole process must be
repeated 8 times. As the last bit (8th bit) is finished, the next 8-bit character is
different from the present value of register again. The final value in register is the
CRC value after all bytes in frame have been executed.
This calculation method of CRC adopts international standard CRC checking rule.
The user can refer to the CRC algorithm of relative standard when edit the CRC
algorithm to edit the real CRC calculation program which complies with the
requirements.
Here is a simple function of CRC algorithm for users' reference (using C language
programming).
Unsigned int crc_ cal_ value(unsigned char *data_ value, unsigned char data_ length)
{
int I;
unsigned int crc_ value=0xffff; while(data_ length--)
{
Crc_ value^=*data_ value++;
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);s
}
In ladder logic, CKSM calculates CRC value according to frame content with table
look-up method. This program is simple and fast calculation, but occupies larger ROM
space. So please use it carefully for occasions with requirement to program space.
Summary of Contents for S2800 Series
Page 1: ......
Page 2: ......
Page 3: ......
Page 4: ......
Page 5: ......
Page 6: ......
Page 7: ......
Page 8: ......
Page 9: ......
Page 10: ......
Page 11: ......
Page 12: ......
Page 13: ......
Page 14: ......
Page 15: ......
Page 16: ......
Page 17: ......
Page 18: ......
Page 19: ......
Page 20: ......
Page 21: ......
Page 22: ......
Page 23: ......
Page 24: ......
Page 25: ......
Page 26: ......
Page 27: ......
Page 28: ......
Page 29: ......
Page 30: ......
Page 31: ......
Page 32: ......
Page 33: ......
Page 34: ......
Page 35: ......
Page 36: ......
Page 37: ......
Page 38: ......
Page 39: ......
Page 40: ......
Page 41: ......
Page 42: ......
Page 43: ......
Page 61: ......
Page 62: ......
Page 63: ......
Page 64: ......
Page 65: ......
Page 66: ......
Page 67: ......
Page 68: ......
Page 69: ......
Page 70: ......
Page 71: ......
Page 72: ......
Page 73: ......
Page 74: ......
Page 75: ......
Page 76: ......
Page 102: ......
Page 103: ......
Page 104: ......
Page 105: ......
Page 106: ......
Page 107: ......
Page 108: ......
Page 109: ......
Page 110: ......
Page 111: ......
Page 112: ......