Contatto
MCP 4 – User's manual
DUEMMEGI
The following script shows how is possible to implement quite complex functions. The following SCRIPT
implements a single channel Dynamic Light system , that is a light game obtained by a dimmer output module
(e.g. MOD2DM). The dynamic light game shown in the following graph has to be implemented (the
percentage of brightness is on the vertical axis and the time, in seconds, on the horizontal axis); after 60
seconds, the cycle will be repeated from the beginning.
0
10
20
30
40
50
60
70
80
90
100
10
20
30
40
50
60
5
15
25
35
45
55
53
The SCRIPT will be executed one time per second. First of all, the script declares one local variable (Step)
and 2 parameters (two times A01, the reason of this double definition will be explained in the following).
The variable Step represents the amount of seconds elapsed from the beginning of the dynamic light game.
At the output from the script, the value of Step will be increased by 1; if the result of this increment is >=60,
then Step will be re-initialized to zero.
When the Step value equals one of the moments when the light brightness must be changed, the two
instructions
RAMP1=K
and
PERC1=Z
will be executed; the effect of this instructions (that are identical to
A01=K and A01=Z) is to transfer to the output A01 the specified values, in the same order they were written.
The first value to send to output will be the ramp value, the second one will be the wanted percentage. The
use of two different definition for the same output (A01) is only to make the script more readable and intuitive.
For the correspondence between the code and the ramp value, see the MOD2DM technical sheet.
SCRIPT
1
TRIGGER
=1
var
Step
define
RAMP1
AO1
define
PERC1
AO1
IF
Step==0
THEN
; RAMP1=150; PERC1=100;
ENDIF
IF
Step==15
THEN
; RAMP1=160; PERC1=50 ;
ENDIF
IF
Step==30
THEN
; RAMP1=150; PERC1=0 ;
ENDIF
IF
Step==40
THEN
; RAMP1=145; PERC1=80 ;
ENDIF
IF
Step==50
THEN
; RAMP1=140; PERC1=0 ;
ENDIF
IF
Step==53
THEN
; RAMP1=140; PERC1=50 ;
ENDIF
IF
Step==55
THEN
; RAMP1=150; PERC1=0 ;
ENDIF
Step = Step+1
IF
Step>=60
THEN
; Step=0;
ENDIF
ENDSCRIPT
Of course, other dimmer outputs may be inserted in the same script, in order to realize a multi-channel
dynamic light game.
Page 36 of 87
Rel.: 1.2 October 2018
DUEMMEGI
s.r.l. - Via Longhena, 4 – 20139 MILANO
Tel. 02/57300377 - Fax 02/55213686 –
www.duemmegi.it