|
Ports released for Modbus/TCP communication The following ports are used by the Modbus/TCP protocol.
- By default, the protocol uses Port 502 as local port in the Modbus server.
- You can set the local port as you wish in the Modbus client. Usually, port numbers starting at 2000 are used.
If the communication partners offer the option of setting the port numbers for the server, then it is also possible to communicate using the Modbus/TCP protocol through a port other than Port 502.
If you use the SIMATIC as Modbus server, then there are restrictions for a number of CPUs regarding the released port numbers.
The following port numbers are released for the local port:
| CPU |
Order number |
Firmware version |
Released ports |
Multiport |
| IM151-8 PN/DP CPU |
6ES7151-8AB00-0AB0 |
up to V2.6 |
2000 to 5000 |
No |
| IM151-8 PN/DP CPU |
6ES7151-8AB00-0AB0 |
from V2.7 |
all |
No |
| IM151-8 PN/DP CPU |
6ES7151-8AB01-0AB0 |
from V3.2 |
all |
Yes |
| CPU314C-2 PN/DP |
6ES7314-6EH04-0AB0 |
from V3.3 |
all |
Yes |
| CPU315-2PN/DP |
6ES7315-2EG10-0AB0 and
6ES7315-2EH13-0AB0 |
up to V2.3.4 |
2000 to 5000 |
No |
| CPU315-2PN/DP |
6ES7315-2EH14-0AB0 |
as from V3.1 |
all |
Yes |
| CPU317-2PN/DP |
6ES7317-2EK13-0AB0 |
up to V2.3 |
2000 to 5000 |
No |
| CPU317-2PN/DP |
6ES7317-2EK14-0AB0 |
as from V3.1 |
all |
Yes |
| CPU319-3PN/DP |
6ES7318-2EL00-0AB0 |
up to V2.6 |
2000 to 5000 |
No |
| CPU319-3PN/DP |
6ES7318-2EL00-0AB0 |
from V2.7 |
all |
No |
| CPU319-3PN/DP |
6ES7318-2EL01-0AB0 |
from V3.2 |
all |
Yes |
| CPU412-2 PN |
6ES7412-2EK06-0AB0 |
as from V6.0 |
all |
Yes |
| CPU414-3PN/DP |
6ES7414-3EM05-0AB0 |
as from V5.0 |
all |
No |
| CPU414-3PN/DP |
6ES7414-3EM06-0AB0 |
as from V6.0 |
all |
Yes |
| CPU416-3PN/DP |
6ES7416-3ER05-0AB0 |
as from V5.0 |
all |
No |
| CPU416-3PN/DP |
6ES7416-3ES06-0AB0 |
as from V6.0 |
all |
Yes |
| CPU412-5H PN/DP |
6ES7412-5HK06-0AB0 |
as from V6.0 |
all |
Yes |
| CPU414-5H PN/DP |
6ES7414-5HM06-0AB0 |
as from V6.0 |
all |
Yes |
| CPU416-5H PN/DP |
6ES7416-5HS06-0AB0 |
as from V6.0 |
all |
Yes |
| CPU417-5H PN/DP |
6ES7417-5HT06-0AB0 |
as from V6.0 |
all |
Yes |
| CPU 1211C |
6ES7211-1AD30-0XB0 |
as from V1.02 |
all, except:
20, 21, 25, 80 102, 123, 5001, 34962, 34963 and 32964 |
No |
| 6ES7211-1AE31-0XB0 |
from V3.0 |
| 6ES7211-1BD30-0XB0 |
as from V1.02 |
| 6ES7211-1BE31-0XB0 |
from V3.0 |
| 6ES7211-1HD30-0XB0 |
as from V1.02 |
| 6ES7211-1HE31-0XB0 |
from V3.0 |
| CPU 1212C |
6ES7212-1AD30-0XB0 |
from V1.02 |
all, except:
20, 21, 25, 80 102, 123, 5001, 34962, 34963 and 32964 |
No |
| 6ES7212-1AE31-0XB0 |
from V3.0 |
| 6ES7212-1BD30-0XB0 |
from V1.02 |
| 6ES7212-1BE31-0XB0 |
from V3.0 |
| 6ES7212-1HD30-0XB0 |
from V1.02 |
| 6ES7212-1HE31-0XB0 |
from V3.0 |
| CPU 1214C |
6ES7214-1AE30-0XB0 |
from V1.02 |
all, except:
20, 21, 25, 80 102, 123, 5001, 34962, 34963 and 32964 |
No |
| 6ES7214-1AG31-0XB0 |
from V3.0 |
| 6ES7214-1BE30-0XB0 |
from V1.02 |
| 6ES7214-1BG31-0XB0 |
from V3.0 |
| 6ES7214-1HE30-0XB0 |
from V1.02 |
| 6ES7214-1HG31-0XB0 |
from V3.0 |
| CPU 1215C |
6ES7215-1AG31-0XB0 |
from V3.0 |
all, except:
20, 21, 25, 80 102, 123, 5001, 34962, 34963 and 32964 |
No |
| 6ES7215-1BG31-0XB0 |
from V3.0 |
Table 01
If you use the SIMATIC CPU as Modbus client, then there are no restrictions regarding the released port numbers. You can set any remote port of the CPU.
Number of possible communication connections using Modbus/TCP protocol The maximum number of Modbus clients that can be connected to one S7-300 or S7-400 CPU with integrated PROFINET interface is limited by the CPU-specific quantity frameworks. If the CPU with integrated PROFINET interface does not support multiple ports, each local port of the CPU can only be used once, which means that when a communication connection has been established for a local port of the CPU, then you cannot set up another connection through that port.
If a non-multiport CPU is used as Modbus server, then there are two options for establishing communication connections to multiple Modbus clients.
- You parameterize different port numbers for the Modbus server in the Modbus client.
  Bild 01
- All Modbus clients access the Modbus server through Port 502.
In this case, it is necessary to have constant job-controlled establishment and clear-down of connections. The Modbus server can communicate with only 1 Modbus client through Port 502 at any one time. The connection to the first Modbus client must be cleared down and Port 502 released before another Modbus client can access the Modbus server. As soon as Port 502 is released, another Modbus client can access the Modbus server via that port.
Case 01
  Bild 02
Case 02
  Bild 03
  Bild 04
  Bild 05
Additional Information More information about multiport-compatibility is available in the technical data of the CPU.
If the CPU supports multiple passive connections per port for open IE communication, it is multiport-compatible.
| Manual |
Entry ID |
| SIMATIC S7-300 CPU 31xC and CPU 31x: Technical data |
12996906 |
| SIMATIC Distributed IO ET 200S Interface Module IM151-8 PN/DP CPU |
47409312 |
| Automation System SIMATIC S7-400 CPU Specifications |
53385241 |
| SIMATIC S7-1200 Automation System |
36932465 |
Table 02
|