![Lightware MMX4x2 Series Скачать руководство пользователя страница 122](http://html1.mh-extra.com/html/lightware/mmx4x2-series/mmx4x2-series_user-manual_1915430122.webp)
7. LW3 Programmers’ Reference
MMX4x2 series – User's Manual
122
Applied firmware package: v1.6.0b19 | LDC software: v2.5.13b5
7.18.3.
Sending a Binary Message (HEX-format) via RS-232
The command is for sending a binary message in Hexadecimal format. This method
does not require
escaping
the control and non-printable characters.
Command and Response
ç
CALL·/MEDIA/UART/P1:sendBinaryMessage(
<message>
)
æ
mO·/MEDIA/UART/P1:sendBinaryMessage
Example
ç
CALL /MEDIA/UART/P1:sendBinaryMessage(433030)
æ
mO /MEDIA/UART/P1:sendBinaryMessage
The '433030' message is sent out via the P1 serial port.
7.18.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.19.
RS-232 Message Recognizer
DIFFERENCE:
This feature and the commands below are available from firmware v1.3.1.
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 an Action can be defined 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 passed 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 in the meantime, the data appears in the
Rx
,
RxHex, Hash
and
ActiveRx
,
ActiveRxHex, ActiveRxHash
properties.
7.19.1. Enabling/Disabling 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
*