HD45 / HD46
- 67 -
V2.4
APPENDIX A
Control codes computing in MODBUS-RTU protocol
In MODBUS-RTU, two check modes for the transmitted data correctness coexist:
•
Parity check on single byte
•
Cyclic redundancy check (CRC) on the whole transmitted frame.
Codes are computed by the transmitting device as a function of the data to be
transmitted. The receiving device calculates again the codes as a function of the
received data and compares them with the ones attached to the message. If codes
are correct, the message is accepted and processed.
Parity check
It is a check performed on a single byte.
A bit is added at the end of each information byte so that bit-1 total number is:
•
even, if even parity is used
•
odd, if odd parity is used
Example
: byte = 1100 0101, bit-1 number is four. The parity bit will be 0 in case of
even parity, or 1 if odd parity is used.
The protocol factory-default mode is even parity.
The instrument allows to edit or disable the parity check by means of the
configuration parameter P#060.
CRC code
CRC code is a 16-bit binary value computed in function of all the message bytes and is
attached at the end of the message to be transmitted.
The code computing procedure is as follows:
1.
The 16 bits of the CRC register are all initialized to 1.
2.
The exclusive OR (XOR) is performed between the CRC least significant byte
and the first byte of the message (excluding start, parity and stop bits). The
result becomes the new CRC value.
3.
CRC register is shifted right by introducing a 0 on the left as the most
significant bit.
4.
The shifted out bit at right is checked: if it is 1, XOR is performed between CRC
value and fixed value “1010 0000 0000 0001”. The result is the new CRC value.
5.
Steps 3 and 4 are repeated till a total of 8 shifts is achieved.
6.
Steps 2, 3, 4 and 5 are repeated for all the message bytes.
7.
The final CRC value is placed at the end of the message starting from the least
significant byte, that will then be transmitted prior to the most significant one.
Содержание HD45 17A
Страница 10: ...HD45 HD46 10 V2 4 3 1 HD45 connection diagrams ...
Страница 11: ...HD45 HD46 11 V2 4 3 2 HD46 connection diagrams ...
Страница 62: ...HD45 HD46 62 V2 4 Dimensions in mm HD45 series HD46 series ...
Страница 63: ...HD45 HD46 63 V2 4 Fixing holes ...
Страница 71: ......