Revision 1.1
3.4 Modbus Operation
WebSwitch™ can be controlled (and read) using Modbus/TCP protocol. This provides a standard means
of using WebSwitch™ in conjunction with devices and software from other manufacturers. This section
contains the information necessary to communicate with WebSwitch™ using Modbus/TCP. This 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.
WebSwitch™ functions as a Modbus server (slave). Client (master) devices and software open a
connection with WebSwitch™ on port 502 (unless another Modbus port is selected) and sends
commands or requests to read the state of the outlet, read the input, or change the outlet state. When
WebSwitch™ receives a command, it will perform the desired function and return a response. The
underlying structure of these commands can be found in the next sections, although most software and
Modbus devices can be configured by reading through the following section only.
There are generally two ways that Modbus software and PLCs communicate with a Modbus device. The
first is by specifying the Modbus function code/memory type and an address. The second, sometimes
called PLC addressing, requires the address only. Under PLC addressing, the function code/memory
type is a given based on the PLC address. Once the address is known, the data size must be specified.
The inputs and outlets are discrete data types. The sensor readings are 32 bit floating point numbers.
For these, a quantity of two registers must be read starting at the desired address. The table below gives
commonly used function code/memory types, data sizes, and equivalent PLC addresses for accessing
the device. The data size will be the same regardless of the addressing mode.
Read Outlet 1
State
Read Outlet 2
State
Write Outlet 1
Write Outlet 2
Read Input 1
State
Read Input 2
State
Read Sensor 1
Read Sensor 2
Read Sensor 3
Xytronix Research & Design, Inc.
Function Code
Data Size
and Address
Function code 01
Address 0
Function code 01
Address 1
Function code 05
Address 0
Function code 05
Address 1
Function code 02
Address 0
Function code 02
Address 1
Function code 03
32 Bit Float
Address 272
(2 Registers)
Function code 03
32 Bit Float
Address 274
(2 Registers)
Function code 03
32 Bit Float
Address 276
(2 Registers)
PLC Address Mode
485
Discrete
Discrete
Discrete
Discrete
Discrete
1001
Discrete
1002
4272
4274
4276
WebSwitch™ Users Manual
PLC Address Mode
584/984
1
2
1
2
10001
10002
40272
40274
40276
1
2
1
2
73
Need help?
Do you have a question about the WebSwitch XRDI-WS3 and is the answer not in the manual?