Logic Machine Forum
Time in scada 08:00 - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: Time in scada 08:00 (/showthread.php?tid=2402)



Time in scada 08:00 - Auzzii - 28.12.2019

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,


RE: Time in scada 08:00 - Tokatubs - 28.12.2019

(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.


RE: Time in scada 08:00 - Auzzii - 30.12.2019

(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


RE: Time in scada 08:00 - Erwin van der Zwart - 31.12.2019

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


RE: Time in scada 08:00 - Auzzii - 02.01.2020

(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.


RE: Time in scada 08:00 - Erwin van der Zwart - 02.01.2020

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