10. easyE4 communication Connection to other devices
10.17 Modbus TCP
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)
easyE4 supports the following function codes as a Modbus TCP server:
FC
dec
Function description Function
Code
hex
FC1
Read Coils Used to read outputs
0x01
FC2
Read Discrete Inputs Used to read inputs
0x02
FC3
Read Multiple Holding Registers Used to read multiple input registers
0x03
FC4
Read Input Registers Used to read input registers
0x04
FC5
1)
Write Single Coil Used to write to exactly one output
0x05
FC6
Write Single Holding Register Used to write to a single output
register
0x06
FC15
1)
Write Multiple Coils Used to write to multiple outputs
0x15
FC16
Write Multiple Holding Registers Used to write to multiple output
registers
0x10
FC23
1)
Read and Write Multiple Holding
Registers
Used to read or write from/to multiple
word output registers
0x17
1) Only available for Modbus TCP clients or Modbus RTU master in easyE4
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)
a. Byte 0 contains the request's function code
b. The remaining bytes are function-specific
If an error occurs, the Modbus TCP server will send an error message
l
Error-Frame
a. Byte 0 always contains the request's error code (0x80 + function code)
b. Byte 1 contains the exception code (error-specific)
Following is a description of the request & response function codes for each of the
function descriptions in the table above:
790
easyE402/24 MN050009ENEaton.com