beautypg.com

Interpreting data from a wind direction sensor – ETC Unison Mosaic Designer v1.11.0 User Manual

Page 222

background image

Unison Mosaic Designer User Manual

Inverting a DMX input before it is used with a Set Intensity action

A client's existing DMX control system is connected to the Controller's DMX Input. Channel 12 controls the
houselights and they want the intensity of our LED installation to increase as the houselights go to black out and
to decrease as the houselights come on to full.

We can configure a DMX Input trigger so that it fires any time the value of channel 12 changes. As a side effect
the DMX Input trigger will always capture the value of the channel it is watching as a trigger variable. If the client
wanted the intensity of the LEDs to vary with the houselights we could put a Set Intensity action directly onto this
trigger and take the level from the input. However the client wants an inverse relationship - so instead we will put
a simple script in between to invert the value.

The DMX input trigger will run the following script:

-- get the value of the DMX channel from variable

chan = variable[1]

-- invert it

chan = 255 - chan

-- now pass it to a second trigger

inject_trigger(2,chan)

Trigger 2 can be a soft trigger, but its action should be Set Intensity taking a level from the input. The inject_
trigger

function allows us to pass additional arguments (after the trigger number) that will be available to the

action as trigger variables.

Interpreting data from a wind direction sensor

A Controller is controlling an LED façade on all four sides of a tower block. A wind direction sensor is connected
to the Controller via RS232. Every second it sends the character 'X' then a 3 digit number to the Controller which
is the wind direction in degrees. The client wants the windward side of the building to always be red, the leeward
side to be blue and the other two sides to be green.

We'll create four timelines that correspond to the correct lighting for the wind on each face of the building. We
then need an RS232 input trigger that matches the three digit decimal number as a wildcard so that it will be
stored as a trigger variable. (The wildcard for this would be X<3d> - for more information on this refer to the
manual.) Whenever the RS232 input trigger makes a successful match it will run the following script:

-- get the value in degrees

dir = variable[1]

-- which face is getting the wind?

if dir < 90 then

start_timeline(1)

elseif dir < 180 then

start_timeline(2)

elseif dir < 270 then

start_timeline(3)

else

start_timeline(4)

end

- 222 -