Algorithm - Veesta World V-PM2000 Series User Manual

Enhanced ied, power measurement, power quality and monitoring device
Table of Contents

Advertisement

VP-2040 Enhanced IED
V-PM2000 Series, Veesta Power Measurement
Instructions & User's Manual
8.4.6
CRC-16 Algorithm
All rights reserved. Passing on and copying of this document, use and communication of its contents not permitted without written authorization.
Once the following algorithm is complete, the working register "A" will
contain the CRC value to be transmitted.
Note that this algorithm requires the characteristic polynomial to be
reverse bit ordered. The MSbit of the characteristic polynomial is
dropped since it does not affect the value of the remainder. The
following symbols are used in the algorithm:
Data transfer
A
16 bit working register
AL
Low order byte of A
AH
High order byte of A
CRC
16 bit CRC-16 value
i, j
Loop counters
(+)
Logical exclusive or operator
Di
i-th data byte (i = 0 to N - 1)
G
16 bit characteristic polynomial equal
1010000000000001 with MSbit dropped and bit order
reversed
shr(X)
Shift right (the LSbit of the low order byte of x shifts
into a carry flag, a "0" is shifted into the MSbit of the
high order byte of x, all other bits shift right one
location.)

Algorithm:

FFFF hex  A
1.
0  i
2.
0  j
3.
Di (+) AL  AL
4.
j + 1  j
5.
6.
shr (A)
7.
is there a carry ?
8.
is j = 8 ?
i + 1  i
9.
10.
is i = N ?
11.
A  CRC
Chapter 8 - Protocol and Communication
No : go to 8.
Yes : G (+) A  A
No : go to 5.
Yes : go to 9.
No : go to 3.
Yes : go to 11.
Page 62 of 100

Advertisement

Table of Contents
loading

This manual is also suitable for:

Vp-2040

Table of Contents