● The block check code (BCC) for the targeted data, which is the number of bytes specified by
[S3] starting from the calculation start position specified by [S2], is calculated with the CRC
calculation method which is specified by [S1].
● The calculation result is stored according to the conversion method specified by [S1], starting
from the storage position specified by [D] and [S1].
■
CRC calculation
● Apply a specified calculation method to every 16 bits as follows.
● The calculation should be carried out using the following generating polynomial. (This is the
same calculation method as MODBUS-RTU.)
%0 → H 2530 → 0010 0101 0011 0000 (a)
1# → H 3123 → 0011 0001 0010 0011 (b)
RC → H 5243 → 0101 0010 0100 0011 (c)
・・・・
(a)
(b)
(c)
・・・・
Specified calculation
[S1]= K0 : CRC-16
[S1]= K1 : CCITT
・Generating polynomial: (CRC-16)
・Generating polynomial: (CRCITT)
X
16
+ X
12
+ X
5
+ 1
■
Specification of control data [S1]
計算方法の指定
計算開始位置
([S2]からのバイト数)
0~F
格納開始位置
([D]からのバイト数)
0~F
0:固定
設定値 CRCタイプ 初期値 送り方法 演算結果のXOR
0 CRC-16
FFFFH
右送り
0000H
1 CCITT
2 CRC-16
0000H
(注)
3 CCITT
(注)
4 CRC-16
FFFFH
左送り
(注)
5 CCITT
(注)
6 CRC-16
0000H
(注)
7 CCITT
(注)
8 CRC-16
FFFFH
右送り
FFFFH
(注)
9 CCITT
(注)
A CRC-16
0000H
(注)
B CCITT
(注)
C CRC-16
FFFFH
左送り
(注)
D CCITT
(注)
E CRC-16
0000H
(注)
F CCITT
(注)
(注):CPUユニットCPS4R*、CPS2R*で使用することができます
■
Conversion example
Calculate the block check code for a message to be sent "%01#RCSX0000", and append the
result to the message.
14.2 CRC (CRC Code Calculation)
WUME-FP7CPUPGR-12 14-7