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

Implement Float (Little Endian Byte Swap) #508

Open
dieterlind opened this issue May 6, 2024 · 5 comments
Open

Implement Float (Little Endian Byte Swap) #508

dieterlind opened this issue May 6, 2024 · 5 comments

Comments

@dieterlind
Copy link

Is your feature request related to a problem? Please describe.
To be able to read all input registers for my IDM heat pump it is required to have the type Float (Little Endian Byte Swap) available for selection.

Describe the solution you'd like
Implement type Float (Little Endian Byte Swap)

Describe alternatives you've considered
No alternative known

@PLCHome
Copy link
Contributor

PLCHome commented May 6, 2024

floatbe - Float (Big Endian): AABBCCDD => AABBCCDD
floatle - Float (Little Endian): AABBCCDD => DDCCBBAA
floatsw - Float (Big Endian Word Swap): AABBCCDD => CCDDAABB
floatsb - Float (Big Endian Byte Swap): AABBCCDD => DDCCBBAA

Maybe the name was just chosen poorly
if floatle - Float (Little Endian): AABBCCDD => DDCCBBAA
Then by Byte Swap CCDDAABB so it must be floatsw - Float (Big Endian Word Swap) the same. Isn't it?

Or what is the expected result from the bytes in hex representation with the identifier AA BB CC DD of each byte sendet in order A to D?

It's actually funny that in the documentation floatsb is the same as floatle.

@dieterlind
Copy link
Author

Hello!
Honestly I do know too little about Modbus to judge this.

What I can say:
IDM has actually a pretty good document for their Modbus interface.
When I read register 1000 or 1002 it works, when I try to read 1008 it doesn't work.
Both are defined in the documentation as following:
image

Regarding type FLOAT the documentation gives this information:
image

In ioBroker they are defined like:
address name description unit type len factor offset formula role room cw isScale
1000 Außentemperatur Außentemperatur
(B32) C floatsw 2 1 0 value.temperature false false
1002 Gemittelte_Außentemperatur Gemittelte_Außentemperatur C floatsw 2 1 0 value.temperature false false
1008 Wärmespeichertemperatur Wärmespeichertemperatur_(B38) C floatsw 2 1 0 value.temperature

Error when reading 1008:
image

When I try to read to read the register with Modbus Poll it works when selecting 32-bit floating little endian byte swap
image

Maybe this helps!

Thanks!

@PLCHome
Copy link
Contributor

PLCHome commented May 6, 2024

When I read register 1000 or 1002 it works, when I try to read 1008 it doesn't work.

Ok, but it doesn't seem to be the data type. If these values are correct.

Error when reading 1008:

I think it's more of an alignment problem. He cannot access the address.

@dieterlind
Copy link
Author

The strange thing is that 1000 and 1002 are correct with Float (Big Endian Word Swap) in ioBroker, but the values are wrong in Modbus Poll when setting to Big Endian Byte Swap (no word swap available). They are just right there when using Little Endian byte Swap.

But how to fix the issue in iob-modbus if the alignment seems to be right in Modbus Poll?

@dieterlind
Copy link
Author

Any ideas?

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

2 participants