3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish
3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.2 3.2.1 3.2.0 Korean English Chinese Czech Dutch French German Hungarian Italian Japanese Polish Portuguese Spanish

modbus_unsigned_to_signed()

정의

modbus_unsigned_to_signed(unsigned_data)

기능

Modbus protocol 사용 시, 2bytes unsigned 데이터를 signed data로 변환하기 위한 명령어입니다.

인수

인수명

자료형

기본값

설명

unsigned_data

int

-

2byte unsigned data(0~65535)

리턴

설명

signed_data

2byte signed data(-32769 ~ 32767)

예외

예외

설명

DR_Error (DR_ERROR_TYPE)

인수들의 데이터형 오류 시

DR_Error (DR_ERROR_VALUE)

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

DR_Error (DR_ERROR_RUNTIME)

C Extension 모듈 에러 발생 시

DR_Error (DR_ERROR_STOP)

프로그램 강제 종료 시

예제

Python
unsigned_data = 40000
signed_data = modbus_unsigned_to_signed(unsigned_data)

Keyword

modbus / unsigned / signed