7.LW3Programmer'sReference
HDMI-TPS-TX200series–User'sManual
110
Appliedfirmwarepackage:v1.3.2b3 | LDCsoftware:v2.5.7b2
7.15.
TCP Message Recognizer
DIFFERENCE:
ThefeaturesandcommandsbelowareavailableonlyforSW4-TPS-TX240-PlusfromFW
packagev1.3.0b6.
This tool can be used to recognize messages coming from a TCP server. You can link an immediate
eventActionthatisrunwhenamessageisrecognized,butyoucanalsouseitinEventmanager.
#tcprecognizer #message
Preparation
Step 1.
SetaTCPclientintheLightwaredevice(threeTCPclientscanberunatthesametime),setthe
propertiesofthetargetTCPserver.
Step 2.
Setthe
DelimiterHex
and the
TimeOut
settingsforthepropermessageprocessing
Step 3.
MakesuretheTCP/IPportisopenedinthetargetdevice(thinkaboutFirewallsettingsinthenetwork).
Step 4.
ConnecttotheTCPserver.
Working Method
Amessagegotrecognizedfromtheincomingdata,ifoneofthefollowingoccurs:
▪
The set
DelimiterHex
isdetectedinthemessage,or
▪
The set
TimeOut
hasbeenelapsedsincereceivingthelastdatabit.
*Inthatcase,thenot-recognizeddataiskeptinthememory(upto128bytes).Ifthe
DelimiterHex
is detected
later, or the
TimeOut
parameter is set meanwhile, the data appears in the
Rx
,
RxHex, Hash
and
ActiveRx
,
ActiveRxHex, ActiveRxHash
properties.
7.15.1.
Setting the IP Address of the TCP Server
Command and Response
ç
SET·/CTRL/TCP/C
<loc>
.ServerIP(
<IP_address>
)
æ
pw·/CTRL/TCP/C
<loc>
.ServerIP(
<IP_address>
)
Parameters
The
<loc>
parametercanbe1,2or3asatmostthreeTCPconnectionscanbeestablishedatthesametime.
Example
ç
SET/CTRL/TCP/C1.ServerIP(192.168.1.14)
æ
pw/CTRL/TCP/C1.ServerIP(192.168.1.14)
MESSAGE
saved in Rx property
MESSAGE
MESSAGE
saved in ActiveRx property
ActiveRx property is cleared
ActiveProperty
Timeout
MESSAGE
saved in Rx property
MESSAGE
saved in ActiveRx property
ActiveRx property is cleared
ActiveProperty
Timeout
with delimiter
Time
Delimiter
MESSAGE
TimeOut
with timeout
MESSAGE
no timeout,
no delimiter
*
7.15.2. Setting the TCP/IP Port Number of the TCP Server
Command and Response
ç
SET·/CTRL/TCP/C
<loc>
.ServerPort(
<port_no>
)
æ
pw·/CTRL/TCP/C
<loc>
.ServerPort(
<port_no>
)
Example
ç
SET/CTRL/TCP/C1.ServerPort(4999)
æ
pw/CTRL/TCP/C1.ServerPort(4999)
7.15.3.
Connecting to a TCP Server
Command and Response
ç
CALL·/CTRL/TCP/C
<loc>
:connect()
æ
mO·/CTRL/TCP/C
<loc>
:connect
Example
ç
CALL/CTRL/TCP/C1:connect()
æ
mO/CTRL/TCP/C1:connect
7.15.4.
Disconnecting from a TCP Server
Command and Response
ç
CALL·/CTRL/TCP/C
<loc>
:disconnect()
æ
mO·/CTRL/TCP/C
<loc>
:disconnect
Example
ç
CALL/CTRL/TCP/C1:disconnect()
æ
mO/CTRL/TCP/C1:disconnect
7.15.5.
Setting the Delimiter Hex
Thispropertystoresthedelimiterthatisbetweenthemessages(e.g.Cr,Lf,
Space).Thevaluehastobeinhexformat(e.g.0D,0A,20).
Command and Response
ç
SET·/CTRL/TCP/C
<loc>
.DelimiterHex=
<delimiter>
æ
pw·/CTRL/TCP/C
<loc>
.DelimiterHex=
<delimiter>
Parameters
The
<delimiter>
parametercanbemax.8-characterlong(16hexdigit)inhexformat.
Example
ç
SET/CTRL/TCP/C1.DelimiterHex=00
æ
pw/CTRL/TCP/C1.DelimiterHex=00
...00
PWR_01
00...
Delimiter
Delimiter
Stored string