14.11.2020, 07:17
(This post was last modified: 14.11.2020, 07:18 by phongvucba.)
Hi every one !
I am using version 20200720, but the Delay dim or get the status functions are not working? Is it faulty ?, my old version runs ok!
------Delay dim----
require('user.dali')
dalicmd('internal', 'setdtr', { addrtype = 'broadcast' ,value = 7 })--Lưu giá trị 7 vào thanh ghi DTR
dalicmd('internal', 'storefadetime', { addrtype = 'broadcast' })--Lấy giá trị 7 đó ở thanh ghi để cho vào thời gian dimmer
----------update status for addr------
require('user.dali')
function queryactual(short, addr)
local res, err = dalicmd('internal', 'queryactual', { addrtype = 'short', address = short })
if res then
local val = res:byte()
if val > 0 then
val = math.floor(val / 2.54 + 0.5)
val = math.max(1, val)
end
grp.checkupdate(addr, val)
end
end
queryactual(0, '2/7/101')
------------------------------
Please help me!
I am using version 20200720, but the Delay dim or get the status functions are not working? Is it faulty ?, my old version runs ok!
------Delay dim----
require('user.dali')
dalicmd('internal', 'setdtr', { addrtype = 'broadcast' ,value = 7 })--Lưu giá trị 7 vào thanh ghi DTR
dalicmd('internal', 'storefadetime', { addrtype = 'broadcast' })--Lấy giá trị 7 đó ở thanh ghi để cho vào thời gian dimmer
----------update status for addr------
require('user.dali')
function queryactual(short, addr)
local res, err = dalicmd('internal', 'queryactual', { addrtype = 'short', address = short })
if res then
local val = res:byte()
if val > 0 then
val = math.floor(val / 2.54 + 0.5)
val = math.max(1, val)
end
grp.checkupdate(addr, val)
end
end
queryactual(0, '2/7/101')
------------------------------
Please help me!