X-320M™ User's Manual
Operation
3.4 Modbus Operation
X-320M™ can be monitored using Modbus/TCP protocol. This provides a standard means of using X-
320M™ 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.
X-320M™ functions as a Modbus slave. Host devices, such as PLCs, open a connection with X-320M™
on port 502 (configurable under
Advanced Network
tab) and then send requests to read the sensor
values. When X-320M™ receives a command, it will perform the desired function and return a response.
The following sections provide an overview and explanation of Modbus operation.
3.4.1 X-320™ Function Code Summary
X-320™ supports the following function codes:
Code Name
Modbus
Function
X-320M Feature
X-320 Start Address
Hexadecimal
Decimal
Read Holding
Registers
03
Sensors 1-9
Calculated Data
Highs/Lows
0x0510-0x0540
1296-1344
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.
X-320M™ 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. For example, an
error during the read coils function 0x01 would return 0x81. 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 output combination.
3.4.2 PLC Device Addressing
There are generally two schemes for accessing Modbus devices, The first is by specifying the Modbus
function code, memory type, and address. The second, sometimes called PLC addressing, requires only
the address.
Modbus protocol uses four different address ranges for discrete inputs, coils, input registers, and holding
registers. The function code determines the address range of the message. The following function codes
and their respective address ranges are found on the X-320M™.
Code Name
Modbus
Function
Data Type*
PLC Address
Mode 485
PLC Address
Mode 584/984
Holding Registers
(Read Only)
03
8-64 bits
4001-5000
40001-50000
* Data types may be implemented at the discretion of the manufacturer. Address ranges may also over
lap. Discrete is a binary or boolean value, 1 or 0.
Xytronix Research & Design, Inc.
Page 97
Содержание X-320m
Страница 1: ......