Astraada DRV-24 frequency inverters Communication protocol
96
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^=*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 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.2.3 ASCII mode
Name
Definition
Coding
system
Communication protocol belongs to hexadecimal system. The meaning of
message character in ASCII: “0”…“9”, “A”…”F”, each hex is represented by the
ASCII message corresponds to the character.
Character
‘0’
‘1’
‘2’
‘3’
‘4’
‘5’
‘6’
‘7’
ASCII CODE
0x30 0x31 0x32 0x33 0x34 0x35 0x36 0x37
Character
‘8’
‘9’
‘A’
‘B’
‘C’
‘D’
‘E’
‘F’
ASCII CODE
0x38 0x39 0x41 0x42 0x43 0x44 0x45 0x46
Data
format
Starting bit, 7/8 data bit, check bit and stop bit. The data formats are listed as
below:
11-bit character frame:
Starting
bit
BIT1 BIT2 BIT3 BIT4 BIT5 BIT6 BIT7 BIT8
Check
bit
Stop
bit
10-bit character frame:
Startin
g bit
BIT1 BIT2 BIT3 BIT4 BIT5 BIT6 BIT7
Check
bit
Stop
bit
In ASCII mode, the frame header is “:” (“0*3A”), frame end is “CRLF” (“0*0D” “0*0A”) by default. In
ASCII mode, all the data bytes, except for the frame header and frame end, are transmitted in ASCII
code mode, in which four high bit groups will be sent out first and then, four low bit groups will be
sent out. In ASCII mode, the data length is 8 bit. As for ‘A’~‘F’, its capital letters is adopted for ASCII
code. The data now adopts LRC checkout which covers slave address to data information. The
checksum equals to the complement of the character sum of all the participated checkout data.
Summary of Contents for AS24DRV4075
Page 1: ...Operation Manual Astraada DRV 24 Frequency inverters ...
Page 2: ......