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 whether you accept or reject these cookies being set.

Time in scada 08:00
#1
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,

Attached Files Image(s)
   
Reply
#2
(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.
Reply
#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
#4
Ja Hi,

Just use the object type 10 (3 byte time/day) that is designed for this type of input, if you don’t want the day input you can hide it with css.

I would do this kind of input for heating mode in another way, create a schedule button and a widget with the iframe to a scheduler that controls the heating mode, this way you can make several switching times instread of the 2 static (from-to) times you now have designed in the visu. Use custom values to set the comfort/standby/night modes as text instead of 1,2,3 etc.

The scheduler can control the heating mode directly without the need of any scripting (:

BR,

Erwin
Reply
#5
(31.12.2019, 08:25)Erwin van der Zwart Wrote: Ja Hi,

Just use the object type 10 (3 byte time/day) that is designed for this type of input, if you don’t want the day input you can hide it with css.

I would do this kind of input for heating mode in another way, create a schedule button and a widget with the iframe to a scheduler that controls the heating mode, this way you can make several switching times instread of the 2 static (from-to) times you now have designed in the visu. Use custom values to set the comfort/standby/night modes as text instead of 1,2,3 etc.

The scheduler can control the heating mode directly without the need of any scripting (:

BR,

Erwin

Hi,

The problem is that i have settings in widget.

I can no call widget from widget.

Attached Files Image(s)
   
Reply
#6
Hi,

You don’t need 2 widgets, all actions on your current widget are related to from-to times for comfort, standby mode etcetera, all you need is a scheduler to do that.

So the current widget must only hold the frame to the scheduler and there you set the from-to times for each mode. Your current widget layout can be dropped.

With CSS you could even match the colors of the scheduler page to the same colors as used in the visu.

BR,

Erwin
Reply


Forum Jump: