This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Modbus profile 32float
#1
Hi, I'm having some troubles trying to read float32 values from modbus, setting the profile as below, read value on KNX is always 0. When I try to read using "read test" as 32float it seems to work...

 "mapping": [
{"name": "SETPOINT_csp1_[R/W]",
"bus_datatype": "float32",
"type": "register",
"datatype": "float32",
"address": 900,
"read_offset": 0,
"read_count": 2,
"writable": true,
"value_delta": 0.1,
"value_multiplier": 1,
"units": "ºC"
}
Reply
#2
Delete the read_offset and read_count. Drop a screenshot of correct settings from Read test.
------------------------------
Ctrl+F5
Reply
#3
(11.06.2024, 13:02)Daniel Wrote: Delete the read_offset and read_count. Drop a screenshot of correct settings from Read test.


I've tried deletting but it doesn't work
The screenshot:

Reply
#4
you are missing the read_swap n
------------------------------
Ctrl+F5
Reply
#5
(11.06.2024, 13:14)Daniel Wrote: you are missing the read_swap n

I've it here:

{
  "manufacturer": "test",
  "description": "test",
  "read_swap": "n",
  "mapping": [
{"name": "SETPOINT_csp1_[R/W]",
"bus_datatype": "float32",
"type": "register",
"datatype": "float32",
"address": 900,
"writable": true,
"value_delta": 0.1,
"value_multiplier": 1,
"units": "ºC"
}
  ]
}
Reply
#6
Do you have any errors under Modbus-Error log?
------------------------------
Ctrl+F5
Reply
#7
(11.06.2024, 14:24)Daniel Wrote: Do you have any errors under Modbus-Error log?

No...
Reply
#8
Try setting both data types to uint32. What value is ready then?
Reply
#9
(11.06.2024, 14:37)admin Wrote: Try setting both data types to uint32. What value is ready then?

It reads 1093664768
Reply
#10
Maybe not related to above but i've noticed other things when using latest firmware.
  1. When I set two slaves on the same port (RS485) and both have the same poll time, in each poll the second device has timeouts... If I set different poll times, for example 30s and 60s when they match timeout appears on second device...
  2. Have you changed minimum value delta to 0.2? For example when reading heat meters where energy values are in Mwh is too much...
Reply
#11
TCP implementation on certain Modbus devices is very buggy. Usually only a limited amount of connections can be created and it takes some time for the device to detect disconnect and free up a used connection. Sometimes this can be fixed by enabling the "Persistent connection" mode.

At the moment value delta minimum is 0.2. This had to be done because a lot of installations are overloaded by not setting the delta properly.
Reply
#12
(12.06.2024, 09:39)admin Wrote: TCP implementation on certain Modbus devices is very buggy. Usually only a limited amount of connections can be created and it takes some time for the device to detect disconnect and free up a used connection. Sometimes this can be fixed by enabling the "Persistent connection" mode.

At the moment value delta minimum is 0.2. This had to be done because a lot of installations are overloaded by not setting the delta properly.

Ok, but timeouts are on RS485 line not on modbus TCP connections (at least in my case...) and I've not noticed it in previous firmwares...

Have you seen someting on float32 values in profiles? The value read as uint32 (1093664768 ) correponds to the value in float32 format (11.0) so It seems that's a conversion issue, isn't it?

Thanks.
Reply
#13
Some RS485 devices need an extra delay between reads: https://kb.logicmachine.net/misc/modbus-...read_delay

I've tested your profile and reading the exact same float32 value (0x41300000) works as expected.
Reply
#14
(12.06.2024, 10:49)admin Wrote: Some RS485 devices need an extra delay between reads: https://kb.logicmachine.net/misc/modbus-...read_delay

I've tested your profile and reading the exact same float32 value (0x41300000) works as expected.

I don't understand why using read test works and using profile not...
Reply
#15
In you read test screenshot you are using TCP connection. Have you tried enabling Persistent connection mode? Try rebooting your Modbus device as well.
Reply
#16
(12.06.2024, 10:53)admin Wrote: In you read test screenshot you are using TCP connection. Have you tried enabling Persistent connection mode? Try rebooting your Modbus device as well.

Ok using persistent connection it works!!

In RS485 line I've two devices (both are the same model) and always timeouts are in the second one (the higher slave address). If I read only one device (no matter which one) there aren't timeouts...
Reply
#17
See my previous post about adding read_delay to the profile for RS485 devices.
Reply
#18
(12.06.2024, 11:19)admin Wrote: See my previous post about adding read_delay to the profile for RS485 devices.

I've read it but if I understand it, delay is between read requests (on the same device) isn't it? So if I've no delay and only one device there should be timeouts...
We've other installations where we use the same meters (but using older firmwares) and I've not seen this behavour...
Reply
#19
Might be some edge case. Just add read_delay and see if it helps. Another option to try is using a lower baud rate if possible.
Reply
#20
(12.06.2024, 11:44)admin Wrote: Might be some edge case. Just add read_delay and see if it helps. Another option to try is using a lower baud rate if possible.

Hi I've added read_delay=0.2 and it seems that works.
Thanks!
Reply


Forum Jump: