Skip to main content
Skip table of contents

modbus_unsigned_to_signed(unsigned_data)

Features

When using Modbus protocol, this is a command to convert 2 bytes unsigned data into signed data.

Parameter

Parameter Name
Data Type
Default Value
Description

unsigned_data

int

-

2byte unsigned data(0~65535)

Return

Value
Description

signed_data

2byte signed data(-32769 ~ 32767)

Exception

Exception
Description

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
unsigned_data = 40000
signed_data = modbus_unsigned_to_signed(unsigned_data)
JavaScript errors detected

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

If this problem persists, please contact our support.