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.

Scene trigger diffrent values
#2
Hi,

You don't need a script to do that, just use the scene module that is default in the controller.

With script you can use this: (add as event based script to the scene object)
Code:
scenevalue = event.getvalue()
if scenevalue == 1 then
  grp.write('1/1/1', 10)
  grp.write('1/1/2', true) -- binary
  grp.write('1/1/3', 30)
  os.sleep(2) -- delay if needed
  grp.write('1/1/3', 40)
elseif scenevalue == 2 then
  grp.write('1/1/1', 50)
  grp.write('1/1/2', false) -- binary
  grp.write('1/1/3', 70)
  os.sleep(1) -- delay if needed
  grp.write('1/1/3', 80)
end
For binary object:  (add as event based script to the binary object)
Code:
bitvalue = event.getvalue()
if bitvalue == true then
  grp.write('1/1/1', 10)
  grp.write('1/1/2', true) -- binary
  grp.write('1/1/3', 30)
  os.sleep(2) -- delay if needed
  grp.write('1/1/3', 40)
else
  grp.write('1/1/1', 50)
  grp.write('1/1/2', false) -- binary
  grp.write('1/1/3', 70)
  os.sleep(1) -- delay if needed
  grp.write('1/1/3', 80)
end
BR,

Erwin
Reply


Messages In This Thread
Scene trigger diffrent values - by benthoma - 08.06.2018, 18:12
RE: Scene trigger diffrent values - by Erwin van der Zwart - 08.06.2018, 20:44
RE: Scene trigger diffrent values - by Daniel - 11.06.2018, 11:28
RE: Scene trigger diffrent values - by admin - 05.02.2020, 13:31

Forum Jump: