Goodrive10 Series Mini VFD
Communication protocol
-90-
the each 8-bit character and the content in the register. The result is placed in the bits from the
low-order bit to the high-order bit, and 0 is placed in the high-order bit. Then, the low-order bit
is detected. If the low-order bit is 1, the XOR operation is performed on the current value in the
register and the preset value. If low-order bit is 0, no operation is performed. This process is
repeated 8 times. After the last bit (8th bit) is detected and processed, the XOR operation is
performed on the next 8-bit byte and the current content in the register. The final values in the
register are the CRC values obtained after operations are performed on all the bytes in the
frame.
The calculation adopts the international standard CRC check rule. You can refer to the related
standard CRC algorithm to compile the CRC calculation program as required.
Here provided a simple function of CRC calculation for the reference (programmed with C
language):
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^=*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);
}
In the ladder logic, CKSM uses the table look-up method to calculate the CRC value
according to the content in the frame. The program of this method is simple, and the
calculation is fast, but the ROM space occupied is large. Use this program with caution in
scenarios where there are space occupation requirements on programs.
7.3 RTU command code and communication data description
7.3.1 Command code: 03H
03H (corresponding to binary 0000 0011), read N words (Word)
(N≤16)
Command code 03H means that if the master read data form the VFD, the reading number
depends on the “data number” in the command code. The Max. Continuous reading number
is 16 and the parameter address should be continuous. The byte length of every data is 2
(one word). The following command format is illustrated by hex (a number with “H” means
Summary of Contents for GD10-0R2G-2-B
Page 1: ......
Page 125: ...66001 00099...