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.

Scripts two pumps alternate
#6
Try modifying the event scripts like this:
Code:
stop_1 = event.getvalue()
stop_2 = grp.getvalue('5/0/20')

on_1 = grp.getvalue('5/0/1') and not stop_1
on_2 = grp.getvalue('5/0/2') and not stop_2

-- switch to the second pump
if stop_1 then
  if not stop_2 and not on_2 then
    grp.write('5/0/1', false)
    grp.write('5/0/2', true)

    storage.set('pump_time', 0)
  end
-- fault is removed and no pump is running
elseif not on_1 and not on_2 then
  grp.write('5/0/1', true)

  storage.set('pump_time', 0)
end

Code:
stop_1 = grp.getvalue('5/0/10')
stop_2 = event.getvalue()

on_1 = grp.getvalue('5/0/1') and not stop_1
on_2 = grp.getvalue('5/0/2') and not stop_2

-- switch to the first pump if it's not in a fault state
if stop_2 then
  if not stop_1 and not on_1 then
    grp.write('5/0/2', false)
    grp.write('5/0/1', true)

    storage.set('pump_time', 0)
  end
-- fault is removed and no pump is running
elseif not on_1 and not on_2 then
  grp.write('5/0/2', true)

  storage.set('pump_time', 0)
end
Reply


Messages In This Thread
Scripts two pumps alternate - by streilkx - 29.07.2021, 13:37
RE: Scripts two pumps alternate - by admin - 29.07.2021, 13:47
RE: Scripts two pumps alternate - by streilkx - 30.07.2021, 08:11
RE: Scripts two pumps alternate - by admin - 04.08.2021, 06:25
RE: Scripts two pumps alternate - by streilkx - 06.08.2021, 11:25
RE: Scripts two pumps alternate - by admin - 06.08.2021, 11:39
RE: Scripts two pumps alternate - by streilkx - 16.08.2021, 15:47
RE: Scripts two pumps alternate - by admin - 18.08.2021, 06:57

Forum Jump: