Modubus binding fails by writeValueType="uint32_swap"

Hi,
I am trying to write a Modus register with writeValueType=“uint32_swap”.
Here is the fault message:
Status:

Status:

UNINITIALIZED

HANDLER_CONFIGURATION_PENDING

{writeValueType=Der Wert uint32_swap ist nicht in den erlaubten Optionen enthalten. Erlaubte Optionen sind: [ParameterOption [value=“int64”, label=“64bit positive or negative integer, 4 registers (int64, uint64)”], ParameterOption [value=“int64_swap”, label=“64bit positive or negative integer, 4 registers but with 16bit words/registers in reverse order (dcba) (int64_swap, uint64_swap)”], ParameterOption [value=“float32”, label=“32bit floating point (float32)”], ParameterOption [value=“float32_swap”, label=“32bit floating point, 16bit words swapped (float32_swap)”], ParameterOption [value=“int32”, label=“32bit positive or negative integer, 2 registers (int32, uint32)”], ParameterOption [value=“int32_swap”, label=“32bit positive or negative integer, 2 registers but with 16bit words/registers in reverse order (ba) (int32_swap, uint32_swap)”], ParameterOption [value=“int16”, label=“16bit positive or negative integer, 1 register (int16, uint16)”], ParameterOption [value=“bit”, label=“individual bit (bit)”]]}

If I understand the “uint32_swap” is mentioned as possible option in the message
BTW a “int32_swap” seems to working … at least the thing is online.

Is that a bug or a misunderstanding on my side?

Ronny

You cannot use u* types in writes since a somewhat recent change. Omit the “u” in write type.

@ssalonen I did not see that in the binding docs. Could you please rework them and point this out ?

This is documented as breaking change in 3.3.0 docs: Release openHAB 3.3.0 · openhab/openhab-distro · GitHub

I am not sure what is missing docs, the behaviour is according to docs. Appreciate of course if that can be made more clear, welcoming PRs

It’s really hidden in the docs so few people see it. New users do not and even few old timers read release notes.
Make it more prominent, use markdown to create a tip box to hit the reader’s eye.

Welcoming PRs :slight_smile:

With [modbus] openHAB 4.0 refactoring: turn things into channels similar to mqtt.generic · Issue #14058 · openhab/openhab-addons · GitHub in the horizon, the README will be changed completely.

3.4 will be in use for much longer so any 4.0 change is no argument not to change this.
Why do you insist on someone else to create a PR rather than simply do it yourself? Come on,
add a prominent notice in the current README, use markdown ::tip, 5 mins of work for you, here you are. Will save many people a lot of time.

We all have limited time, this is the main reason for trying to make it a community effort.

:roll_eyes: true as a generalized statement but don’t you think you’re maybe overdoing it here ?
It’s a 5-liner, in the time it took both of us to discuss here you could have finalized it.
Also mind that noone but you as the author will dare to change essential information.

2 Likes

I need to write a password to a modbus device that is a “uint32” in two registers. Do I need to convert the “unsinged value” to a signed value and write an “int32”? Helpful hints are very welcome!

No need to do any conversions. The binding takes low 32 bits of the command (details in BigDecimal::intValue), and then send it via wire using 2’s complement representation.

Sending -1004 DecimalType command to an item will result into same thing as command 4294966292: 0xFFFFFC14 will be written over modbus protocol.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.