(28.12.2019, 15:00)Auzzii Wrote: Hello,
what is best way to make virtual object for time input for scada. I need it to be 08:00 instead of 8:0 (image in attachment)
Tnx,
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,
}
-- write to bus
grp.write('9/0/8', time, dt.time)
grp.write('9/0/9', date, dt.date)