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.

Data/time question
#1
Hi, 

I'm having an issue with getting datetime. I used a script from the Logicmachine site:

Code:
-- get current date as table now = os.date('*t') -- write to bus grp.write('0/0/2', now, dt.date) grp.write('0/0/1', now, dt.time) -- system week day starts from sunday, convert it to knx format wday = now.wday == 1 and 7 or now.wday - 1 --- full date bits 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 -- write to bus date_time = string.char(OCT08, OCT07, OCT06, OCT05, OCT04, OCT03, OCT02, OCT01) grp.write('0/0/3', date_time)

Date and time works (0/0/2 and 0/0/1) but 0/0/3 gives no output.

What am I doing wrong? Smile

Attached Files Thumbnail(s)
       
Reply


Messages In This Thread
Data/time question - by mrKayne - Yesterday, 05:43
RE: Data/time question - by admin - Yesterday, 06:28
RE: Data/time question - by mrKayne - Yesterday, 09:08

Forum Jump: