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.

Time in scada 08:00
#3
(28.12.2019, 19:08)Tokatubs Wrote:
(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)
Post as resident script. Then modify adresses as you choose. Then time is 10. 3 byte and date is 11. 3 byte.

Hi, i have no problem with script.
But user input in scada. In one fild user want input hours from 00 to 24 and in other minutes 00 to 60.

Tnx
Reply


Messages In This Thread
Time in scada 08:00 - by Auzzii - 28.12.2019, 15:00
RE: Time in scada 08:00 - by Tokatubs - 28.12.2019, 19:08
RE: Time in scada 08:00 - by Auzzii - 30.12.2019, 14:04
RE: Time in scada 08:00 - by Auzzii - 02.01.2020, 15:43

Forum Jump: