WebRelay-10 Users Manual
Operation
3.4 Modbus Operation
WebRelay-10 can be controlled and monitored using Modbus/TCP protocol. This provides a standard
means of using WebRelay-10 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.
WebRelay-10 functions as a Modbus slave . Host devices, such as PLCs, open a connection with
WebRelay-10 on port 502 (configurable under
Advanced Network
tab) and then send requests to read
or set relay states, read input states, or read sensor values. When WebRelay-10 receives a command, it
will perform the desired function and return a response.
3.4.1 WebRelay-10 Function Code Summary
WebRelay-10 supports the following function codes:
Code Name
Modbus
Function
Feature
WebRelay
Address
Data Type
Manual
Section
Read Coils
01
Relays 1-10
0-9
Discrete
3.4.4
Read Discrete Inputs 02
Inputs 1-2
0-1
Discrete
3.4.5
Read Sensors
03
Sensors 1-8
272-286
32-bit
3.4.6
Write Single Coil
05
Relays 1-10
0-9
Discrete
3.4.7
Write Multiple Coils
15
Relays 1-10
0-9
Discrete
3.4.8
Pulse Coils
16
Relays 1-10
0-9
32-bit
3.4.9
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.
WebRelay-10 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 relays combination.
The structure of these commands is described in the following sections..
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 are common
function codes and their respective address ranges.
Xytronix Research & Design, Inc.
page 63
Содержание WebRelay-10 X-WR-10R12-I
Страница 1: ...WebRelay 10 Title Page Goes Here...