
7. LW3 Programmers’ Reference
RAP-B511 series
– User's Manual
93
Applied firmware package: v1.1.0b3b3 | LDC software: v2.5.1b5
7.18.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.18.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.18.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.18.5.
Setting the Delimiter Hex
This property stores the delimiter that is between the messages (e.g. Cr, Lf,
Space). The value has to be in hex format (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>
parameter can be max. 8-character long (16 hex digit) in hex format.
Example
ç
SET /CTRL/TCP/C1.DelimiterHex=00
æ
pw /CTRL/TCP/C1.DelimiterHex=00
...00
PWR_01
00...
Delimiter
Delimiter
Stored string
7.18.6.
Setting the Timeout
When the set time is elapsed after the last received message and delimiter was not detected, the device
saves the data into the
Rx, RxHex, Hash
properties. The timeout setting is useful if there is no special or easily
defined delimiter in the incoming data, but there is a time gap between the messages.
Command and Response
ç
SET·/CTRL/TCP/C
<loc>
.TimeOut=
<timeout>
æ
pw·/CTRL/TCP/C
<loc>
.TimeOut=
<timeout>
Parameters
The
<timeout>
parameter sets the time value in milliseconds:
0
means the timeout is disabled, min. value
is 10.
Example
ç
SET /CTRL/TCP/C1.TimeOut=20
æ
pw /CTRL/TCP/C1.TimeOut=20
7.18.7. Querying the Last Recognized Message (String)
The recognized message is stored as a string in the below property till the next recognized message or until
the
clear()
method is called.
TIPS AND TRICKS:
When this property is set as a condition in the Event Manager, and the same strings
follow each other, the action
will execute once
. (A Condition can be detected in Event Manager if a change
happens. But if the same string is saved into the property after each other, it will not cause a change.)
Command and Response
ç
GET·/CTRL/TCP/C
<loc>
.Rx
æ
pr·/CTRL/TCP/C
<loc>
.Rx=
<recognized_string>
Parameters
The
<recognized_string>
parameter can be max. 128 byte long.
Example
ç
GET /CTRL/TCP/C1.Rx
æ
pr /CTRL/TCP/C1.Rx=PWR_off