3 . I n s t r u c t i o n S e t
M N 0 5 0 0 3 0 0 3 E F o r m o r e i n f o r m a t i o n v i s i t :
w w w. e a t o n . c o m
3 - 2 9 3
API Mnemonic
Operands
Function
108
CRC P
S, n, D
CRC Generator
Bit Devices
Word devices
Program Steps
Type
OP
X Y M S K H KnX KnY KnM KnS T
C
D
E
F
S
*
n
*
*
*
D
*
CRC, CRCP: 7 steps
ELC ELCB
ELCM
PB PC/PA/PH
PV
PB PH/PA
32
16
P
32
16
P
32
16
P
32 16
P
32
16
P
Operands:
S
: Starting address for the checksum operation (RTU mode)
n
: Number of values to perform the
operation on (
n
=K1~K256)
D
: Destination for storing the operation result
Description:
1. If
n
is out of range, an error will occurred and the instruction will not be executed. If an error
occurs, M1067 and M1068 = ON and error code H’0E1A will be recorded in D1067.
2.
8-bit conversion mode: When M1161 = ON, divide the hexadecimal data that starts with
source
S
into the high byte (invalid data) and low byte and have the CRC operation performed
on
n
values and store the result in the low byte of
D
(upper 8-bit of
D
will be zero)
3.
16-bit conversion mode: W hen M1161 = OFF, divide hexadecimal data that starts with source
S
into the high byte and low byte and have the CRC operation performed on
n
values and
store the result in the low byte and high byte of
D
Program Example:
RTU communication mode: Data stored as following:
Register
Data
Descriptions
D100 low byte
01 H
Address
D101 low byte
06 H
Function
D102 low byte
07 H
D103 low byte
06 H
Data address
D104 low byte
17 H
D105 low byte
70 H
Data content
D106 low byte
66 H
CRC CHK 0
D107 low byte
AB H
CRC CHK 1
The CRC CHK (0,1) above is the error check code and it can be calculated using the CRC
instruction (8-bit Mode, M1161= ON).
M1000
CRC
D100
K6
D106
CRC check: 66 H is stored in the lower 8-bits of D106 and AB H is stored in the lower 8-bits of D107.
Summary of Contents for ELC-PB
Page 1: ......
Page 5: ...For more information visit www eaton com MN05003003E iv...
Page 29: ...ELC Programming Manual For more information visit www eaton com MN05003003E 1 24 MEMO...
Page 502: ...3 Instruction Set MN05003003E For more information visit www eaton com 3 333...
Page 601: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 432...
Page 625: ...ELC Programming Manual For more information visit www eaton com MN05003003E 3 456...