621
FX
3G
/FX
3U
/FX
3UC
Series Programmable Controllers
Programming Manual - Basic & Applied Instruction Edition
24 Others – FNC181 to FNC189
24.4 FNC188 – CRC / Cyclic Redundancy Check
21
FN
C
160-
FN
C
169
R
eal T
im
e C
lo
ck
C
ont
ro
l
22
FN
C
170-
FN
C
179
Exter
nal D
ev
ice
23
FN
C
180
Al
ter
nate
In
str
uc
tions
24
FN
C
181-
FN
C
189
O
ther
s
25
FN
C
190-
FN
C
199
B
lock D
ata
O
per
at
ion
26
FN
C
200
-F
N
C
20
9
C
har
acter
S
tring
C
ont
ro
l
27
FN
C
210-
FN
C
219
Da
ta
O
per
ation 3
28
FN
C
220-
FN
C
249
Da
ta
C
om
par
ison
29
FN
C
250
-F
N
C
26
9
D
ata T
abl
e
O
per
ati
on
30
FN
C
270-
FN
C
274
Ex
-D
ev
ice
Inv
ert
er
Com
m
s
24.4
FNC188 – CRC / Cyclic Redundancy Check
Outline
This CRC instruction calculates the CRC (cyclic redundancy check) value which is an error check method
used in communication.
In addition to CRC value, there are other error check methods such as parity check and sum check. For
obtaining the horizontal parity value and sum check value, CCD (FNC 84) instruction is available.
CRC instruction uses “X
16
+ X
15
+ X
2
+ 1” as a polynomial for generating the CRC value (CRC-16).
→
For CCD instruction (check code), refer to Section 16.5.
1. Instruction format
2. Set data
3. Applicable devices
S
: Make sure to specify four digits (K4
{{{
) when specifying the digits of a bit device.
Explanation of function and operation
1. 16-bit operation
CRC value is generated for “n” 8-bit data (unit: byte) starting from a device specified in
, and stored to
.
The 8-bit conversion mode and 16-bit conversion mode are available in this instruction, and the mode can be
switched by turning ON or OFF M8161. For the operation in each mode, refer to the following pages.
“X
16
+ X
15
+ X
2
+ 1” is used as a polynomial for generating the CRC value (CRC-16).
Operand Type
Description
Data Type
Head device number storing data for which the CRC value is generated
16-bit binary
Device number storing the generated CRC value
n
Number of 8-bit (1-byte) data for which the CRC value is generated or the device
number storing the number of data
Oper-
and
Type
Bit Devices
Word Devices
Others
System User
Digit Specification
System User
Special
Unit
Index
Con-
stant
Real
Number
Charac-
ter String
Pointer
X Y M T C S D
.b KnX KnY KnM KnS T C D R U
\G
V Z Modify K H
E
"
"
P
S
S
S
S
3 3 3 3
3
3
S
S
S
3 3 3 3
3
3
n
3 3
3 3
P
FNC 188
CRC
Mnemonic
Operation Condition
16-bit Instruction
7 steps
CRC
CRCP
Mnemonic
Operation Condition
Continuous
Operation
Pulse (Single)
Operation
32-bit Instruction
⎯
⎯
S
D
S
D
S
D
FNC188
CRC
n
Command
input
D
S