Overview
A recurring question in S7-300 system design is whether a single Siemens CPU 31x can simultaneously operate as a PROFIBUS DP Master to one set of stations and as a DP Slave to a higher-level Master. The short answer is no, not on a single physical port. The "×2DP" label found on the front panel of CPUs such as the 313C-2DP, 314C-2DP, 315-2DP, 317-2DP, and 319-3PN/PN does not indicate "dual-function PROFIBUS". It is a port-index designator: the second onboard interface. The first interface (×1) is MPI/DP combined, and the second interface (×2DP) is a dedicated PROFIBUS DP port. Each physical DP port can assume exactly one Class 1 role (DP Master or DP Slave) at a time.
Hierarchical PROFIBUS structures — where a CPU31x is itself a slave of a higher-level controller (for example, an S7-400 or S7-1500) and is also a master to its own ET 200S, SINAMICS, or third-party devices — are entirely legitimate. They simply require two independent DP interfaces, either on the CPU itself (a 315-2DP, 316-2DP, or 317-2DP provides two DP ports natively) or by adding a SIMATIC CP 342-5 communications processor to CPUs that only have one. This reference explains the port naming convention, the PROFIBUS role mechanics, the hardware and software options for combined Master/Slave operation, the network limits, and the diagnostic behavior to expect when the configuration is correct.
Decoding the ×2DP Label on a CPU31x Front Panel
The label "X2DP" engraved next to a 9-pin Sub-D socket on a CPU 31x has caused confusion for two decades. The interpretation is strictly positional: it means "Port 2 — DP". Port 1 is normally labeled X1 and is the combined MPI/PROFIBUS interface. The "2" is the second physical port on the module, not a statement about capability.
| CPU (example) | Order Number (typical) | Port 1 (X1) | Port 2 (X2DP) | Master/Slave Both? |
|---|---|---|---|---|
| CPU 312 | 6ES7 312-1AE14-0AB0 | MPI | — (none) | No |
| CPU 313C | 6ES7 313-5BF03-0AB0 | MPI/DP | — (none) | No |
| CPU 313C-2DP | 6ES7 313-6CF03-0AB0 | MPI/DP | DP only | No (single DP port) |
| CPU 314C-2DP | 6ES7 314-6CG03-0AB0 | MPI/DP | DP only | No (single DP port) |
| CPU 315-2DP | 6ES7 315-2AG10-0AB0 | MPI/DP | DP only | Yes (two DP ports) |
| CPU 315-2 PN/DP | 6ES7 315-2EH14-0AB0 | MPI/DP | DP only | Yes (two DP ports) |
| CPU 317-2DP | 6ES7 317-2AJ10-0AB0 | MPI/DP | DP only | Yes (two DP ports) |
| CPU 319-3 PN/DP | 6ES7 318-3EL01-0AB0 | MPI/DP | DP only + PN | Yes (DP + PN) |
Critical detail: a CPU with a single PROFIBUS-DP port (313C-2DP, 314C-2DP) cannot by itself be a Class 1 Master and a Class 1 Slave on the bus at the same time. The role is selected at configuration time in STEP 7 / TIA Portal and locked to that port for the life of the project.
Why a Single PROFIBUS Port Cannot Be Both Master and Slave
PROFIBUS DP is governed by the token-passing protocol defined in IEC 61158 / EN 50170 (Volume 2, PROFIBUS DP). Active stations (Class 1 Masters) form a logical token ring; the token grants the right to initiate data transfer on the bus for a configured time. A Class 1 Master that holds the token polls its assigned slaves in a deterministic cycle. A DP Slave has no token, has no right to initiate, and only responds when polled.
The state machine of the FDL (Fieldbus Data Link) layer permits a single physical node to be either a token holder (active) or not (passive). The DP-V0/V1 specification allows a node to declare itself a Master or a Slave; mixing both on one MAC address would require two concurrent state machines, two address entries in the live list, and two completely different bus parameter sets. This is not defined behavior and is not supported on any S7-300 DP port.
Hardware Strategies for Combined Master and Slave Operation
There are three practical ways to give a CPU 31x both a Master and a Slave function:
- Choose a CPU with two DP ports. The 315-2DP, 316-2DP, 317-2DP, and 319-3 PN/DP have two DP-capable interfaces out of the box. Configure Port 1 as a DP Slave to the upstream controller and Port 2 as a DP Master to your local slaves.
- Add a CP 342-5. When the chosen CPU only has one DP port (313C-2DP, 314C-2DP), install a CP 342-5 in the rack. The CP carries the second DP network and can be configured as either a DP Master or a DP Slave independent of the CPU's onboard port.
- Use a CP 342-5 FO on a fiber segment. For electrically noisy environments or long distances (> 1000 m to 15 km depending on fiber type), the CP 342-5 FO variants (e.g., 6GK7 342-5DF00-0XE0) provide an integrated fiber-optic PROFIBUS interface that can be Master or Slave.
The CP 342-5 family is a slot-limited module (1 slot, 24 V powered) and is recognized by STEP 7 as a "CP 342-5" with its own PROFIBUS address and GSD. Communication between the CPU user program and the CP is done via a Siemens-supplied Function Block (FC) pair (e.g., DP_SEND / DP_RECV for the Master, or a pre-built slave FB). This means the data transfer is not directly mapped to the process image; the application must call the FCs in OB1 or a cyclic OB.
| Module | Order Number | Function | Max Slaves / Data |
|---|---|---|---|
| CP 342-5 | 6GK7 342-5DA02-0XE0 | DP Master or Slave, RS-485 | DP-V0 master, 32 slaves typical, up to 244 bytes I/O per slave |
| CP 342-5 FO | 6GK7 342-5DF00-0XE0 | DP Master or Slave, fiber | Same as above; POF/PCF/SMF via OLM |
| CP 343-5 | 6GK7 343-5FA01-0XE0 | DP Master for S7-300 with PN/PN | DP-V1 master, 124 slaves |
Configuring the CP 342-5 Communications Processor
Configuration is identical in STEP 7 V5.x and in TIA Portal (V13 and later). The CP appears in the hardware catalog under SIMATIC S7-300 > CP-300 > PROFIBUS.
- Drag the CP 342-5 onto an empty slot in the S7-300 rack in HW Config (STEP 7) or the Device View (TIA Portal).
- Open the CP's properties and create a new PROFIBUS subnet (or assign it to an existing one). Set the CP's PROFIBUS address; this must be unique on that segment.
- Select the operating mode: DP Master or DP Slave. If the CP is the Master, you will then add slaves from the catalog onto its subnet.
- If the CP is a Slave, import the GSD file of the higher-level Master (right-click the subnet, "Install GSD") and drag the CP into the Master project's slot. Map the I/O areas to be exchanged.
- For data exchange between the CPU user program and the CP, insert the Siemens FCs from the standard library. For Master mode, use
FC1 "DP_SEND"andFC2 "DP_RECV"from the "CP 342-5" library. For Slave mode, useFC3 "DP_SEND"andFC4 "DP_RECV".
Data consistency: The CP 342-5 buffers up to 240 bytes per transfer. Set the DONE, ERROR, and STATUS outputs of the FCs to monitor handshake; STATUS = 8183H indicates a job is still running, STATUS = 8180H indicates a job error.
Hierarchical PROFIBUS Network Topologies
Hierarchical DP structures are common in large plants. Typical patterns:
- Master-to-Master coupling: A 417-4 acts as the cell Master; the CPU 317-2DP sits underneath as a slave on one port and as a master to its own ET 200S ring on the second port.
- Line-suspended sub-master: A CPU 315-2DP at a remote skid is a Slave of the plant Master on Port 1, and a Master of an IM 151-1 on Port 2 that gathers local I/O.
- CP-expanded sub-master: A CPU 313C-2DP is a Slave of an S7-400 on its onboard ×2DP, and adds a CP 342-5 as the Master for local drives and an ET 200M.
Note that the PROFIBUS address 5 is used on both sub-master ports because each port is a separate physical segment with its own address space. Each segment must be terminated at both ends with the standard 9-pin terminator that is either a switched-on terminating resistor in the last device or the Siemens PROFIBUS connector with the switch set ON.
Configuration Procedure in STEP 7 and TIA Portal
STEP 7 V5.x (SIMATIC Manager)
- Open HW Config for the S7-300 station.
- Double-click the onboard X2DP port of the CPU. In Interface > Type, choose PROFIBUS, set the address, and click Properties to enter the subnet's baud rate and bus parameters (use "DP" profile, 1.5 Mbps typical, Tslot = 300 bit-times default).
- Switch to the Operating Mode tab. Choose either DP Master or DP Slave. For a Slave, also configure the I/O transfer area (e.g., 16 bytes input, 16 bytes output) which becomes the data the upstream Master exchanges with this CPU.
- If the CPU has only one DP port, insert a CP 342-5 in the rack and repeat the configuration on its DP interface. The CP's role is independent of the CPU's onboard role.
- Compile and download the hardware configuration. The new role takes effect after the CPU is restarted (STOP → RUN).
TIA Portal (V16 or later)
- Open the Device View of the S7-300 CPU. The two ports are listed under the CPU's properties.
- For each port, expand PROFIBUS interface > Operating mode. Choose DP Master or DP Slave in the dropdown.
- For Master mode, drag slaves from the catalog onto the subnet. For Slave mode, use Network view > Assign master to connect the port to a higher-level Master and map the I/O transfer area.
- If adding a CP 342-5, insert the device, repeat the role selection on the CP's port, and use the supplied FB (e.g.,
SLAVE_PNwrapper) in the user program.
Addressing Limits, Repeaters, and Segment Planning
PROFIBUS DP allows up to 126 station addresses (0 to 125 usable; 126 is reserved for broadcast, 127 for the "gap" — typically unused). The 125-station question that often arises (for example, when 125 stations are to be connected without a repeater) is more constrained than the address space suggests.
| Constraint | Value | Notes |
|---|---|---|
| Stations per segment (no repeater) | 32 | Includes Masters, Slaves, and repeaters. Each segment also requires terminator power from the two end stations. |
| Total stations on a single PROFIBUS line | 126 (addresses 0–125) | Address 0 and 1 are typically left empty for service tools; address 126/127 reserved. |
| Max cable length per segment @ 1.5 Mbps | 200 m | Type A cable, 0.34 mm² (22 AWG), Belden 3079A or equivalent. |
| Max cable length per segment @ 187.5 kbps | 1000 m | Same cable type. |
| Max cable length per segment @ 12 Mbps | 100 m | For high-speed, short-distance backbones. |
| Max segments chained via RS-485 repeaters | 9 (10 segments total) | Per PROFIBUS specification; 8 repeaters in series between any two nodes max. |
For 125 slaves, a typical architecture is one CPU 31x (or 400) acting as Master with a 6GK1 500-0AB10 RS-485 repeater after every 31 slaves, giving 4 segments of 32 = 128 station capacity. The repeater acts as a signal regenerator and isolates segments electrically. For diagnostic insight per segment, use the 6GK1 500-3AB10 diagnostic repeater, which reports segment quality via a web interface.
Diagnostic Indicators and Bus Fault Handling
When the CPU 31x is configured as both a Slave and a Master (using two ports), each port has its own status LEDs and diagnostic behavior. On the S7-300 front panel:
- SF (red): Group fault. Lights if any OB with error information is triggered or if the DP slave interface has a configuration mismatch.
- BF (red, DP port): Bus fault on the DP interface. Lit steady = physical layer problem (broken cable, missing terminator, short). Flashing = slave is not exchanging data (wrong address, wrong GSD, slave is in power-on state).
- RUN (green): CPU in RUN; both ports operating normally.
Program the OBs that catch DP faults:
-
OB82— Diagnostic interrupt. Triggered when a DP slave reports a diagnostic change (e.g., channel-level short circuit on an ET 200S module). The starting information contains the DP master diagnostic address and the slave's I/O slot that raised the alarm. -
OB86— Rack failure. Triggered when a DP slave fails to respond (station failure) or returns (station return). UseOB86_EV_CLASSandOB86_MDL_ADDRto identify which slave is affected. -
OB122— I/O access error. Triggered when the user program reads or writes a slot that the configured slave is not currently providing (typically after a slave station failure but before OB86 is processed).
For the CP 342-5, diagnostics come back through the FC status words rather than OBs. STATUS = 8180H (hex) signals a job error; STATUS = 8183H signals a job in progress. Always read both DONE and ERROR rather than relying on a single flag.
Verification and Commissioning Checklist
- After download, perform a CPU STOP-to-RUN transition. The BF LED on each DP port must extinguish within the configured bus startup time (default ~3 s).
- In STEP 7: PLC > PROFIBUS > Diagnostics > Bus Members shows all active stations with their address and the live list. Slaves in the live list but not in the configuration appear in red; configured slaves not in the live list appear in red and absent.
- For the Slave port: the higher-level Master must see this CPU in its own live list. Check the Master's diagnostic buffer for "Slave X with diagnostic interrupt — station failure / return".
- For the Master port: from the CPU's standpoint, every configured slave must show in the live list. Use the standard
"DP_DIAG"library function block (SFC 13 / SFB 52) to read diagnostic data on demand. - Force a cable disconnect on a slave and verify that
OB86is called and the BF LED on the master port flashes. Reconnect and verify the return event.
Can a CPU 313C-2DP be both a PROFIBUS Master and a Slave at the same time?
No. The 313C-2DP has only one PROFIBUS port (X2DP), and that port is configured at design time as either a DP Master or a DP Slave. To perform both roles, either upgrade to a CPU with two DP ports (315-2DP, 317-2DP) or add a CP 342-5 to obtain a second independent PROFIBUS interface.
What does the "×2DP" label on the front of my S7-300 CPU actually mean?
It identifies the second physical interface of the module (port 2), which is dedicated to PROFIBUS DP. The first interface (×1) is the combined MPI/PROFIBUS port. The "2" is a positional designator, not an indicator of dual function or two simultaneous DP roles.
Does ticking "Test, commissioning, routing" on a DP-Slave port make it a Master too?
No. That option enables a transient Class 2 Master role used only to allow STEP 7 / TIA Portal to go online through a slave port. It is not a production Master role, does not perform cyclic I/O exchange with slaves, and disappears when the CPU is restarted in normal operation. Plan your production topology using a second physical port, not this option.
How many DP slaves can a CPU 31x Master port control?
A DP-V0 CPU 31x port typically supports up to 32 slaves per segment, with up to 125 usable addresses on the entire logical line when repeaters are used. The CP 342-5 master supports DP-V0 only; the CP 343-5 (newer family) supports DP-V1 for acyclic services such as SINAMICS parameter access.
Why does my BF LED flash after a topology change, and how do I clear it?
A flashing BF LED on a DP master port means the configured slave is not in the live list. Check that the slave's PROFIBUS address matches the configuration, the GSD file is loaded, the bus terminators are ON at both ends, and the cable length is within the baud-rate limit. The diagnostic buffer entry contains the station address and the failure reason. Once the slave responds, the BF LED extinguishes without a CPU restart.