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 whether you accept or reject these cookies being set.

Modbus values wrong
I'm trying to connect my ventilation unit (Dantherm) to the Wiser for KNX from Scheider using Modbus TCP/IP. Most parameters are updating correctly, but for some there is no value coming through, or when entering a new value a completely different value is set at the device-end.

These are the modbus guidelines from the manual:

Quote:3.2 Modbus commands
The Ventilation unit supports the following commands of Modbus protocol:
– Read holding registers (0x03);
– Write multiple Holding registers (0x10).
3.3 Date storing format
3.3.1 32 bit parameters
All parameters of the ventilation unit have a 32 bits dimension. However the Modbus works with regist ers which have 16 bits dimension. Each parameter in the ventilation unit is therefore separated in two parts (Low and High). Modbus model stores it like two registers (R0 and R1 according), which are located together in sequence. A register with Low part o f parameters has the lower address.
3.3.2 Date/Time format
All date/time parameters contain value in Unix time (amount of seconds from 1.1.1970).
3.3.3 Float
A floating point value is 32 bits, but Modbus uses 16 bit registers therefore this 32 bit value is mapped to two register. The sequence used is CDAB.

This is the line in my profile to read the humidity in the room air:
{ "name": "RH sensor value", "bus_datatype": "5", "type": "register", "datatype": "uint32", "address": 197, "read_count": 2, "read_swap": "w", "writable": 0 }

[Image: IjuyRgi.png]
In Wiser there is a value of 0 shown, although when reading this value directly using Modbus Poll the correct value is shown (45%), but only when formatting using the Little-endian byte swap.

[Image: oRpyv1R.png]

[Image: qnyKAPq.png]

When the Filter Lifetime is set, eg. 360 days, there is 23592960 registered on the device. I can only correct this again using Modbus Poll, using this desktop application everything is working as expected.
{ "name": "Filter Lifetime", "bus_datatype": "7", "type": "register", "datatype": "uint32", "address": 557, "read_count": 2, "read_swap": "w", "writable": 1, "write_multiple": true }

Some of the other writable parameters show the same glitch.

I can't figure out how to define these parameters in my profile, most other parameters seem to work fine. Also seems strange everything is working fine when using Modbus Poll.

Attached Files
.json   Dantherm_HCV700.json (Size: 4.59 KB / Downloads: 2)
Set "read_swap" to "n"
(20.01.2020, 08:12)admin Wrote: Set "read_swap" to "n"

That doesn't work, the manual states CDAB, following the guide found here, this seems to be word swap. All values are out of range when no swap is selected.
Do you have any errors in Modbus error logs?
No, all seems to come through fine, except these little quirks. Direct readout with modbus poll works without issues.
Try reading raw values via a script, change IP/port as needed:

mb = luamodbus.tcp()
mb:open('', 502)
res, err = mb:connect()

if res then
  -- mb:setslave()
  r1, r2 = mb:readregisters(197, 2)
  log(r1, r2)
  log('connect failed', err)

Thanks for your help. Enabling the script gives me no valuable data:

Quote:Dantherm Ventilation 20.01.2020 17:19:31
* arg: 1
  * number: 0
* arg: 2
  * number: 0

When I enter another register address I do get the data as expected.
Try reading register 196 instead of 197
This gives 255, not the correct value
You might need to uncomment setslave() call and set correct slave id like this:
You can also run Wireshark on your PC together with Modbus Poll to see raw communication. This might help to find out correct settings.

Forum Jump: