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.

On time delay
#6
That's what the script is already doing, except that it expects at least one telegram from setpoint or feedback object in 30 minutes. You can set poll interval for one of these objects to ensure that timer is updated via event script. grp.checkwrite ensures that only new value is sent to the bus.

Or you can use a single resident script (set sleep interval to at least 5 seconds or more) without event scripts. This way some status feedback can be missed, but I don't think that it will make much difference.
Code:
setpoint = grp.getvalue('1/1/1')
feedback = grp.getvalue('1/1/2')
value = setpoint * feedback / 100

if value <= 10 then
  timer = nil

  if out then
    out = false
    grp.write('14/2/1', false)
  end
else
  if timer then
    delta = os.time() - timer

    if delta >= 1800 and not out then
      out = true
      grp.write('14/2/1', true)
    end
  else
    timer = os.time()
  end
end
Reply


Messages In This Thread
On time delay - by Frankg - 05.10.2017, 13:13
RE: On time delay - by admin - 05.10.2017, 13:30
RE: On time delay - by Frankg - 05.10.2017, 18:35
RE: On time delay - by admin - 06.10.2017, 07:59
RE: On time delay - by Frankg - 06.10.2017, 08:08
RE: On time delay - by admin - 06.10.2017, 08:41

Forum Jump: