7. Lightware REST API Reference
UCX series – User's Manual
97
Applied firmware package: v1.2.0b9 | LDC software: v2.5.10b1
Example
ɯ
header:
POST http://192.168.0.50/api/V1/MEDIA/SERIAL/P1/Parity HTTP/1.1
ɯ
body: None
ɮ
header:
200 OK
ɮ
body: None
7.15.5. Query the Serial over IP Port Number
Request and Response
ɯ
header:
GET·http://
<ip>
/api/V1/MEDIA/SERIAL/
<serial_port>
/SERIALOVERIP/Port·HTTP/1.1
ɮ
header: 200·OK
ɮ
body:
<port_nr>
Parameters
Identifier
Parameter description
Parameter values
<serial_port>
Serial port number
P1-P2*
<port_nr>
Serial over IP port
number
8001
8002
*The UCX-2x1-HC30 model has one serial port (P1).
Example
ɯ
header:
GET http://192.168.0.50/api/V1/MEDIA/SERIAL/P1/SERIALOVERIP/Port HTTP/1.1
ɮ
header:
200 OK
ɮ
body: 8001
7.15.6.
Enable the Serial over IP Port
Request and Response
#rs232 #rs-232 #serial
ɯ
header:
POST·http://
<ip>
/api/V1/MEDIA/SERIAL/
<serial_port>
/SERIALOVERIP/Enabled·HTTP/1.1
ɯ
body:
<state>
ɮ
header:
200 OK
ɮ
body:
<state>
Parameters
Identifier
Parameter
description
Parameter values
<serial_port>
Serial port
number
P1-P2*
<state>
true
false
*The UCX-2x1-HC30 model has one serial port (P1).
Example
ɯ
header:
POST http://192.168.0.50/api/V1/MEDIA/SERIAL/P1/SERIALOVERIP/Enabled HTTP/1.1
ɯ
body: false
ɮ
header:
200 OK
ɮ
body: false
7.16.
Serial Port Messaging
7.16.1.
Sending a Message via RS-232
ATTENTION!
Serial message sending is implemented only via Lightware REST API. This function is not
available with LW3 protocol command.
#message
Request and Response
ɯ
header:
POST·http://
<ip>
/api/V1/MEDIA/SERIAL/
<serial_port>
/send·HTTP/1.1
ɯ
body:
<message>
ɮ
header:
200 OK
Parameters
Identifier
Parameter
description
Parameter values
<serial_port>
Serial port
number
P1-P2*
<message>
Serial message
Any format is acceptable (text, binary,
hexadecimal etc.), maximum message
size is 100K. Escaping is unnecessary.
**The UCX-2x1-HC30 model has one serial port (P1).
Example
ɯ
header:
POST http://192.168.0.50/api/V1/MEDIA/SERIAL/P1/send
ɯ
body:
PWR0
ɮ
header:
200 OK
The 'PWR0' message is sent out via the P1 serial port.