Logic Machine Forum
DMX with LM4 - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: DMX with LM4 (/showthread.php?tid=234)



DMX with LM4 - s.prathmesh - 29.02.2016

http://openrb.com/example-dmx-lighting-control-with-lm2/

According to the link, I added a script in user libraries along with DMX handler script in resident script and also created an event script to mark DMX objects. But, when I trigger KNX group addresses as specified in DMX mark scripts none of DMX channels are triggering.
What am I missing in the setup?
DMX ballasts are connected to first RS485 port of LM4.


RE: DMX with LM4 - edgars - 29.02.2016

Did you specify a correct RS485 port name in the handler script? In your case it should be '/dev/RS485-1'


RE: DMX with LM4 - s.prathmesh - 29.02.2016

Okay.
What are the group addresses to be triggered?
I've created multiple objects with DMX tags and KNX group addresses 1-byte scaling (like 3/1/1, 3/1/2, etc.) in Objects tab; with last part of KNX group address as DMX channel nos.
So, where in the scripts the KNX main group address and KNX middle group address ought to be specified in order to get triggered in KNX bus?


RE: DMX with LM4 - edgars - 01.03.2016

you need to add Event-based script and specify DMX (if it is the name you have tagged DMX objects) as group address /tag.
Then you can add the following script which will update all marked DMX group addresses with the value you set from visualization or other script:

Code:
require('user.dmx')
-- get ID as group address last part (x/y/ID)
id = tonumber(event.dst:split('/')[3])
-- get event value (1 byte scaling)
value = event.getvalue()
-- convert from [0..100] to [0..255]
value = math.floor(value * 2.55)
-- set channel ID value
DMX.set(id, value)