Mitsubishi Electric MELSEC iQ-R Series User Manual page 536

Serial communication module
Hide thumbs Also See for MELSEC iQ-R Series:
Table of Contents

Advertisement

Check code
■Processing procedure
C24 processes check code according to the following procedure.
1.
Calculates value according to the selection of "Processing method".
2.
When "Complement calculation" is 'One's complement' or 'Two's complement', performs a 2-word-wise complement
operation on the value calculated in the above 1.
3.
When "Code type" is 'ASCII decimal', extracts the lowest one word from the value calculated in the above 2, and
performs the hexadecimal to decimal conversion.
C24
Data transmission
Data reception
■Calculation procedure for horizontal parity
The following show procedures for calculating horizontal parities using the following sample data.
STX
"R"
For the packet shown above
"R"
(52
)
0101 0010
H
XOR
"J"
(4A
)
0100 1010
=
H
"7"
(37
)
H
"1"
(31
)
H
"C"
(43
)
H
"2"
(32
)
H
"4"
(34
)
H
ETX
(03
)
H
APPENDICES APPENDIX
534
Appendix 5 Operation Image and Data Structure of Predefined Protocol
(Data flow)
Forward direction (upper byte → lower byte)
Reverse direction (lower byte → upper byte)
Swapping
send data
(Data flow)
Forward direction (upper byte → lower byte)
Reverse direction (lower byte → upper byte)
Swapping
receive data
Byte swap (by word)
*Only when the data
length
specification is 4
bytes
"J"
"7"
"1"
Calculating range
0001 1000
XOR
0011 0111
=
0010 1111
XOR
0011 0001
=
0001 1110
XOR
0100 0011
(Code type)
BIN → ASCII
conversion of
Byte swap (by word)
length value
*Only when the data
length specification is
4 bytes
(Code type)
HEX
ASCII → BIN
conversion of
ASCII
length value
hexadecimal
ASCII decimal
"C"
"2"
"4"
=
0101 1101
XOR
0011 0010
=
0110 1111
XOR
0011 0100
=
0101 1011
XOR
0000 0011
Horizontal parity = 58
(Processing method)
(Data length)
(Calculating range)
(Complement calculation)
HEX
Calculated
length value
ASCII
hexadecimal
ASCII decimal
(Processing method)
(Data length)
(Calculating range)
(Complement calculation)
Calculated
check code
Checking
Received
check code
Horizontal
ETX
parity
=
0101 1000
(Binary)
(Hexadecimal)

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents