Posts: 8410
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
	
	
		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: 394
	Threads: 84
	Joined: Jun 2017
	
Reputation: 
9
	 
	
	
		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: 8410
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
	
	
		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: 394
	Threads: 84
	Joined: Jun 2017
	
Reputation: 
9
	 
	
	
		Test working OK.
Read swap is CDAB by default. Is it = n ?
Temp readed 158 so should be divided by 10
	
	
	
	
		
	
 
 
	
	
	
		
	Posts: 8410
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
	
	
		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: 394
	Threads: 84
	Joined: Jun 2017
	
Reputation: 
9
	 
	
	
		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: 394
	Threads: 84
	Joined: Jun 2017
	
Reputation: 
9
	 
	
		
		
		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: 8410
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
	
	
		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: 93
	Threads: 19
	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: 5283
	Threads: 29
	Joined: Aug 2017
	
Reputation: 
237
	 
	
	
		Nothing has changed in the documentation.
https://openrb.com/docs/modbus.htm
Use read test to find out correct configuration.
	
------------------------------
Ctrl+F5
	
		
	
 
 
	
	
	
		
	Posts: 8410
	Threads: 45
	Joined: Jun 2015
	
Reputation: 
481
	 
	
	
		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.