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.

toggling an object
#1
Hi,

Is there an direct way to add visualize a pulse object.  lets take an gate contact as an example,  when a pulse ( 1 and then 0 ) is given on the object the gate will open or close.  Typically with a light in the visu, the switch\button goes on,  stays on and turns off when you press it again.  With an pulse object it will go off about 0.5 from turning on.

I guess the only way this would be achieved is an event script on the pulse object.  something like.

Code:
if event.type == 'groupwrite' then
  obj = grp.find(event.dst)
  if obj and obj.decoded then  
    if obj.value == true then
      os.sleep(0.5)
      grp.write(event.dst, false, obj.datatype)
    end
  end
end

Thanks,

Roger
Reply


Forum Jump: