Section 5: Modbus/Tcp - Xytronix Research & Design CONTROL BY WEB XW-111 User Manual

Wireless digital input monitor
Table of Contents

Advertisement

Modbus/TCP

Section 5: Modbus/TCP

XW-111 can be controlled and monitored using Modbus/TCP protocol. This provides a standard means
of using the XW-111 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 WiFi Network tab.
The XW-111 functions as a Modbus slave. Host devices, such as PLCs, open a connection with the XW-
111 on port 502 (configurable under WiFi Network tab) and then send requests to read sensor values.
The XW-111 has no write registers. When the XW-111 receives a command, it will perform the desired
function and return a response.
The following sections provide an overview and explanation of Modbus operation.
5.1 XW-111 Modbus Function Code Summary
The XW-111 supports the following function codes:
Code Name
Read Battery Voltage
Read Inputs
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 XW-111 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.
Page 34
Modbus
XW-111 Feature
Function
03
Battery Voltage
02
Inputs 1-2
XW-111™ Wi-Fi Digital Sensor Users Manual
XW-111 Start Address
Hexadecimal
0x0010
0x0000-0x0001
Xytronix Research & Design, Inc.
Decimal
16
0-1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Control by web xw-111b

Table of Contents