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.

alert script
#1
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 ...



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
Reply
#2
You need to call grp.find (or grp.getvalue) after the os.sleep not before it.
Reply


Forum Jump: