ProNet series AC servo system User’s manual V.1.08
- 118 -
RTU
RTU
RTU
RTU mode
mode
mode
mode
:
Reference information
:
Response information
:
LRC
(
ASCII mode
)
and CRC
(
RTU mode
)
error detection value calculation
:
LRC
LRC
LRC
LRC calculation
calculation
calculation
calculation in
in
in
in ASCII
ASCII
ASCII
ASCII mode:
mode:
mode:
mode:
ASCII mode uses LRC (Longitudinal Redundancy Check) error detection value. The exceeded parts (e.g.
the total value is 128
H
of hex, then take 28
H
only) is taken off by the unit of 256 in the total value from
ADR to the last information, then calculate and compensate, the final result is LRC error detection value.
For example: read 1 word from 01
H
servo address 0201
H
Add
Add
Add
Add from
from
from
from ADR
ADR
ADR
ADR data
data
data
data to
to
to
to the
the
the
the last
last
last
last data.
data.
data.
data.
01
H
+03
H
+02
H
+01
H
+00
H
+01
H
=08
H
The compensate value is F8
H
when 2 is used to compensate 08
H
, so LRC is “F”,”8”.
CRC
CRC
CRC
CRC calculation
calculation
calculation
calculation of
of
of
of RTU
RTU
RTU
RTU mode:
mode:
mode:
mode:
RTU mode uses CRC (Cyclical Redundancy Check) error detection value.
The process of CRC error detection value calculation is shown as follows:
Step 1: Load in a 16-bit register of FFFF
H
, named “CRC” register.
Step 2: Run XOR calculation between the first bit (bit 0) of instruction information and 16-bit CRC
register’s low bit (LSB), and the result is saved to CRC register.
Step 3: Check the lowest bit (LSB) of CRC register, if it is 0, CRC register moves one bit to right; if it is 1,
STX
‘
:
’
ADR
‘0’
‘1’
CMD
‘0’
‘3’
Data start address
‘0’
‘2’
‘0’
‘1’
Data number
(
count as word
)
‘0’
‘0’
‘0’
‘1’
LRC checking
‘F’
‘8’
End 1
(0D
H
)(CR)
End 0
(0A
H
)(LF)
ADR
01
H
CMD
06
H
Data start address
02
H
(high-bit)
00
H
(low-bit)
Data content
00
H
(high-bit)
64
H
(low-bit)
CRC checking
89
H
(low-bit)
CRC checking
99
H
(high-bit)
ADR
01
H
CMD
06
H
Data start address
02
H
(high-bit)
00
H
(low-bit)
Data content
00
H
(high-bit)
64
H
(low-bit)
CRC checking
89
H
(low-bit)
CRC checking
99
H
(high-bit)