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.

Dali Light secuence
#2
Hi Josep,

Try this in a resident script, interval time doesn't matter.

Code:
outputaddress = '1/1/1' -- byte object

-- set step values
value1 = 20
value2 = 40
value3 = 60
value4 = 80
value5 = 100

-- set init value
value = value1

-- set delay
delaytime = 10

-- loop always
while true do
 -- check if value 1 needs to be written
 if value == value1 then
   value = value2
   grp.write(outputaddress, value1)
 -- check if value 2 needs to be written
 elseif value == value2 then
   value = value3
   grp.write(outputaddress, value2)
 -- check if value 3 needs to be written
 elseif value == value3 then
   value = value4
   grp.write(outputaddress, value3)
 -- check if value 4 needs to be written
 elseif value == value4 then
   value = value5
   grp.write(outputaddress, value4)
 -- check if value 5 needs to be written
 elseif value == value5 then
   value = value1
   grp.write(outputaddress, value5)
 -- fallback when value not valid
 else
   value = value1
 end
 -- delay loop
 os.sleep(delaytime)
end

When changing one of the declared values you need to restart the script.

If you reboot LM the sequense starts automaticly again as long as your resident script is having the active state.

BR,

Erwin
Reply


Messages In This Thread
Dali Light secuence - by josep - 06.02.2017, 18:40
RE: Dali Light secuence - by Erwin van der Zwart - 06.02.2017, 19:10
RE: Dali Light secuence - by josep - 06.02.2017, 19:25

Forum Jump: