Skip to content

read SINT8 and UINT8 using client.convert_from_registers(...) ? #2520

Answered by janiversen
ramo48859 asked this question in Help
Discussion options

You must be logged in to vote

What is SINT8 ?

The modbus protocol do not support less than 16bit (if you read e.g. 8 coils==bit the response is padded to 16bit bit.

So an INT8 cannot be read, it will be padded as an INT16.

If you have (a really unique and weird) modbus device that implements int8 then you have to see with debug how it's actually transmitted because it's surely not modbus standard.

If you device packs 2 int8 in one register (again something very unusual), then you run a to_bytes on the register returned.

to/from is there to help with the standard cases, more advanced usage (as documented) is left to the app.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@qcda1
Comment options

@janiversen
Comment options

@qcda1
Comment options

Answer selected by janiversen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants