Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
S32 is a signed 32-bit integer so datatype must be set to int32. Add "value_multiplier": 0.1 to divide the resulting value by 10.
Posts: 335
Threads: 75
Joined: Jun 2017
Reputation:
6
Hi,
not working, temp. read the same 670760.96 °C
{
"manufacturer": "Ouman",
"description": "H23 V1",
"mapping": [
{
"name": "Outdoor temp.",
"address": 201,
"bus_datatype": "temperature",
"datatype": "int32",
"type": "register",
"units": "\u00B0C",
"value_multiplier": "0.1"
},
{
"name": "H1 supply water temp.",
"address": 203,
"bus_datatype": "temperature",
"datatype": "int32",
"type": "register",
"units": "\u00B0C",
"value_multiplier": "0.1"
}
]
}
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
You might also need to set a different read_swap value (probably "n"). Use Read test to find the correct settings then implement them a profile.
Posts: 335
Threads: 75
Joined: Jun 2017
Reputation:
6
Test working OK.
Read swap is CDAB by default. Is it = n ?
Temp readed 158 so should be divided by 10
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
Default swap is "w" (word, CDAB). You need to add "read_swap": "n" to the profile. "value_multiplier": 0.1 will handle the conversion (divide by 10).
Posts: 335
Threads: 75
Joined: Jun 2017
Reputation:
6
But this is without datatype set.
If I set int32 I receive 1035488 with CDAB. When I set to none all is Ok. So now all is clear with this, thank you!
Posts: 335
Threads: 75
Joined: Jun 2017
Reputation:
6
11.12.2022, 18:18
(This post was last modified: 11.12.2022, 18:22 by AlexLV.)
Hi,
another little problem is found now. Positive temperature reading is OK, but when temperature is negative - I see reading 6548.48. What can be corrected in my case:
"mapping": [
{
"name": "Outdoor temp.",
"address": 201,
"bus_datatype": "temperature",
"datatype": "int32",
"type": "register",
"units": "\u00B0C",
"value_multiplier": "0.1"
},
Alex
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
What values do you get when doing read test with these settings?
Function: holding register
Address: 201
Data type: -
Read length: 2
Also perform the same read test with address set to 200.
Posts: 92
Threads: 18
Joined: Apr 2022
Reputation:
0
Admin, Can I still use the "read_swap": "n" instruction to read the same object that is not a continuous data address? If not, what should I do?
eg:
Power_ H register: 0x60
Power_ L register: 0x70
Posts: 4638
Threads: 24
Joined: Aug 2017
Reputation:
207
Nothing has changed in the documentation.
https://openrb.com/docs/modbus.htm
Use read test to find out correct configuration.
------------------------------
Ctrl+F5
Posts: 7758
Threads: 42
Joined: Jun 2015
Reputation:
447
You will need a script if the value is split across several registers that are not consecutive. Register values can be read via profile but the final value conversion will be done by a script.