(26.11.2015, 07:13)admin Wrote: Try this with RAW 4-byte profile (first, not the split one), though I'm not sure about contents of byte 0, try setting it to 0x0A if it does not work.
Code:-- dimming
b3 = 0x02
-- dimmer value [0..100]
b2 = event.getvalue()
-- ramp time in seconds
b1 = 1
-- data telegram, absolute value, store final
b0 = 0x0A
res = bit.bor(
bit.lshift(b3, 24),
bit.lshift(b2, 16),
bit.lshift(b1, 8),
b0
)
grp.write('1/1/1', res, dt.uint32)
Added this as event-based script to the object but I get this error:
event-Event for 1/1/3 26.11.2015 21:40:29
Line 11: attempt to index global ' bit' (a nil value)
Am I doing something wrong?
Writing it like this seem to make the error go away:
Code:
-- dimming
b3 = 0x02
-- dimmer value [0..100]
b2 = event.getvalue()
-- ramp time in seconds
b1 = 1
-- data telegram, absolute value, store final
b0 = 0x0A
a3 = bit.lshift(b3, 24)
a2 = bit.lshift(b2, 16)
a1 = bit.lshift(b1, 8)
res = bit.bor(a3,a2,a1,b0)
grp.write('1/1/5', res, dt.uint32)
Thanks for the help so far!