7. LW3 Programmers’ Reference
RAP-B511 series
– User's Manual
58
7.11.
RS-232 Recognizer
This tool is able to recognize the incoming RS-232 message. It stores
the incoming serial data from the first bit, until the previously defined
string (delimiter) or the elapsing timeout after the last bit. The last
incoming serial string is saved in different formats (string, hex, and
hash).
7.11.1.
Enable the Recognizer
Ý
SET·/MEDIA/UART/P1.RecognizerEnable=
<recognizer_enable>
Ý
pw·/MEDIA/UART/P1.RecognizerEnable=
<recognizer_enable>
Parameters
<recognizer_enable>
true:
recognizer is enabled
false:
recognizer is disabled
Example
Ý
SET /MEDIA/UART/P1.RecognizerEnable=true
Ü
pw /MEDIA/UART/P1.RecognizerEnable=true
7.11.2.
Set the Delimiter Hex
When the delimiter hex string is detected in the incoming serial data,
the device saves the RS-232 message data from the first bit, until the
delimiter (or the data between the two delimiter).
Ý
SET·/MEDIA/UART/RECOGNIZER.DelimiterHex=
<delimiter
>
Ü
pw·/MEDIA/UART/RECOGNIZER.DelimiterHex=
<delimiter>
Parameters
<delimiter>
It can be max. 8-character long (or 16 hex digit) in
hex
format.
Example
Ý
SET /MEDIA/UART/RECOGNIZER.DelimiterHex=3a
Ü
pw /MEDIA/UART/RECOGNIZER.DelimiterHex=3a
... Password :
Login name :
...
Delimiter (hex format: 3A)
Stored string
Parameters
<recognized _hex>
Recognized data in hex format.
Example
Ý
GET /MEDIA/UART/RECOGNIZER.RxHex
Ü
pr /MEDIA/UART/RECOGNIZER.RxHex=FF1F4C6F67696E3A
Recognized data hash
Ý
GET·/MEDIA/UART/RECOGNIZER.Hash
Ü
pr·/MEDIA/UART/RECOGNIZER.Hash=
<recognized _hash>
Parameters
<recognized _hash>
Fingerprint code, Max. 32 bit-long recognized data
hash.
Example
Ý
GET /MEDIA/UART/RECOGNIZER.Hash
Ü
pr /MEDIA/UART/RECOGNIZER.Hash=997A659E
7.11.5.
Clear the Stored Last Recognized Serial Message
This method deletes all the stored received serial messages.
Ý
CALL·/MEDIA/UART/RECOGNIZER:clear()
Ü
mO·/MEDIA/UART/RECOGNIZER:clear
Example
Ý
CALL /MEDIA/UART/RECOGNIZER:clear()
Ü
mO /MEDIA/UART/RECOGNIZER:clear
7.11.3.
Set the Timeout
When the set time is elapsed after the last received message, the
device saves the data. It can be applied, when there is no special or
easily defined delimiter string in the incoming serial data, but there is
a time gap between the messages.
Ý
SET·/MEDIA/UART/RECOGNIZER.TimeOut=
<timeout>
Ü
pw·/MEDIA/UART/RECOGNIZER.TimeOut=<
timeout>
Parameters
<timeout>
Timeout value in ms.;
0
: disable the timeout; min. value: 10.
Example
Ý
SET /MEDIA/UART/RECOGNIZER.TimeOut=20
Ü
pw /MEDIA/UART/RECOGNIZER.TimeOut=20
7.11.4. Query the Last Recognized Serial Message (Rx, RxHex, Hash)
The recognized data is stored in string, hex and hash formats. They are
stored until the next incoming message or until the RECOGNIZER:clear()
method is called.
TIPS AND TRICKS: When one of these properties are set as a
condition in the Event Manager, and the same strings follow each
other, the action
will execute once
.
Recognized data in string format
Ý
GET·/MEDIA/UART/RECOGNIZER.Rx
Ü
pr·/MEDIA/UART/RECOGNIZER.Rx=
<recognized _string>
Parameters
<recognized _string>
Max. 12 byte-long recognized data string.
Example
Ý
GET /MEDIA/UART/RECOGNIZER.Rx
Ü
pr /MEDIA/UART/RECOGNIZER.Rx=Login:
Recognized data in hex format
Ý
GET·/MEDIA/UART/RECOGNIZER.RxHex
Ü
pr·/MEDIA/UART/RECOGNIZER.RxHex=
<recognized _hex>