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.

DMX Speed
#1
Hi,

I´m working with DMX lighting of a bridge and I have some problems with the final solution.

They want to do some animations with lights and speedo of DMX not work fine, I don´t know if the problem is Logic Machine Script or DMX lights.

An example:

I have 52 RGBW lights and I want to write  a color individually in each light. 


Code:
for i = 1, 52, 1 do
    grp.update(dir[i], color)
    os.sleep(time)
end

It i put 1 in time, it work perfectly, but with 500ms, it write in 2 lights at once,with 250ms, it write in 4 lights at once.... 
I think there is a limitation in the communication of 1 second.

Default params:
Code:
local defaults = {
  -- storage key
  skey = 'dmx_line_1',
  -- RS-485 port
  port = '/dev/RS485-2',
  -- number of calls per second
  resolution = 20,    -- default 20
  -- total number of channels to use
  channels = 256,
  -- transition time in seconds, does not include DMX transfer time
  transition = 1,
}

I tried to change resolution in params to 200 but doesn´t work, it works worse.

Any ideas?

Thanks!
Reply
#2
The library reads values once a second. If you want some custom animation you should use the DMX library directly without using groups in between.
Reply
#3
(04.02.2022, 10:14)admin Wrote: The library reads values once a second. If you want some custom animation you should use the DMX library directly without using groups in between.
 
Could you give an example?
Reply
#4
https://openrb.com/example-dmx-lighting-...-with-lm2/
------------------------------
Ctrl+F5
Reply
#5
(13.11.2023, 15:48)Daniel Wrote: https://openrb.com/example-dmx-lighting-...-with-lm2/

In this example, changes occur once per second, I need it faster.
How can I implement this?
Reply
#6
You need to use low-level library functions. Resident script example for 2 channels:
Code:
dmx = require('luadmx').open('/dev/RS485-1')
dmx:setcount(2)

function send(val)
  dmx:setchannel(1, val)
  dmx:setchannel(2, 255 - val)

  dmx:send()

  os.sleep(0.1)
end

while true do
  for val = 0, 255, 5 do
    send(val)
  end

  for val = 250, 5, -5 do
    send(val)
  end
end
Reply


Forum Jump: