21.09.2021, 10:09
Hi, I want to create a script per tag for multiple objects. It is to generate an alert when the input value is true for at least 60 sec. This way I avoid false alarms.
When the value of the object is true, it waits for 60 seconds and rechecks the state of the object, but that doesn't work for me. Surely it can be done in another way ...
When the value of the object is true, it waits for 60 seconds and rechecks the state of the object, but that doesn't work for me. Surely it can be done in another way ...
Code:
ID = event.getvalue()
value = grp.find(event.dst).value
if ID then
os.sleep(20)
if value then
grp.write('1/1/2',true)
else
grp.write('1/1/2',false)
end
end