EasyManua.ls Logo

INVT CHV160A Series - CRC Check; Example

INVT CHV160A Series
321 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
Loading...
C.TY TNHH TỰ ĐỘNG HÓA VIỆT TRUNG 02413.281.181-
0989.984.666
Website:www.viet-trung.com.vn Đ/c:194-Nguyễn Trãi-Võ Cường-
TP.Bắc Ninh
In
the
same
frame,
if
the
span
between
two
.near
bytes
more
than
1.5
bytes
interval,
the
behind
bytes
will
be
assumed
as
the
start
of
next
message
so
that
communication
will
failure.
9
.
6
CRC
Check
For
higher
speed,
CRC-16
uses
tables.
The
following
are
C
language
source
code
for
CRC-16.
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);
}
9
.
7
Exam
pl
e
9.7.1
RTU
mode,
read
2
data
from
0004H
The
request
command
is:

Table of Contents

Related product manuals