Ask our Experts
Didn't find what you are looking for? Ask our experts!
Schneider Electric SpaceLogic KNX forum to get support and share knowledge including selection, installation and troubleshooting for spaceLYnk, Wiser for KNX, eConfigure KNX, SpaceLogic KNX Hybrid module and other topics.
Search in
Link copied. Please paste this link to share this article on your social media post.
-- script updated every 28 seconds
count={}
count=storage.get('sto01',0)
--initialize variables
if not count.minutos then count.minutos=0 end
if not count.horas then count.horas=0 end
if not count.horasEIS5 then count.horas=0 end
if not count.h_m then count.h_m=0 end
if not count.dias then count.dias=0 end
if not count.meses then count.meses=0 end
if not count.anys then count.anys=0 end
--enable this to watch values
--log (count)
--system date
hora = tonumber (os.date('%H'))
minut = tonumber (os.date('%M'))
hora_minuto_1=(hora*100)+minut
if (hora_minuto_1 == count.h_m) then
else
count.h_m=(hora*100)+minut
count.minutos=count.minutos +1
--GOING bus / minute
--counted minutes 1 byte EIS6
grp.write('10/0/5', count.minutos, dt.uint8)
--counted hours 1 byte EIS6
-- grp.write('10/0/3',math.min(255,count.horas), dt.uint8)
--counted hours 2 byte EIS5 no reset
-- grp.write('10/0/4',count.horasEIS5, dt.float16)
--counted days 1 byte EIS6
-- grp.write('10/0/6',math.min(69,count.dias), dt.uint8)
--counted month 1 byte EIS6
-- grp.write('10/0/7',math.min(69,count.meses), dt.uint8)
--counted years 1 byte EIS6
-- grp.write('10/0/8',math.min(69,count.anys), dt.uint8)
end
if ( count.minutos > 59 ) then
count.horas=count.horas + 1
count.horasEIS5=count.horasEIS5 + 1
count.minutos=0
if ( count.horas > 23 ) then
count.dias=count.dias + 1
count.horas=0
end
if ( count.dias > 30 ) then
count.meses=count.meses + 1
count.dias=0
end
if ( count.meses > 12 ) then
count.anys=count.anys + 1
count.meses=0
end
--going bus / hour
grp.write('10/0/5', count.minutos, dt.uint8)
grp.write('10/0/3',math.min(255,count.horas), dt.uint8)
grp.write('10/0/4',count.horasEIS5, dt.float16)
grp.write('10/0/6',math.min(69,count.dias), dt.uint8)
grp.write('10/0/7',math.min(69,count.meses), dt.uint8)
grp.write('10/0/8',math.min(69,count.anys), dt.uint8)
end
-- set storage variable myobjectdata to a specified value (e.g. 127)
storage.set('sto01',count)
You’ve reached the end of your document
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.