Skip to main content
Skip table of contents

modbus_crc16(data)

기능

Modbus protocol 사용 시, modbus crc16 계산에 대한 부하를 줄이기 위한 명령어입니다.

인수

인수명자료형기본값설명

data

byte

-

crc16계산을 위한 modbus data

리턴

설명

crchigh

Crc16 계산 결과의 high byte

crclow

Crc16 계산 결과의 low byte

예외

예외설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

인수의 값이 유효하지 않을 시

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

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.