7.LW3Programmer'sReference
HDMI-TPS-TX200series–User'sManual
104
Appliedfirmwarepackage:v1.3.2b3 | LDCsoftware:v2.5.7b2
7.10.5.
Scan and Store
Thiscommandcanbeusedtogetthevalue(orapartofthevalue)ofanLW3property.Thedefinedpathwill
bescannedaccordingtothepatternandtheresultwillbethevalueofthevariable(numberorstringtype).
Command and Response
ç
CALL·/CTRL/VARS/V
<loc>
:scanf(
<path>
.
<property>
;
<pattern>
)
æ
mO·/CTRL/VARS/V
<loc>
:scanf
Parameters
Parameter
Parameterdescription
Value
<loc>
The location of the variable
1-30
<path>
.
<property>
TheLW3propertywithnode
<pattern>
The pattern that scans the property for the desired result
see below
Pattern options
Pattern
Patterndescription
%s
Stringofcharactersstoppingatthefirstwhitespacecharacter
%
<number>
s
Thenext<number>ofcharacters(string)stoppingatthefirstwhitespace
%c
One character
%
<number>
c
Thenext<number>ofcharacters
%[
<characters>
]
Definedcharacterset,specifiedbetweenbrackets
%[^
<characters>
] Negatedcharacterset,specifiedbetweenbracketswhichwillbeskipped
%*
Ignoredpart
<custom_text>
User-definedtext
Thepatternscanbecombinedtogetthedesiredresultasshownintheexamples.
ATTENTION!
Donotforgettoescapethe%characterasshowninbelowexample.
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
Asimplepatternhasbeenapplied:weneedthefirstfivecharactersfromthepropertyvalue.
Further Examples
<path>.<property>
PropertyValue
<pattern>
Scannedresult
/MANAGEMENT/STATUS.CpuTemperature 42C;0;75;0;7
%s
42
/MANAGEMENT/STATUS.CpuFirmware
1.3.0b3r32
%12s
1.3.0b3
/MEDIA/VIDEO/XP.DestinationPortStatus
T00AA;T00AF
%6c
T00AA
/MEDIA/UART/P1.Rs232Configuration
57600,8N1
%*[^,],%s
8N1
/MEDIA/AUDIO/XP.SourcePortStatus
T000A;T000B;T000F
%*6c%5c
T000B
/MANAGEMENT/NETWORK.HostName
lightware-00005031
lightware-%[0-9] 00005031
7.10.6.
Reformatting a Value
Thevalueofthevariablecanbechangedbyaddingtextasprefixand/orpostfix.
ATTENTION!
Thinkaboutthelengthofthevalue:15charactersareallowed,theothersaretruncated.
Command and Response
ç
CALL·/CTRL/VARS/V
<loc>
:printf(
<prefix>
%s
<postfix>
)
æ
mO·/CTRL/VARS/V
<loc>
:printf
Parameters
Parameter
Parameterdescription
Value Valuedescription
<loc>
The location of the variable
1-30
<prefix>
Thetextbeforetheoriginalvalueoftheproperty(optional)
Custom
ASCIIcharacters
%s
Theoriginalvalueofthevariable
<postfix>
Thetextfollowingtheoriginalvalueoftheproperty(optional)
Custom
ASCIIcharacters
Example
ç
GET/CTRL/VARS/V1.Value
ç
pw/CTRL/VARS/V1.Value=01
ç
CALL/CTRL/VARS/V1:printf(PWR%s)
æ
mO/CTRL/VARS/V1:printf
ç
GET/CTRL/VARS/V1.Value
æ
pw/CTRL/VARS/V1.Value=PWR01
The'PWR'stringhasbeeninsertedbeforetheoriginalvalue.