X-317™ Users Manual
5.3 Modbus Operation
The X-317 can be controlled and monitored using Modbus/TCP protocol. This provides a standard
means of using the X-317 with devices and software from other manufacturers. This section is not a
tutorial on Modbus and it is assumed that the reader is already familiar with Modbus. Detailed Modbus
information can be found at http://www.modbus.org.
Note: Modbus communications are disabled whenever the Control Password is enabled. This is
because Modbus/TCP does not provide a mechanism for password protection. Make sure the Control
Password is disabled (default) and Modbus functionality is enabled on the Advanced Network.
The X-317 functions as a Modbus slave. Host devices, such as PLCs, open a connection with the X-317
on port 502 (configurable under Advanced Network tab) and then send requests to read or set analog
channel values. When the X-317 receives a command, it will perform the desired function and return a
response.
5.3.1 X-317 Function Code Summary
The X-317 supports the following function codes:
Code Name
Read Holding Registers
Write Multiple Registers
Multiple commands may be sent without closing and re-opening the connection, but if no data is
transferred for 50 seconds, the connection will time out and close. To keep the connection open, a read
request can be sent periodically.
The X-317 has two TCP sockets available for Modbus/TCP. This allows two connections to be open at
one time. Requests for more than two open connections will be rejected. When errors occur, an error
code is returned. Most Modbus client software will interpret this code in a human readable form. The
code is comprised of the original function code plus 0x80. Each error has a qualifying exception
number. The following are the possible exception codes and their meanings:
0x01 - Function code not supported (also when Modbus is disabled in the setup pages).
0x02 - Incorrect starting address/quantity of registers combination.
The structure of these commands is described in the following sections. In the examples below the
Modbus payload portion of the TCP packet is highlighted in blue.
Xytronix Research & Design, Inc.
Modbus Function
03
16
X-317 Address
0x0510 to 0x0518
0x0510 to 0x0518
Operation
Data Type
32-bit
32-bit
Page 43
Need help?
Do you have a question about the ControlByWeb X317 and is the answer not in the manual?
Questions and answers