7. LW3 Programmers’ Reference
UMX-HDMI-140 series– User's Manual
104
Applied firmware package: v1.3.0b5 | LDC software: v2.5.6b2
7.10.4.
Value Change with Intervals (Case)
This command can be used to change the value of a variable if it fits in any of the defined intervals.
Command and Response
ç
CALL·/CTRL/VARS/V
<loc>
:case(
<min> <max> <val>
;)
æ
mO·/CTRL/VARS/V
<loc>
:case
Parameters
Parameter
Parameter description
Value
<loc>
The location of the variable
1-30
<min>
The lowest value of the interval
Integer
<max>
The highest value of the interval
Integer
<val>
The new value that will be valid if the current value is in the interval
Integer
The parameters are divided by a space character, and the interval groups are divided by semicolon. Up to 16
cases can be defined.
Examples
ç
CALL /CTRL/VARS/V1:case(10 20 15)
æ
mO /CTRL/VARS/V1:case
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:
The command looks like:
ç
CALL /CTRL/VARS/V1:case(1 25 10;26 50 20;51 75 30;76 100 40;101 125 50;126 150 60;151 175 70;
176 200 80; 201 225 90; 226 255 100)
æ
mO /CTRL/VARS/V1:case
Min
Max
New value
Case 1
1
25
10
Case 2
26
50
20
Case 3
51
75
30
Case 4
76
100
40
Case 5
101
125
50
Case 6
126
150
60
Case 7
151
175
70
Case 8
176
200
80
Case 9
201
225
90
Case 10
226
255
100
7.10.5.
Scan and Store
This command can be used to get the value (or a part of the value) of an LW3 property. The defined path will
be scanned according to the pattern and the result will be the value of the variable (number or string type).
Command and Response
ç
CALL·/CTRL/VARS/V
<loc>
:scanf(
<path>
.
<property>
;
<pattern>
)
æ
mO·/CTRL/VARS/V
<loc>
:scanf
Parameters
Parameter
Parameter description
Value
<loc>
The location of the variable
1-30
<path>
.
<property>
The LW3 property with node
<pattern>
The pattern that scans the property for the desired result
see below
Pattern options
Pattern
Pattern description
%s
String of characters stopping at the first whitespace character
%
<number>
s
The next <number> of characters (string) stopping at the first whitespace
%c
One character
%
<number>
c
The next <number> of characters
%[
<characters>
]
Defined character set, specified between brackets
%[^
<characters>
]
Negated character set, specified between brackets which will be skipped
%*
Ignored part
<custom_text>
User-defined text
The patterns can be combined to get the desired result as shown in the examples.
ATTENTION!
Do not forget to escape the % character as shown in below example.
Examples
ç
CALL /CTRL/VARS/V1:scanf(/MEDIA/AUDIO/XP.SourcePortStatus;\%5c)
æ
mO /CTRL/VARS/V1:scanf
ç
GET /CTRL/VARS/V1.Value
æ
pw /CTRL/VARS/V1.Value=T00AA
A simple pattern has been applied: we need the first five characters from the property value.