17: U
SER
C
OMMUNICATION
I
NSTRUCTIONS
17-36
« FC4A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
»
New BCC Calculation Examples
The upgraded CPU modules can use three new BCC calculation formulas of ADD-2comp, Modbus ASCII, and Modbus
RTU for transmit instructions TXD1 and TXD2 and receive instructions RXD1 and RXD2. Use
WindLDR
ver. 4.40 or
higher to program the new BCC. These block check characters are calculated as described below.
ADD-2comp
1.
Add the characters in the range from the BCC calculation start position to the byte immediately before the BCC.
2.
Invert the result bit by bit, and add 1 (2’s complement).
3.
Store the result to the BCC position according to the designated conversion type (Binary to ASCII conversion or No
conversion) and the designated quantity of BCC digits.
Example:
Binary to ASCII conversion, 2 BCC digits
When the result of step
2
is 175h, the BCC will consist of 37h, 35h.
Modbus ASCII — Calculating the LRC (longitudinal redundancy check)
1.
Convert the ASCII characters in the range from the BCC calculation start position to the byte immediately before the
BCC, in units of two characters, to make 1-byte hexadecimal data. (Example: 37h, 35h
→
75h)
2.
Add up the results of step
1
.
3.
Invert the result bit by bit, and add 1 (2’s complement).
4.
Convert the lowest 1-byte data to ASCII characters. (Example: 75h
→
37h, 35h)
5.
Store the two digits to the BCC (LRC) position.
Modbus RTU — Calculating the CRC-16 (cyclic redundancy checksum)
1.
Take the exclusive OR (XOR) of FFFFh and the first 1-byte data at the BCC calculation start position.
2.
Shift the result by 1 bit to the right. When a carry occurs, take the exclusive OR (XOR) of A001h, then go to step
3
.
If not, directly go to step
3
.
3.
Repeat step
2
, shifting 8 times.
4.
Take the exclusive OR (XOR) of the result and the next 1-byte data.
5.
Repeat step
2
through step
4
up to the byte immediately before the BCC.
6.
Swap the higher and lower bytes of the result of step
5
, and store the resultant CRC-16 to the BCC (CRC) position.
(Example: 1234h
→
34h, 12h)
Содержание FC4A-C10R2
Страница 1: ...FC4A SERIES Micro Programmable Logic Controller User s Manual FC9Y B812 ...
Страница 6: ...PREFACE 4 FC4A MICROSMART USER S MANUAL ...
Страница 94: ...2 MODULE SPECIFICATIONS 2 74 FC4A MICROSMART USER S MANUAL ...
Страница 184: ...6 ALLOCATION NUMBERS 6 20 FC4A MICROSMART USER S MANUAL ...
Страница 218: ...8 ADVANCED INSTRUCTIONS 8 8 FC4A MICROSMART USER S MANUAL ...
Страница 240: ...11 BINARY ARITHMETIC INSTRUCTIONS 11 8 FC4A MICROSMART USER S MANUAL ...
Страница 244: ...12 BOOLEAN COMPUTATION INSTRUCTIONS 12 4 FC4A MICROSMART USER S MANUAL ...
Страница 252: ...13 SHIFT ROTATE INSTRUCTIONS 13 8 FC4A MICROSMART USER S MANUAL ...
Страница 274: ...15 WEEK PROGRAMMER INSTRUCTIONS 15 8 FC4A MICROSMART USER S MANUAL ...
Страница 378: ...22 DUAL TEACHING TIMER INSTRUCTIONS 22 4 FC4A MICROSMART USER S MANUAL ...
Страница 386: ...23 INTELLIGENT MODULE ACCESS INSTRUCTIONS 23 8 FC4A MICROSMART USER S MANUAL ...
Страница 408: ...24 ANALOG I O CONTROL 24 22 FC4A MICROSMART USER S MANUAL ...
Страница 426: ...26 COMPUTER LINK COMMUNICATION 26 6 FC4A MICROSMART USER S MANUAL ...