IDEC MICRO/I HG4G-CJT22 F-B Series User Manual page 181

Micro/i operator interfaces for windo/i-nv4
Table of Contents

Advertisement

Modbus RTU (CRC):
CRC-16 (Generating polynomial:x
procedure. Conversion Type: No conversion, Number of bytes: 2
1. Obtain an exclusive OR (XOR) of 1 byte data at Calculation Start Position and FFFFh.
2. If the least significant bit of the result of step 1 is 0, shift to the right by one bit. If the
3. Repeat step 2 to shift 8 times.
4. Obtain XOR of the next one byte of data and the result of step 3.
5. Repeat steps 2 through 4 until the data at Calculation End Position is processed.
6. Compare the result of step 5 in the order of the lower byte and upper byte.
Conversion Type
After calculating the data using the specified calculation type, select the type of conversion for the data from the
following.
Hexadecimal to ASCII:
No conversion:
Number of bytes
After converting according to the specified conversion type, select 1 or 2 for the number of bytes for comparison
data.
Example: BCC for receive command data
This example describes the case of comparing the BCC calculation result for the following receive data with the BCC
part of the receive data.
STX
1
2
3
(02h)
(31h)
(32h)
(33h)
• Calculation Start Position and Calculation End Position
When Calculation Start Position is 2 and Calculation End Position is 1: Calculates the range 1234.
Calculation Start Position:
Calculation End Position:
• Calculation Type
XOR:
ADD:
ADD (2's Complement): Inverts the bit of CAh+1=36h
Modbus ASCII (LCR):
Modbus RTU (CRC):
• Conversion Type
When the BCC calculation result is 0004h, the converted data is as follows.
Data
0004h
Hexadecimal to ASCII
Data
0004h
No conversion
bit is 1, shift to the right by 1 bit and obtain XOR of the result and the value (A001h).
Example: 1234h → 34h, 12h
Considers the data as binary-coded hexadecimal number and converts it to ASCII data.
No conversion is performed.
4
5
BCC
CR
(34h)
(35h)
(0Dh)
(1)
(2)
(3)
(4)
STX
1
2
3
(02h)
(31h)
(32h)
(33h)
(5)
(4)
(3)
(2)
Data used for BCC calculation
31h^32h^33h^34h^=04h
31h+32h+33h+34h=CAh
BA→42h, 41h
BA30h→BAh, 30h
0
4
(30h)
(34h)
00h
04h
WindO/I-NV4 User's Manual
16
15
2
+x
+x
+1) is calculated according to the following
(5)
(6)
4
5
BCC
CR
(34h)
(35h)
(0Dh)
(1)
(0)
5 User Communication
3
3-75

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents