12 063
правки
(Новая страница: «=== Modbus checksum calculation ===») |
(Новая страница: «For the Modbus RTU Protocol, the 16-bit checksum (CRC) is calculated using the algorithm described in the [http://www.modbus.org/specs.php Modbus] specification…») |
||
Строка 233: | Строка 233: | ||
=== Modbus checksum calculation === | === Modbus checksum calculation === | ||
For the Modbus RTU Protocol, the 16-bit checksum (CRC) is calculated using the algorithm described in the [http://www.modbus.org/specs.php Modbus] specification in ''the Modbus Serial Line Protocol and Implementation Guide, CRC-generation section''. The sending device generates two bytes of checksum based on the message data, and the receiving device recalculates the checksum and compares it with the received one. The coincidence of the accepted and calculated modbud RTU checksum is considered an indicator of successful data exchange. | |||
В случае ограниченных вычислительных ресурсов для вычисления контрольной суммы существует функция, использующая табличные значения (так же приведена в спецификации). | В случае ограниченных вычислительных ресурсов для вычисления контрольной суммы существует функция, использующая табличные значения (так же приведена в спецификации). |
правки