11. Connection to other devices
11.4 Modbus TCP
11.4.2 Programming communication with Modbus TCP
In order to program these communications, you will need at least one system that ful-
fills the functionality of a Modbus TCP client and that is able to send commands to the
lower-level server.
Since the easyE4 control relays can work with various Modbus TCP clients available on
the market, only standard-compliant Modbus TCP functions are supported.
In other words, functions that are defined in a standardized manner in the Modbus
standard and are accordingly implemented at the protocol level in a standardized man-
ner by all Modbus TCP stations. For more information, please refer to the MODBUS
MESSAGING ON TCP/IP IMPLEMENTATION GUIDE V1.0b published by the Modbus
Organization.
Connection:
In order for the Modbus TCP server to work, the following ports must be opened:
l Modbus TCP: Service—Port 502
Port 502 is normally set by default. If it is not, make sure to set it when establishing a
connection.
Ports that may need to be opened depending on the functionality being used:
l DNS: UDP/TCP port 53 (only if using DNS)
l DHCP: UDP port 67 for server / UDP Port 68 for clients (only if using DHCP)
The Modbus TCP server implementation on the easyE4 will provide the following stand-
ard functions:
Function description Function
Code
Read Coils Used to read outputs 0x01
Read Discrete Inputs Used to read inputs 0x02
Read Holding Registers Used to read output registers 0x03
Read Input Registers Used to read input registers 0x04
Write Single Registers Used to write to a register 0x06
Write Multiple Registers Used to write to multiple registers 0x10
There are two basic protocol data units (PDUs) for each of the function descriptions
above:
1. Request PDU (the Modbus TCP server must receive this PDU)
a. Byte 0 contains the function code, which is used to identify the function that
is desired
b. The remaining bytes are function-specific
2. Response PDU (the Modbus TCP server must send this PDU)
546
easyE4 11/18 MN050009 EN www.eaton.com