8. LW3 Programmers' Reference
8.11.5. Query the RS-232 Command Injection Port Number
Command and Response
ç GET·/MEDIA/UART/<serial_port>.CommandInjectionPort
æ pw·/MEDIA/UART/<serial_port>.CommandInjectionPort
Example
ç GET /MEDIA/UART/P1.CommandInjectionPort
æ pw /MEDIA/UART/P1.CommandInjectionPort=8001
8.12. Serial Port Messaging
8.12.1. Sending a Message (ASCII-format) via RS-232
The command is for sending a command message in ASCII-format. This method allows escaping the control
and non-printable characters. For more information see the
Command and Response
ç CALL·/MEDIA/UART/P1:sendMessage(<message>)
æ mO·/MEDIA/UART/P1:sendMessage
Example
ç CALL /MEDIA/UART/P1:sendMessage(PWR0)
æ mO /MEDIA/UART/P1:sendMessage
The 'PWR0' message is sent out via the P1 serial port.
8.12.2. Sending a Text (ASCII-format) via RS-232
The command is for sending a command message in ASCII-format. This method does not allow sending
message with control and non-printable characters.
Command and Response
ç CALL·/MEDIA/UART/P1:sendText(<message>)
æ mO·/MEDIA/UART/P1:sendText
Example
ç CALL /MEDIA/UART/P1:sendText(open)
æ mO /MEDIA/UART/P1:sendText
The 'open' text is sent out via the P1 serial port.
Escaping
section.
#message
Applied firmware package: v1.3.0 | LDC software: v2.4.2
MMX8x4-HT series – User's Manual
8.12.3. Sending a Binary Message (HEX-format) via RS-232
The command is for sending a command message in Hexadecimal-format. This method does not require
escaping the control 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.
8.12.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).
131