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.

Strange script behaviour
#1
Hi,

I have a resident script that is set to update 3 objects (date, time and datetime) but it also updates two other objects (sunrise time and sunset time) althougt there is no command on the script.
Can someone pinpoint why this happens?

DateTime Update resident script (runs every 60sec)
Code:
-- get current data as table
now = os.date('*t')

-- system week day starts from sunday, convert it to knx format
wday = now.wday == 1 and 7 or now.wday - 1

-- time table
time = {
day = wday,
hour = now.hour,
minute = now.min,
second = now.sec,
}

-- date table
date = {
day = now.day,
month = now.month,
year = now.year,
}

--- 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) .. string.char(OCT07) .. string.char(OCT06) .. string.char(OCT05) .. string.char(OCT04) .. string.char(OCT03)  .. string.char(OCT02)  .. string.char(OCT01)
grp.checkwrite('0/1/1', date, dt.date)
grp.checkwrite('0/1/2', time, dt.time)
grp.checkwrite('0/1/3', date_time, dt.string)
  
   
Reply


Messages In This Thread
Strange script behaviour - by gtsamis - 11.06.2022, 08:36
RE: Strange script behaviour - by Dré - 12.06.2022, 10:16
RE: Strange script behaviour - by gtsamis - 26.06.2022, 15:13
RE: Strange script behaviour - by Dré - 26.06.2022, 15:40
RE: Strange script behaviour - by gtsamis - 26.06.2022, 15:56
RE: Strange script behaviour - by Dré - 26.06.2022, 15:57
RE: Strange script behaviour - by gtsamis - 26.06.2022, 16:09
RE: Strange script behaviour - by admin - 27.06.2022, 06:25
RE: Strange script behaviour - by gtsamis - 27.06.2022, 07:02

Forum Jump: