Operating instructions
WirelessHART Fieldgate SWG70 A Appendix: Modbus Interface
Endress+Hauser 91
A.1.2 Modbus in Fieldgate
Fieldgate SWG70 is equipped with both a Modbus serial and Ethernet interface. As a result, it can
be operated in one of the following roles:
• Modbus Serial Slave
• Modbus TCP Slave
A serial or TCP slave can be accessed by one Modbus master only.
Establishing
communication
As a TCP slave, Fieldgate SWG70 will normally communicate with the master via Port 502. If this
port is unavailable, it is possible to specify a secondary TCP/IP port number.
Modbus commands Fieldgate SWG70 support for Modbus functions is currently as follows
Registers Modbus specifies four different types of register:
• Discrete input registers contain the discrete input values and possibly status
• Input registers contain analog input values and status
• Coil registers contain discrete output values and possibly status
• Holding registers contain analog output values and status
In addition, it is possible to "pack" discrete inputs and outputs into words, which are then stored as
appropriate in the input or holding registers. Fig. A-1 overleaf gives an overview of the register and
reference address ranges used for each register type.
For Fieldgate, the holding registers are a read only image of the input registers which can be
accessed when the Read Modbus Registers Mode is set to "Input and Holding", see Chapter 10.2.1.
HART implementation The Modbus implementation in Fieldgate SWG70 maps HART dynamic process variables over
Modbus input registers and also uses input registers to provide device-related status information.
The Modbus implementation is based on the following assumptions:
• The HART Command 3 dynamic variables are used for automatic Modbus mapping
• For Modbus access, publishing must be enabled for all relevant devices
• The gateway caches the relevant information. Modbus commands will therefore access the
internal gateway memory
• Modbus input registers are only supported if they are associated with HART dynamic process
variables
• A device can either be a WirelessHART device or a wired HART device connected to a
WirelessHART adapter
• WirelessHART and wired HART devices are mapped independently within the Modbus input
registers
Function Function Code Hex Function supported
Read discrete inputs 20x02Yes
Read coils 1 0x01 No
Write single coil 5 0x05 No
Write multiple coils 15 0x0F No
Read input register 40x04Yes
Read holding register 30x03Yes
Write single register 6 0x06 No
Write multiple registers 16 0x10 No
Read/Write multiple register 23 0x17 No