Configuring CPU 315-2 DP as PROFIBUS Slave: Master-Slave Setup

David Krause14 min read
ProfibusSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Configuring CPU 315-2 DP as a PROFIBUS DP Slave: Master-Slave Configuration with MPI-Routed HMI Access

This technical reference describes how to connect two SIMATIC S7-300 CPU 315-2 DP controllers via PROFIBUS DP so that one CPU acts as the DP master and the second CPU acts as a DP slave. It also documents how to wire an HMI panel to the master's MPI port and collect process data from both CPUs using SADD routing. The procedures apply to STEP 7 V5.x projects as well as the equivalent block construction in TIA Portal when migrating older SIMATIC S7-300 stations.

The CPU 315-2 DP integrates two physical interfaces in a single module: an MPI/PROFIBUS-DP combined port (labelled X1, RS-485) and a second dedicated PROFIBUS-DP port (labelled X2, RS-485). Both interfaces can be configured for DP-Master, DP-Slave, or passive DP-Slave operation, which is what makes the master-slave arrangement between two 315-2 DP controllers feasible without external coupler hardware. The same configuration is also used inside compact SIMATIC C7 systems; for example, the SIMATIC C7-633 DP control system integrates a CPU 315-2 DP that explicitly supports master or slave operation on PROFIBUS-DP.

1. Overview of the Target Topology

The network consists of three logical nodes:

  • DP Master CPU — a CPU 315-2 DP (order number 6ES7315-2AFxx or 6ES7315-2AHxx) configured as a DP master on its X2 PROFIBUS port.
  • DP Slave CPU — a second CPU 315-2 DP (same family) configured as a passive DP slave on its X2 PROFIBUS port.
  • HMI panel — an MP/TP/OP panel connected to the master's X1 MPI port; data from the slave is reached via SADD routing through the master.

PROFIBUS DP is used purely for deterministic cyclic I/O exchange between the two CPUs (typically a few words of inputs and outputs mapped into the master's process image). The HMI panel is intentionally kept on MPI so that any firmware update or re-download of the slave project can still be performed from a single programming device that "rides" the master's MPI port and tunnels through to the slave via DP.

2. Prerequisites

2.1 Hardware

Item Recommended Specification Notes
Master CPU 6ES7315-2AF03-0AB0 or later Firmware V2.0 or higher recommended for full S7 routing
Slave CPU 6ES7315-2AF03-0AB0 or later Same family simplifies spare-part stocking
PROFIBUS cable 6XV1830-0EH10 (Fast Connect, violet) Characteristic impedance 150 Ω
PROFIBUS connectors 6GK1500-0FC00 (with PG socket) or 6GK1500-0EA02 Switch terminating resistor ON at both ends only
Repeater (optional) 6GK1500-3AA00 Use if cable length > 1 km at 1.5 Mbit/s
HMI panel TP/MP 177, OP/TP 277 or later WinCC flexible 2005 SP1 or higher recommended
Programming device PC with MPI/DP adapter (PC Adapter USB 6GK1571-1AA00) Required for STEP 7 commissioning

2.2 Software

Tool Version Purpose
STEP 7 (SIMATIC Manager) V5.4 SP5 or V5.5 Hardware configuration, NetPro, S7 program
S7-PCT (Port Configuration Tool) V2.4 or higher Optional: DP-Slave slot definition via GSD
ProTool/Pro or WinCC flexible ProTool V6.0 SP3 or WinCC flexible 2005 SP1+ HMI project with SADD routing enabled
WinCC (classic) Not supported Classic WinCC cannot route across DP-to-MPI via a CPU
Compatibility note: Routing an HMI from MPI to a DP-attached CPU works in ProTool V6 and in WinCC flexible 2005 (and later), but does not work in classic WinCC. If your HMI tool is classic WinCC, replace it with WinCC flexible or WinCC Comfort/Advanced before continuing.

3. CPU 315-2 DP Interface Details

The CPU 315-2 DP exposes two nine-pin sub-D female connectors labelled X1 and X2. Understanding their default role is essential because STEP 7's interface selection directly determines which mode is active.

Interface Default Role Selectable Modes Typical Use
X1 (MPI/DP combined) MPI (address 2) MPI, DP-Master, DP-Slave Programming device, HMI, MPI network
X2 (PROFIBUS-DP) None (must be assigned) DP-Master, DP-Slave Distributed I/O, second CPU, drives

At 1.5 Mbit/s (the default DP bus speed) the maximum segment length is 200 m; at 187.5 kbit/s it is 1,000 m. Choose the lower speed when mixing older DP slaves or when extending the segment across plant floors.

4. PROFIBUS DP Master-Slave Concept

In a PROFIBUS DP master-slave relationship, the master polls the slave cyclically. The slave never initiates communication. From the master's perspective the slave is simply a "virtual" DP device with a fixed number of input and output bytes. From the slave's perspective the master is a DP master to which a slave must declare its I/O footprint using a GSD file or via STEP 7's DP-Slave component definition.

Three configurations are possible on the CPU 315-2 DP:

  1. DP-Master (DPM): the CPU owns the bus token and exchanges data with DP slaves.
  2. DP-Slave (DPS): the CPU only responds when addressed; it cannot initiate any DP transfer.
  3. Passive DP-Slave: identical to DP-Slave but the CPU cannot be parameterised by STEP 7 through the DP segment unless a routing-capable master is on the same bus.

For CPU-to-CPU cyclic exchange, mode (2) or (3) on the slave CPU is appropriate. The master CPU uses mode (1).

5. STEP 7 NetPro Configuration — Master Side

  1. Open the SIMATIC Manager and create a new project (File > New > Project). Insert a SIMATIC 300 Station for the master CPU.
  2. Open the HW Config of the master station and insert a RACK-300, then a PS-307, then a CPU 315-2 DP. Double-click the X2 (DP) row of the CPU and select PROFIBUS(1) as the interface type with DP master role.
  3. Assign the master PROFIBUS address 2 and a bus profile of 1.5 Mbit/s.
  4. In NetPro (button "Network" or menu Options > Configure Network) right-click the CPU and select "Insert New Connection". Choose "CPU-to-CPU (S7 Connection)" only if you want open S7 communication (PUT/GET, BSEND/BRCV). For pure cyclic I/O mirroring, no S7 connection is needed; the slave is inserted as a DP slave instead.
  5. To insert the second CPU as a DP slave, switch back to HW Config of the master station, open the PROFIBUS(1) subnet and drag a CPU 31x entry from the hardware catalog under "PROFIBUS-DP > SIMATIC 300 > CPU 31x" into the bus line. A DP-slave pairing dialog appears.
  6. In the pairing dialog select the slot that defines the slave's I/O footprint. A typical default provides 32 bytes of inputs and 32 bytes of outputs; reduce this to the real requirement (e.g., 8 in / 8 out) to shorten bus cycle time.

6. STEP 7 NetPro Configuration — Slave Side

  1. In the same project, insert a second SIMATIC 300 Station (File > Insert > Station > SIMATIC 300). This becomes the DP slave CPU.
  2. Open its HW Config and insert a RACK-300, PS-307, and a CPU 315-2 DP. Double-click the X2 (DP) row and choose PROFIBUS(1) with role DP slave. Set slave PROFIBUS address 3.
  3. Assign the same bus profile (1.5 Mbit/s) used on the master.
  4. Insert your application program blocks (OB1, FB/FC, DB). The process data that must be exchanged is moved into the I/O area you selected in step 5 of section 5. For example, if the slave exposes inputs starting at PIW 256, copy your data into a DB and use SFC 14 (DPRD_DAT) only if you used a DP-V1 slot; for the classic CPU-to-CPU DP-Slave mode used here, direct process-image access is sufficient.
  5. Save and compile (Station > Save and Compile). The download to the slave CPU can be performed either through the master's MPI port (SADD routing) or via a separate programming cable on the slave's MPI.

7. HMI Routing (SADD Concept)

SADD routing allows a panel configured with the master's MPI node to read or write tags that physically live in the slave CPU. STEP 7 implements this through a "S7 connection" with the Active Connection Establishment flag disabled on the slave and enabled on the master, while the panel uses a single "Routing" connection type.

7.1 Configuring the Routing Connection in NetPro

  1. In NetPro select the master CPU, right-click and choose "Insert New Connection".
  2. Pick the slave CPU as the partner. The connection type is S7 connection.
  3. In the connection properties, tab "General", confirm:
    • Local ID = 1 (auto-assigned)
    • Partner address = PROFIBUS address 3
    • Connection path traverses the PROFIBUS subnet
  4. Generate and download the routing table (Options > Configure Network > Download to all Stations).

7.2 Configuring the HMI Project

  1. Open WinCC flexible (or ProTool). Create a new project.
  2. In the connection editor add a connection with type SIMATIC S7-300/400, protocol S7 Routing, point to the master CPU's MPI address (2), and specify the partner's PROFIBUS address (3) inside the routing extension. The wizard field "Partner CPU / Routing via" defines which intermediate node forwards the request.
  3. Repeat for the master CPU without routing enabled for direct master tags.
  4. Compile and transfer the HMI project. The panel now lists two connections: one direct, one routed.
Routed downloads: When the panel is on MPI, STEP 7 can download to both CPUs over a single PG cable, because the master's MPI acts as a gateway into the PROFIBUS segment. This is the technique referenced in field deployments that combine the master CPU with two motion slaves plus an OP panel on MPI.

8. Cyclic I/O Handshake Sample

The following snippets show how to exchange 8 bytes in each direction between the two CPUs. The master writes to the slave's outputs at PQB 256..263, and reads the slave's inputs at PIB 256..263. The slave does the same with PIW/PQW at the same offset.

8.1 Master CPU — OB1 Excerpt (STL)

      L     DB10.DBW 0        // Master setpoint word 1
      T     PQW 256           // -> Slave PIB 256
      L     PIB 256           // Slave status word 1
      T     DB10.DBW 2        // Store in master DB

8.2 Slave CPU — OB1 Excerpt (STL)

      L     PIB 256           // Master setpoint word
      T     DB20.DBW 0
      L     DB20.DBW 2        // Slave status word
      T     PQW 256           // -> Master PIB 256

The bus cycle time tcycle for the configuration above with 8 input + 8 output bytes at 1.5 Mbit/s is approximately 1.5 ms plus the slave's DP-Slave response time (typically < 1 ms). For full PROFIBUS cycle calculations refer to PROFIBUS DP Cycle Time in the Siemens STEP 7 online help.

9. Verification & Diagnostics

9.1 Online Diagnostics in STEP 7

  1. Open HW Config of the master, right-click the slave CPU in the PROFIBUS line and select "Monitor/Modify".
  2. Status "OK" and green icon confirm successful DP-Slave parameter assignment. A yellow triangle indicates a parameter mismatch (typically different bus profile or GSD revision).
  3. Use the diagnostic buffer of the slave CPU (CPU > Module Information > Diagnostic Buffer) to inspect DP-V0 events. Event ID 3942 means "DP slave not found", 3943 means "DP slave parameter error".

9.2 LED Indicators on the CPU 315-2 DP

LED State Meaning
SF (red) On Group fault (diagnostic buffer entry)
BF (red, X2) Flicker Bus fault, slave not reachable
BF (red, X2) Steady on No DP master active on segment
RUN (green) Flashing 2 Hz CPU in STOP, DP slave is ready
RUN (green) Steady CPU in RUN, DP slave is operating

9.3 HMI Tag Test

  1. On the panel, enter the service menu and select “Tag diagnosis” (WinCC flexible) or “Tag simulation” (ProTool).
  2. Force a bit in the master DB and verify that the slave receives it within one bus cycle.
  3. Force a bit in the slave DB and verify that the panel updates its routed tag within the configured update time (default 1 s).

10. Troubleshooting Matrix

Symptom Likely Cause Action
BF LED steady on at master X2 No slave responding Check PROFIBUS connector terminating resistor, cable polarity, slave address
BF flickering at master X2 Intermittent slave communication Verify baud rate and bus profile match both CPUs
Diagnostic buffer 3942 Slave address not in master's project Re-add slave to HW Config of master
Diagnostic buffer 3943 Parameter mismatch Match I/O slot length and consistency between master and slave
Panel shows “Connection failed” to slave SADD routing not downloaded Re-download routing table from NetPro
Panel shows “Connection failed” to slave (WinCC classic) WinCC classic cannot route Migrate HMI project to WinCC flexible
PG cannot download to slave via master MPI Master firmware too old Upgrade master CPU firmware to V2.x or higher
Bus cycle time longer than expected Too many I/O bytes assigned Reduce slot length in master HW Config
Slave CPU in STOP after power cycle Master not yet on bus during slave boot Power master first, then slave; alternatively enable slave startup without cyclic exchange

11. Compatibility Notes and Migration

11.1 ProTool vs WinCC flexible vs WinCC (classic)

Routing the HMI across an MPI/DP boundary is supported by:

  • ProTool V6.0 SP3 and later — the connection must be defined explicitly as "Routing" in ProTool and the master must be a CPU that supports S7 routing (CPU 314, CPU 315-2 DP, CPU 317, CPU 319).
  • WinCC flexible 2005 SP1 and later — same routing concept; multiple routed connections are possible.
  • WinCC (classic, V7.x) — routing across DP-to-MPI is not supported. Use WinCC flexible or migrate to TIA Portal.

11.2 TIA Portal Equivalent

When porting the project to TIA Portal (V13 SP1 or higher), the topology is identical: two S7-300 stations connected by a PROFIBUS subnet, the slave CPU configured as a DP-Slave in Devices & Networks, and a Comfort/Advanced panel with two HMI connections (one direct, one routed). The SADD routing is configured automatically when the connection path traverses the PROFIBUS subnet and the master CPU is online.

11.3 Use Cases

The same configuration pattern is field-proven for the following applications:

  • Two-axis motion slaves each running FM 353/354 positioning modules, controlled by a master CPU that hosts the HMI and additional remote I/O on the same DP segment.
  • Master CPU 314C-2 DP gathering fast local I/O on MPI while routing data to/from an IM 151-1 DP slave station on the backplane bus.
  • C7-633 DP acting as a compact master controller with two additional C7-633 DP units acting as slaves, sharing recipe data and status.

12. Field-Proven Cautions

  1. Terminating resistors: Only the first and last physical device on the PROFIBUS segment may have the terminating resistor ON. With two CPUs and a panel on MPI this is rarely a problem, but when adding a repeater, double-check its DIP switches.
  2. Address uniqueness: Set the master PROFIBUS address to 2, the slave to 3, and never assign an MPI address that collides with a DP address on the same physical node. CPUs interpret the number as DP if the port is in DP mode.
  3. Bus profile: Mixing 1.5 Mbit/s and 12 Mbit/s on the same segment is impossible; profile must be uniform.
  4. Cable shielding: Connect the cable shield at every connector clamp; leave the shield ungrounded at the panel side if the panel is far from the cabinet to avoid ground loops.
  5. STEP 7 version drift: Older SP versions of STEP 7 V5.4 do not always download the routing table correctly. Use V5.4 SP5 or V5.5 to be safe.
  6. Power-on sequence: Power the master first so that the slave sees a valid master during its own boot, otherwise the slave may enter STOP with diagnostic buffer entry "DP master not found".

13. Quick Commissioning Checklist

  • [ ] Master CPU 315-2 DP powered first, X2 in DP-Master mode, address 2
  • [ ] Slave CPU 315-2 DP powered second, X2 in DP-Slave mode, address 3
  • [ ] Bus profile 1.5 Mbit/s identical on both stations
  • [ ] Terminating resistors ON only at the two extreme nodes
  • [ ] HW Config of master includes the slave as a DP-Slave with correct slot length
  • [ ] NetPro S7 connection between master and slave downloaded to both CPUs
  • [ ] Panel connection defined as "Routing" with partner PROFIBUS address 3
  • [ ] HMI transfer tested for both direct and routed connections
  • [ ] Cyclic I/O loopback verified with simple counter increment
  • [ ] Diagnostic buffer of slave contains no entries after one hour of operation

Can a CPU 315-2 DP act as both master and slave on the same bus?

No. A single PROFIBUS interface can only occupy one role at a time. Use X2 as master on the master CPU and as slave on the slave CPU. If you need a CPU that masters one segment and slaves on another, use the X1 interface (MPI/DP) in DP-Slave mode and the X2 in DP-Master mode on different physical segments.

What is the maximum PROFIBUS bus address for a CPU 315-2 DP slave?

PROFIBUS DP allows addresses 0–127, but the CPU 315-2 DP supports addresses 1–125 in DP-Slave mode. Address 0 is reserved for class-2 masters (programming devices), address 126 is reserved for the "automatic address assignment" service.

Does classic WinCC support routing an HMI from MPI to a DP-attached CPU?

No. Classic WinCC (V7.x) cannot route HMI traffic across DP-to-MPI through a CPU. Use WinCC flexible 2005 SP1 or later, or migrate to TIA Portal with WinCC Comfort/Advanced.

How many bytes can a CPU 315-2 DP exchange as a DP slave?

The CPU 315-2 DP supports up to 244 bytes of inputs and 244 bytes of outputs as a DP slave. For two CPU-to-CPU links, 8–32 bytes per direction is more than enough and keeps the bus cycle time short.

Why does the slave CPU stay in STOP after power-on?

The most common reason is that the master CPU is not yet on the bus when the slave boots, so the slave enters STOP with diagnostic entry "DP master not found". Power the master first, wait until its RUN LED is steady green, then power the slave. Alternatively, enable the slave's startup without cyclic exchange in its HW Config.

Can I download the slave program through the master's MPI port?

Yes, as long as the master CPU firmware supports S7 routing (firmware V2.0 or higher on the 315-2 DP) and NetPro has downloaded the routing table to both stations. Connect the PG to the master MPI, select the slave in STEP 7, and choose Download. The transfer traverses MPI → master CPU → DP → slave CPU.

Back to blog