Services
Modbus gateway
LR54 User Guide
667
4. Configure servers:
a. Add a server:
(config)> add service modbus_gateway server
name
(config service modbus_gateway
server
name
)>
where
name
is a name for the server, for example:
(config)> add service modbus_gateway server test_modbus_server
(config service modbus_gateway server test_modbus_server)>
The Modbus server is enabled by default. To disable:
(config service modbus_gateway server test_modbus_server)> enable
false
(config service modbus_gateway server test_modbus_server)>
b. Set the connection type:
(config service modbus_gateway server test_modbus_server)> connection_
type
type
(config service modbus_gateway server test_modbus_server)>
where
type
is either
socket
or
serial
. The default is
socket
.
n
If
connection_type
is set to
socket
:
i. Set the IP protocol:
(config service modbus_gateway server test_modbus_server)>
socket protocol
value
(config service modbus_gateway server test_modbus_server)>
where
value
is either
tcp
or
udp
.
ii. Set the port:
(config service modbus_gateway server test_modbus_server)>
socket
port
(config service modbus_gateway server test_modbus_server)>
where
port
is an integer between
1
and
65535
. The default is
502
.
iii. Set the packet mode:
(config service modbus_gateway server test_modbus_server)>
socket packet_mode
value
(config service modbus_gateway server test_modbus_server)>
where
value
is either
rtu
or
raw
. The default is
rtu
.
iv. Set the maximum allowable time between bytes in a packet:
(config service modbus_gateway server test_modbus_server)>
socket idle_gap
value
(config service modbus_gateway server test_modbus_server)>