5. Software Control - Lightware Device Controller
RAP-B511 series
– User's Manual
45
Applied firmware package: v1.1.0b3b3 | LDC software: v2.5.1b5
5.5.6.
Variables
A brand new area is opened by implementing the variables. You can create custom variables in number
or text format which can be used in the Event Manager. The variables can have the following properties/
methods:
#variables #new
▪
Numeric (integer) type with min/max value setting, or string-type (determined automatically)
▪
Increment/step the numeric value,
▪
Value-dependent case operations,
▪
Reading and storing the values of LW3 properties into string or numeric variables.
▪
The max length of a string variable can be 15 characters. Numeric variable is defined between
-2147483648 and 2147483647.
The defined variables are stored in a non-volatile memory and the value is kept in case of a reboot.
Variables tab in the Control menu
Value Section
You can set the value of the variable by the field. The type of the variable is determined automatically based
on its value (numeric/string).
Add / Cycle Section
This section can be used for numeric types.
▪
Operand
: the increment, the number that will be added to the current value (negative value is accepted).
▪
Min (optional)
: the lowest allowed value.
▪
Max (optional)
: the highest allowed value.
▪
Add
button: the operand will be added to the current value. If the result would be higher than the max
setting, the max will be valid; if the result would be lower than the min setting, the min will be valid.
▪
Cycle
button: the operand will be added to the current value. If the result would be beyond the limit
(min/max
), the value will be stepped to the other end of the interval.
Examples
The following shows the difference between the
Add
and the
Cycle
options. The input values are the same in
both cases:
▪
Min
: 1
▪
Max
: 5
▪
Operand
: 1
In
Add
case: when the value hits the limit (max), the operand will not increase the value any more.
In
Cycle
case: when the value hits the limit (max), the value will be stepped to the other end of the interval.
Similar case happens vice versa: when the operand is a negative number and the value hits the min value.
TIPS AND TRICKS:
Set min=1, max=2, operand=1 and use the
cycle
method. Thus, the value of the variable
can be toggled which can be linked to a property with two states (e.g. low/high level) in Event manager.
Case Convert
This tool can be used to change the value of a variable if it fits in any of the defined intervals. The check
and the change will be performed only if you press the
Convert
button. A typical example when two different
ranges of values have to meet:
Incoming values:
between 0 and 255 (e.g. the slider of a controller can have these values).
Outgoing values:
between 0 and 100 (e.g. the controlled device accepts these values).
Defined cases:
1
2
3
4
5
5
5
Add
Add
Add
Add
Add
Add
1
Cycle
2
Cycle
3
Cycle
4
Cycle
5
Cycle
Min
Max
New value
Min
Max
New value
Case 1
1
25
10
Case 6
126
150
60
Case 2
26
50
20
Case 7
151
175
70
Case 3
51
75
30
Case 8
176
200
80
Case 4
76
100
40
Case 9
201
225
90
Case 5
101
125
50
Case 10
226
255
100