Skip to main content
Skip table of contents

modbus_crc16(data)

Features

When using the Modbus protocol, this command reduces the load on Modbus CRC16 calculations.

Parameter

Parameter NameData TypeDefault ValueDescription

data

byte

-

Modbus data for CRC16 calculations

Return

ValueDescription

crchigh

High byte of CRC16 calculation result

crclow

Low byte of CRC16 calculation result

Exception

ExceptionDescription

DR_Error (DR_ERROR_TYPE)

Parameter data error occurred

DR_Error (DR_ERROR_VALUE)

Parameter value is invalid

DR_Error (DR_ERROR_RUNTIME)

C Extension module error occurred

DR_Error (DR_ERROR_STOP)

Program terminated forcefully

Example

PY
data = b"\x01\x02\x03\x04\x05\x06"
crchigh, crclow = modbus_crc16(data)
#crchigh = 186(DEC), BA(HEX)
#crclow = 221(DEC), DD(HEX)
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.