Rtu Command Code And Communication Data Illustration - Salicru CV10-002-S2 User Manual

Controlvit cv10 series
Table of Contents

Advertisement

The calculation of CRC applies the international standard CRC checkout principles. When the user is editing CRC
calculation, he can refer to the relative standard CRC calculation to write the required CRC calculation program.
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^=*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);
}
In ladder logic, CKSM calculated the CRC value according to the frame with the table inquiry. The method is
advanced with easy program and quick calculation speed. But the ROM space the program occupied is huge.
So use it with caution according to the program required space.

7.3 RTU command code and communication data illustration

7.3.1 Command code: 03H
03H (correspond to binary 0000 0011, read N words(Word)(the Max. continuous reading is 16 words)
Command code 03H means that if the master read data form the inverter, 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 hex) and one hex occupies one byte.
The command code is used to read the working stage of the inverter.
For example, read continuous 2 data content from 0004H from the inverter with the address of 01H (read the
content of data address of 0004H and 0005H), the frame structure is as below:
RTU master command message (from the master to the inverter)
START
ADDR
CMD
High bit of the start bit
Low bit of the start bit
High bit of data number
Low bit of data number
CRC low bit
CRC high bit
END
78 - 104
}
T1-T2-T3-T4 (transmission time of 3.5 bytes)
01H
03H
00H
04H
00H
02H
85H
CAH
T1-T2-T3-T4 (transmission time of 3.5 bytes)
Communication protocol

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cv10-004-s2Cv10-008-s2Cv10-015-s2Cv10-022-s2

Table of Contents