7. LW3 Programmers' Reference
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)
CALL /MEDIA/ETHERNET:tcpMessage(C00\x0D)
tcpMessage command:
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).
MMX4x2 series – User's Manual
7.19. RS-232 Message Recognizer
DIFFERENCE:
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:
* 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
ç
æ
Parameters
<serial_port>
<recognizer_enable>
Example
ç SET /MEDIA/UART/P1.RecognizerEnable=true
æ pw /MEDIA/UART/P1.RecognizerEnable=true
#recognizer
Applied firmware package: v1.6.0b19 | LDC software: v2.5.13b5
This feature and the commands below are available from firmware v1.3.1.
▪
The set DelimiterHex is detected in the message, or
The set TimeOut has passed since receiving the last data bit.
▪
MESSAGE
MESSAGE
with delimiter
Delimiter
MESSAGE
saved in Rx property
saved in ActiveRx property
MESSAGE
MESSAGE
with timeout
MESSAGE
TimeOut
saved in Rx property
saved in ActiveRx property
*
no timeout,
MESSAGE
no delimiter
SET·/MEDIA/UART/<serial_port>.RecognizerEnable=<recognizer_enable>
pw·/MEDIA/UART/<serial_port>.RecognizerEnable=<recognizer_enable>
Parameter
Parameter description
Values
Serial port number
P1, P2
Recognizer mode
true
false
#rs232recognizer
#rs-232recognizer
122
ActiveProperty
ActiveRx property is cleared
Timeout
ActiveProperty
ActiveRx property is cleared
Timeout
Time
Value description
Recognizer is enabled
Recognizer is disabled
Need help?
Do you have a question about the MMX4x2 Series and is the answer not in the manual?