7. LW3 Programmers’ Reference
MMX6x2-HT series – User's Manual
66
7.7.
Message Sending via Ethernet Port
7.7.1. Sending a TCP Message (ASCII-format) via Ethernet
The command is for sending a command message in ASCII-format. This method
allows
escaping the control
characters, see the
section.
Command and Response
CALL•/MEDIA/ETHERNET:tcpMessage(
<IP_address>
:
<port_no>
=
<message>
)
mO•/MEDIA/ETHERNET:tcpMessage
Example
CALL /MEDIA/ETHERNET:tcpMessage(192.168.0.20:5555=C00)
mO /MEDIA/ETHERNET:tcpMessage
The 'C00' message is sent to the indicated IP:port address.
Example with HEX codes
CALL /MEDIA/ETHERNET:tcpMessage(192.168.0.20:5555=C00\x0a\x0d)
mO /MEDIA/ETHERNET:tcpMessage
The 'C00' message with CrLf (Carriage return and Line feed) is sent to the indicated IP:port address. The \x
sequence indicates the HEXA code.
Escaping in the Message
When commands need to be separated by <CR><LF> charaters to be recognized by the controlled device,
then they need to be escaped. You can use the following format for escaping:
<command1><\x0d\x0a><command2><\x0d\x0a>...<commandn><\x0d\x0a>
7.7.2. Sending a TCP Text (ASCII-format) via Ethernet
The command is for sending a text message in ASCII-format. This method
does not allow
escaping or inserting
control characters.
Command and Response
CALL•/MEDIA/ETHERNET:tcpText(
<IP_address>
:
<port_no>
=
<text>
)
mO•/MEDIA/ETHERNET:tcpText
Example
CALL /MEDIA/ETHERNET:tcpText(192.168.0.20:5555=open)
mO /MEDIA/ETHERNET:tcpText
The 'open' text is sent to the indicated IP:port address.
7.7.3. Sending a TCP Binary Message (HEX-format) via Ethernet
The command is for sending a binary message in Hexadecimal format. This method
does not allow
escaping
or inserting control characters.
Command and Response
CALL•/MEDIA/ETHERNET:tcpBinary(
<IP_address>
:
<port_no>
=
<HEX_message>
)
mO•/MEDIA/ETHERNET:tcpBinary
Example
CALL /MEDIA/ETHERNET:tcpBinary(192.168.0.20:5555=433030)
mO /MEDIA/ETHERNET:tcpBinary
The '433030' message is sent to the indicated IP:port address.
INFO: There is no need to insert a space or other separator character between the binary messages.
7.7.4. Sending a UDP Message (ASCII-format) via Ethernet
The command is for sending a UDP message in ASCII-format. This method
allows
escaping the control
characters, see the
section.
Command and Response
CALL•/MEDIA/ETHERNET:udpMessage(
<IP_address>
:
<port_no>
=
<message>
)
mO•/MEDIA/ETHERNET:udpMessage
Example
CALL /MEDIA/ETHERNET:udpMessage(192.168.0.20:9988=C00)
mO /MEDIA/ETHERNET:udpMessage
The 'C00' message is sent to the indicated IP:port address.
Example with HEX codes
CALL /MEDIA/ETHERNET:udpMessage(192.168.0.20:9988=C00\x0a\x0d)
mO /MEDIA/ETHERNET:udpMessage
The 'C00' message with CrLf (Carriage return and Line feed) is sent to the indicated IP:port address. The \x
sequence indicates the HEXA code.
Escaping in the Message
When commands need to be separated by <CR><LF> charaters to be recognized by the controlled device,
then they need to be escaped. You can use the following format for escaping:
<command
1
><\x0d\x0a><command
2
><\x0d\x0a>...<command
n
><\x0d\x0a>