
7. LW3 Programmers’ Reference
RAP-B511 series
– User's Manual
97
Applied firmware package: v1.1.0b3b3 | LDC software: v2.5.1b5
7.20.4.
Using Hexadecimal Codes
Hexadecimal codes can be inserted in the ASCII message when using:
sendMessage command:
CALL /MEDIA/UART/P1:sendMessage(C00\x0D)
tcpMessage command:
CALL /MEDIA/ETHERNET:tcpMessage(C00\x0D)
udpMessage command:
CALL /MEDIA/ETHERNET:udpMessage(C00\x0D)
▪
C00
: the message.
▪
\x
: indicates that the following is a hexadecimal code.
▪
0D
: the hexadecimal code (Carriage Return).
7.21.
RS-232 Message Recognizer
DIFFERENCE:
This feature and below commands are available from FW package v1.1.0b3.
This tool can be used to recognize messages coming from the RS-232 port. The message can be used as a
Condition in Event manager and define an Action for it.
Working Method
A message got recognized from the incoming data, if one of the following occurs:
▪
The set DelimiterHex is detected in the message, or
▪
The set TimeOut has been elapsed since receiving the last data bit.
* In that case, the not-recognized data is kept in the memory (up to 128 bytes). If the
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.21.1.
Enable the Recognizer
Command and Response
ç
SET·/MEDIA/UART/
<serial_port>
.RecognizerEnable=
<recognizer_enable>
æ
pw·/MEDIA/UART/
<serial_port>
.RecognizerEnable=
<recognizer_enable>
Parameters
Parameter
Parameter description
Values
Value description
<serial_port>
Serial port number
P1, P2
<recognizer_enable>
Recognizer mode
true
Recognizer is enabled
false
Recognizer is disabled
Example
ç
SET /MEDIA/UART/P1.RecognizerEnable=true
æ
pw /MEDIA/UART/P1.RecognizerEnable=true
#recognizer #rs232recognizer
#rs-232recognizer
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
*