12.04.2021, 08:25
Create a virtual object with the same data type as the object you want to log. Then attach an event script to the source object that will write the real value between 7:00 and 19:59, and 0 otherwise. Trend log must be attached to the virtual object.
Event script, change virtual object address (32/1/1) as needed:
Event script, change virtual object address (32/1/1) as needed:
Code:
hour = os.date('*t').hour
if hour >= 7 and hour < 20 then
value = event.getvalue()
else
value = 0
end
grp.checkupdate('32/1/1', value)