Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

read_input_registers is limited 16 bit? #93

Open
mofm opened this issue Jun 3, 2024 · 0 comments
Open

read_input_registers is limited 16 bit? #93

mofm opened this issue Jun 3, 2024 · 0 comments

Comments

@mofm
Copy link

mofm commented Jun 3, 2024

Description

The documentation of my Modbus device is as follows:

"Signed Measurement (32-bit)
Decade Exponent (Signed 8-bit)
Binary Signed value (24 bit)
Example: - 123456*10-3 = FDFE 1DC0(16)"

But as it is written in the documentation of the umodbus.serial library:
"Input registers can hold values ​​between 0 and 65535. If supported by the client device, data can be marked as signed values ​​to represent -32768 through 32767."

So this function only supports 16 bit values? Also, if positive values ​​do not exceed 65000, there is no problem. But negative values ​​are returned, such as 65xxx. How can I fix this?

Reproduction steps

...

MicroPython version

v1.23.0

MicroPython board

Raspberry Pico

MicroPython Modbus version

# e.g. v2.3.3
# use the following command to get the used version
import os
from umodbus import version
print('MicroPython infos:', os.uname())
print('Used micropthon-modbus version:', version.__version__))

Relevant log output

No response

User code

No response

Additional informations

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant