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.

Read 6 byte dpt
#1
Hello 

I am working in energy meter Hager TXF that it server total input energy in 6 byte .
How to read it in wiser KNX  ? 

Regards .
Reply
#2
Use an event script to split the value. energy is 4 byte signed integer, tariff is 1 byte unsigned integer, tariffvalid / energyvalid are 1 bit booleans.
Code:
energy = busdatatype.decode(event.datahex:sub(1, 8), dt.int32)
tariff = tonumber(event.datahex:sub(9, 10), 16)
status = tonumber(event.datahex:sub(11, 12), 16)

tariffvalid = bit.band(status, 1) ~= 0
energyvalid = bit.band(status, 2) ~= 0

log(energy, tariff, tariffvalid, energyvalid)

grp.checkupdate('1/1/1', energy)
grp.checkupdate('1/1/2', tariff)
grp.checkupdate('1/1/3', tariffvalid)
grp.checkupdate('1/1/4', energyvalid)
Reply
#3
Hi thank you admin .
Reply


Forum Jump: