Skip to content

GetDMXUniverse

Anthony Headley edited this page Apr 24, 2020 · 1 revision

GetDMXUniverse(int:universe, [bool:percent_mode]) : table

Brief:

Returns a table of DMX channels for the given Universe in ether raw (default) or percent

Paramiters:

Name Type Description Optional
universe int Universe to query
percent_mode bool Either return raw (0-255) or percent (0-100) values. defaults to raw if omitted

Returns:

Type Description
table Returns an array of DMX channels in the selected universe
nil Also enters "Universe not granted" in the SystemMonitor if there is no license for that universe.

Examples:

local data = GetDMXUniverse(1)

if data == nil then
    Echo("No Universe, Exitting.")
    return
end

-- build a 16 x 16 grid of all channels in the universe
for i = 1, 512 , 16 do
    local string = ""
    for j = 0, 15, 1 do
        if j > 0 then
            -- if this is the second or greater append a ","
            string = string .. ","
        end
        --print out a row
        string = string.format("%s%03d", string, data[i+j])
    end
    Echo("%03d: %s", i, string)
end

-- Dimmers 1 thru 16 at 0 thru full
-- 001: 000,017,034,051,068,085,102,119,136,153,170,187,204,221,238,225
-- 016: ...
Clone this wiki locally