Auxiliary Operations
XW-210 WiFi™ Users Manual
6.6.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.
Code Name
Modbus
Function
Data Type*
PLC Address
Mode 485
PLC Address
Mode 584/984
Coils (Read/Write)
01, 05, 15
Discrete
1-1000
1-10000
Discrete Inputs (Read only)
02
Discrete
1001-2000
10001-20000
Registers (Read only)
04
8-64 bits
3001-4000
30001-40000
Holding Registers
(Read/Write)
03, 06, 16
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.
Function codes, memory types, and addresses can be converted to the PLC addressing equivalent using
the table below. To use the table, look up the row corresponding to the Modbus function code. Then take
the desired XW-210 feature address and add to it the address offset in the PLC address mode column.
Input A PLC Base Address = PLC Address
For example, to read discrete Input 2
Input Address
1
PLC Base address
1001
PLC Address
1002
Programming the PLC to read from 1002 will return the value of Input 2.
Code Name
Modbus
Function
XW-210 Addresses
Data Type PLC Address
Mode 485
PLC Address
Mode 584/984
Read Coils
01
0 (Relay 1)
Discrete
Addr + 1
Addr + 1
Read Discrete Inputs 02
0 (Input 1)
Discrete
Addr + 1001
Addr + 10001
Read Holding
Registers
03
16 (Vin)
32-bit float Addr + 4001
Addr + 40001
272-278 (Sensors 1-4)
32-bit float Addr + 4001
Addr + 40001
528 (Counter 1)
32-bit float Addr + 4001
Addr + 40001
Write Coils
05
0 (Relay 1)
Discrete
Addr + 1
Addr + 1
Write Multiple Coils 15
0 (Relay 1)
Discrete
Addr + 1
Addr + 1
Write Multiple
Registers
16
784-785 (Relay 1)
32-bit float Addr + 4001
Addr + 40001
For 32-bit numbers or floats, two registers must be read starting at the desired address, examples of
each are given for the applicable functions.
Page 68
Xytronix Research & Design, Inc.
Summary of Contents for WebRelay Wireless XW-210I
Page 1: ......