EasyManuals Logo

DEMA D6B Series User Manual

DEMA D6B Series
99 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #73 background imageLoading...
Page #73 background image
NO.6 Detailed Function Description
69
CRC: Error detection value
RTU mode, adopting CRC (cyclical Redundancy Check) error detection value; CRC
value is obtained via C language below, and thus function requires two parameters:
unsigned char data index of message buffer
unsigned char length number of bytes in message buffer
This function shall send back CRC value in the form of unsigned integer.
unsigned int crc_chk (unsigned char data, unsigned char length)
{ int j;
unsigned int reg_crc=0xffff;
while (length )
{ reg_crc ^ =*data++;
for (j=0;j<8;j++)
{ if (reg_crc&0x01)
reg_crc=(reg_crc>>1) ^0xa001;
else
reg_crc=reg_crc>>1;
}
}
return reg_crc; }
LRC: Error detection value
ASCII mode,Adopt LRC (Longitudinal Redundancy Check) error detection value. LRC
error detection value refers to totaling from ADDR to the last data content. The result
obtained takes 256 as unit, excess part shall be removed, then secondary reverse
compensation be calculated, the result got is LRC error detection value, for example:
change function code P003 into 30.00Hz.
STX
ADDR
CMD
LEN
DATA
LRC
END
:
01
02
03
03 0B B8
34
CR LF
3AH
30H
31H
30H
32H
30H
33H
30H 33H 30H 42H 42H 38H
33H
34H
0DH 0AH
DATA data specification:
"03" is function parameter P003, main frequency, setting range 0.00-400.00Hz;
"0B B8" is hexadecimal value of set parameter value 3000 (i.e. 30.00Hz).
Calculation of LRC value: 01H+02H+03H+03H+0BH+B8H=CCH

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the DEMA D6B Series and is the answer not in the manual?

DEMA D6B Series Specifications

General IconGeneral
BrandDEMA
ModelD6B Series
CategoryInverter
LanguageEnglish

Related product manuals