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.

Saving a date
#5
Hi,

DPT 19 is not available in the controller, only way to do it is to use the 250 byte object (raw dpt) and build the telegram yourself.

You can try this sample, it's not 100% filled according the standard but for time and date it should work, if you want it 100% correct you need to complete OCT2 and OCT1
Code:
now = os.date('*t')
wday = now.wday == 1 and 7 or now.wday - 1
OCT08 = now.year - 1900 
OCT07 = now.month
OCT06 = now.day
OCT05 = bit.bor(bit.lshift(wday, 5), now.hour)
OCT04 = now.min
OCT03 = now.sec
OCT02 = 0 -- subfields like working day and dst not specified in this sample
OCT01 = 0 -- subfields like quality of clock not specified in this sample

knx_raw_dpt = string.char(OCT08) .. string.char(OCT07) .. string.char(OCT06) .. string.char(OCT05) .. string.char(OCT04) .. string.char(OCT03)  .. string.char(OCT02)  .. string.char(OCT01)
grp.write('1/1/1', knx_raw_dpt)
BR,

Erwin
Reply


Messages In This Thread
Saving a date - by RSV4 - 03.09.2015, 08:57
RE: Saving a date - by admin - 03.09.2015, 09:11
RE: Saving a date - by gtsamis - 11.06.2018, 15:34
RE: Saving a date - by Erwin van der Zwart - 11.06.2018, 22:51
RE: Saving a date - by RSV4 - 03.09.2015, 09:25
RE: Saving a date - by admin - 12.06.2018, 07:08
RE: Saving a date - by Erwin van der Zwart - 12.06.2018, 12:18

Forum Jump: