Download Print this page

Mitsubishi Electric MELSEC iQ-F FX5 Programming Manual page 685

Instructions, standard functions/function blocks
Hide thumbs Also See for MELSEC iQ-F FX5:

Advertisement

Device storing data
(s)
for which the CRC
value is generated
(s)+1
(s)+2
(s)+(n)/2-1
Device storing the
(d)
generated CRC value
• 8-bit conversion mode (while SM8161 is ON)
In this mode, the operation is executed only for low-order 8 bits (low-order 1 byte) of a device specified by (s). With regard to the operation result, low-
order 8 bits (1 byte) are stored to a device specified by (d), and high-order 8 bits (1 byte) are stored to a device specified by (d)+1.
In the following program, conversion is executed as follows:
SM400
Command
input
CRC
(s)
Device storing data for
(s)
which the CRC value
(s)+1
is generated
(s)+2
(s)+3
(s)+4
(s)+5
(s)+(n)-1
Device storing the
(d)
generated CRC value
(d)+1
Precautions
16
• In these instructions, "X
+X
other standard polynomials for generating the CRC value. Note that the CRC value completely differs if an adopted
polynomial is different. Major polynomials for generating the CRC value are shown below.
Name
CRC-12
CRC-16
CRC-32
CRC-CCITT
Operation error
There is no operation error.
Low-order byte
High-order byte
Low-order byte
High-order byte
Low-order byte
High-order byte
Low-order byte
High-order byte
Low-order byte
High-order byte
8-bit conversion mode
SM8161
(d)
(n)
Low-order byte
Low-order byte
Low-order byte
Low-order byte
Low-order byte
Low-order byte
Low-order byte
Low-order byte
High-order byte
15
2
+X
+1" is used in a polynomial for generating the CRC value (CRC-16). There are many
Polynomial
12
11
3
2
X
+ X
+ X
+ X
+ X + 1
16
15
2
X
+ X
+ X
+ 1
32
26
23
22
16
X
+ X
+ X
+ X
+ X
+ X
16
12
5
X
+ X
+ X
+ 1
Example) (s) = D100, (d) = D0, (n) = 6
Device
Contents of target data
8 bits
Low-order bits of D100
01H
High-order bits of D100
03H
Low-order bits of D101
03H
High-order bits of D101
02H
Low-order bits of D102
00H
High-order bits of D102
14H
Low-order bits of D0
E4H
High-order bits of D0
41H
Example) (s) = D100, (d) = D0, (n) = 6
Device
Low-order bits of D100
Low-order bits of D101
Low-order bits of D102
Low-order bits of D103
Low-order bits of D104
Low-order bits of D105
Low-order bits of D0
High-order bits of D0
12
11
10
8
7
5
4
+ X
+ X
+ X
+ X
+ X
+ X
+ X
16 bits
0301H
0203H
1400H
41E4H
Contents of target data
01H
03H
03H
02H
00H
14H
E4H
41H
2
+ X + 1
8 APPLICATION INSTRUCTION
8.22 Data Operation Instruction
8
683

Hide quick links:

Advertisement

loading