7. LW3 Programmers’ Reference
UCX series – User's Manual
129
Applied firmware package: v1.2.0b9 | LDC software: v2.5.10b1
8.15.5. Query the Serial over IP Port Number
Command and Response
ç
GET·/V1/MEDIA/SERIAL/
<serial_port>
/SERIALOVERIP.Port
æ
pr·/V1/MEDIA/SERIAL/
<serial_port>
/SERIALOVERIP.Port=
<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
ç
GET /V1/MEDIA/SERIAL/P1/SERIALOVERIP.Port
æ
pr /V1/MEDIA/SERIAL/P1/SERIALOVERIP.Port=8001
8.15.6.
Enable the Serial over IP Port
Command and Response
#rs232 #rs-232 #serial
ç
SET·/V1/MEDIA/SERIAL/
<serial_port>
/SERIALOVERIP.Enabled=
<state>
æ
pr·/V1/MEDIA/SERIAL/
<serial_port>
/SERIALOVERIP.Enabled=
<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
ç
SET /V1/MEDIA/SERIAL/P1/SERIALOVERIP.Enabled=true
æ
pw /V1/MEDIA/SERIAL/P1/SERIALOVERIP.Enabled=true
8.16.
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. For more details see
.
#new
8.17. GPIO Port Configuration
DIFFERENCE:
GPIO-related commands are available only from FW package 1.1.0b7.
8.17.1. Querying the Direction of a GPIO Pin
Command and Response
#gpio
ç
GET·/V1/MEDIA/GPIO/
<port>
.Direction
æ
pw·/V1/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
Parameters
Parameter
Parameter description
Value
Value description
<dir>
The direction of the GPIO pin.
Input
input
Output
output
Example
ç
GET /V1/MEDIA/GPIO/P1.Direction
æ
pw /V1/MEDIA/GPIO/P1.Direction=Input
8.17.2.
Setting the Direction of a GPIO Pin
Command and Response
ç
SET·/V1/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
æ
pw·/V1/MEDIA/GPIO/
<port>
.Direction(
<dir>
)
Parameters
See the previous section.
Example
ç
SET /V1/MEDIA/GPIO/P1.Direction=Input
æ
pw /V1/MEDIA/GPIO/P1.Direction=Input
8.17.3. Querying the Output Level of a GPIO Pin
Command and Response
ç
GET·/V1/MEDIA/GPIO/
<port>
.Output
æ
pw·/V1/MEDIA/GPIO/
<port>
.Output(
<value>
)
Parameters
Parameter
Parameter description
Value
Value description
<value>
The output value of the GPIO pin.
High
high level
Low
low level
Example
ç
GET /V1/MEDIA/GPIO/P1.Output
æ
pw /V1/MEDIA/GPIO/P1.Output=Low