Coupling a PROFIBUS DP Slave to S7-300 HW Config in STEP 7

David Krause13 min read
ProfibusSiemensTroubleshooting
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

Coupling a PROFIBUS DP Slave to an S7-300 Master in STEP 7 HW Config

The most common PROFIBUS master-slave integration failure on S7-300 stations is not the wiring, the GSD file, or the address switch — it is the missing MS (Master-Slave) coupling entry in the master HW Config. STEP 7 will not accept an S7-31x as a slave until the master station references it as a Configured Station and links a transfer area to the slave's I/O. This article walks through the full coupling procedure using a S7-315-2DP as master and a S7-313C-2DP as slave, with optional CP343-1 Lean on the slave side, and explains how to verify the link both offline and online.

Applies to: STEP 7 V5.4 / V5.5 / V5.6 with S7-300 CPUs carrying an integrated DP interface (order suffix -2DP). For S7-1200 PROFIBUS coupling in TIA Portal V20, see the Siemens online help at Configuring PROFIBUS DP (S7-1200) - STEP 7. The procedure below targets the S7-300 / S7-400 toolchain.

1. Problem Description

A station that is physically on the PROFIBUS segment and visible in Accessible Nodes (Online → Accessible Nodes) refuses to couple in HW Config. Typical symptoms:

  • The slave is visible in Accessible Nodes with the correct PROFIBUS address (for example 12).
  • Adding the device from the PROFIBUS catalogue forces a new address (for example 14); changing the address back to 12 returns the error "Address 12 is already in use by another station".
  • The slot inside the master CPU properties where the DP master system is configured does not list the new slave.
  • The MS Config tab of the slave CPU reports "No transfer area configured", and the project will not compile until at least one transfer area is defined.
  • After downloading, the slave does not appear in the master's online view of the DP master system even though the BF (Bus Fault) LED is off.

Root cause: the slave has not been added as a DP slave that is an S7 station (i-Slave). STEP 7 differentiates between a "passive" DP slave (added by GSD) and an i-Slave (intelligent slave) which is another S7 CPU on the bus. The master project must reference the slave's SDB through the Configured Station mechanism, not simply place a new device at the same address.

2. Architectural Constraint: One PROFIBUS Role per Integrated Port

An S7-300 CPU with an integrated DP port can be configured as DP master or DP slave, but not both simultaneously. The two roles are mutually exclusive on the same physical port. If a station must act as a slave to a higher-level master and as a master to its own lower-level slaves, you have two options:

  1. Use a second PROFIBUS interface (e.g., add a CP342-5) and configure the integrated port as slave, the CP as master.
  2. Keep the integrated port as the slave port to the higher-level master and accept that no further DP slaves can hang off this CPU in the same project.

This is the exact situation in the source case: the S7-313C-2DP acts as a slave to the S7-315-2DP master, and the S7-313C-2DP is itself a master in a separate project for its own subordinate devices. The two projects never coexist on the same integrated DP port.

3. Prerequisites

  • STEP 7 V5.4 or later with the HW Config editor open against the master CPU's project.
  • The slave station's HW Config (in its own STEP 7 project) has been configured and downloaded at least once so that the slave's PROFIBUS interface is in the correct operating mode (DP Slave).
  • Both CPU types and order numbers (MLFBs) are present in the STEP 7 Hardware Catalogue. For a 6ES7 313-6CG04-0AB0 (S7-313C-2DP with combined MPI/DP), the catalogue path is SIMATIC 300 → CPU 300 → CPU 313C-2 DP.
  • The PROFIBUS network object (the bus segment) is defined once per project with consistent baud rate (typically 1.5 Mbps) and consistent profile (DP / Universal).
  • The target slave's PROFIBUS address (e.g., 12) is reserved in the master's PROFIBUS address space and does not clash with any other DP node.

4. Master-Slave Coupling Procedure (i-Slave Method)

The correct catalog path to add an S7-300 CPU as a smart / i-slave to a DP master in STEP 7 is PROFIBUS DP → Configured Stations → S7-300 CPV3 / S7-300 CPV4 / S7-31x. Do not drag the CPU from SIMATIC 300 → CPU 300 directly onto the DP master system — that places a brand-new master on the bus, not a slave.

4.1 Insert the Slave as a Configured Station

  1. In HW Config, open the master station (e.g., the S7-315-2DP).
  2. Select the DP master system row on the master CPU (the row beginning with DP under slot 2 or 3, depending on the CPU type).
  3. In the Hardware Catalogue, expand PROFIBUS DP → Configured Stations and locate S7-300 CPV3 (or S7-31x for older STEP 7 versions). Double-click or drag it onto the master DP system.
  4. The Properties – PROFIBUS Interface dialog opens. Assign the slave's PROFIBUS address (12 in the source case) and click New if asked to create a subnet — usually the existing subnet is selected.
  5. Click OK. The slave now appears in the master station's HW Config with a default slot assignment.

4.2 Couple the Slave to the Master DP System

  1. Double-click the newly placed Configured Station symbol in the master HW Config.
  2. The properties dialog has a Coupling tab. In older STEP 7 versions this is on the slave CPU's DP properties, in newer versions on the Operating Mode tab — set mode to DP Slave.
  3. In the slave's DP properties, switch to the MS Config (Master-Slave Configuration) tab.
  4. Click New to create at least one transfer area. The minimum requirements are:
    • Master → Slave: input area on the master, output area on the slave (e.g., Master IW 0..7 → Slave QW 0..7).
    • Slave → Master: input area on the slave, output area on the master (e.g., Slave IW 0..7 → Master QW 0..7).
  5. If no real data exchange is required yet, define a single Consistent transfer area with a length of 1 word to satisfy the compiler. The data can be overwritten later.
  6. Compile and save the master project (Station → Save and Compile).
Compile rule: STEP 7 refuses to build a master project with an S7-31x i-slave that has zero transfer areas. The error reads "No transfer area configured for i-slave coupling". Always declare at least one area, even if the I/O is unused.

4.3 Mirror the Configuration in the Slave Project

The transfer areas defined on the master side must be mirrored in the slave's own HW Config:

  1. Open the slave project (the S7-313C-2DP's own STEP 7 project).
  2. Select the slave CPU's integrated DP interface and open its Properties.
  3. On the MS Config tab, ensure Operating Mode is DP Slave (this is a hard switch — toggling it requires recompilation and download).
  4. Add the same transfer areas with swapped directionality: what the master calls Output is the slave's Input, and vice versa.
  5. Compile and save the slave project.

This mirror is essential. The SDBs (System Data Blocks) generated by the two projects must be consistent. If the slave SDB does not match the master's view, the slave will appear online with status "Configuration error" and the master will report "Slave not found" in the diagnostic buffer (event ID 3944 / 3945).

5. Downloading the SDBs to Both PLCs

Many engineers assume that downloading the master HW Config also writes the slave's SDB. It does not. The SDB generated for the master contains only the master's view of the bus; the slave requires its own SDB generated from the slave project.

  1. Connect to the master PLC (S7-315-2DP). In HW Config, click PLC → Download to Target Station. Select the entire station. Confirm the dialog that asks whether the slave SDB should also be written — answer No if the slave is on a different physical PG connection, otherwise the download will time out.
  2. Switch the PG/PC interface to the slave PLC's PROFIBUS address (12). Open the slave's HW Config in its own STEP 7 project. Click PLC → Download to Target Station. This writes the slave SDB containing the MS transfer areas.
  3. After both downloads, power-cycle the slave or run a STOP→RUN transition so it re-evaluates the new SDB.

If the slave is not directly reachable from the engineering station (e.g., it is downstream of a router or only visible through a CP), you can write the slave SDB over the backplane from the master using the PLC → Download Slave SDB function in some STEP 7 versions. If this option is greyed out, the only reliable path is a direct MPI/DP connection to the slave.

6. Dynamic Activation and Deactivation with SFC12 "D_ACT_DP"

Once the coupling is in place, the master polls the slave on every DP cycle. To stop polling without removing the slave from the configuration, call SFC12 "D_ACT_DP" with mode = 0 (deactivate) or 1 (activate). This is the official Siemens-recommended way to bring an i-Slave in and out of service at runtime.

Parameter Declaration Type Description
REQ INPUT BOOL Edge-triggered request (set on rising edge to start the job).
MODE INPUT BYTE 0 = deactivate, 1 = activate, 2 = acknowledge activation with new parameters.
LADDR INPUT WORD Diagnostic address of the DP slave (the address assigned in the master's HW Config, not the PROFIBUS node address).
RET_VAL OUTPUT INT Return code; 0000 on success. Common error codes: 8090 = address not configured, 8091 = logical base address not in I/O area, 80A1 = slave not reachable.
BUSY OUTPUT BOOL True while the activation job is in progress (asynchronous execution).

Example call in STL:

// Deactivate DP slave at diagnostic address 1024
CALL SFC 12
  REQ   := M 100.0
  MODE  := B#16#0
  LADDR := W#16#400   // decimal 1024
  RET_VAL := MW 102
  BUSY  := M 100.1

For more detail see the Siemens application notes:

7. Alternative: GSD-Based Slave Integration

If you do not need the slave to be an S7-300 (i.e., the slave project is closed-source or you have no STEP 7 project for the slave), install the GSD file for the S7-31x in the HW Config catalogue via Options → Install GSD File. The path then becomes PROFIBUS DP → Other Field Devices → PLC → SIMATIC → S7-31x.

Drawbacks of the GSD path:

  • The slave's MS Config is exposed as fixed slot modules; you cannot edit transfer areas with the same granularity as the i-slave path.
  • Consistent data areas (used by SFCs like DPRD_DAT) are limited to the maximum the GSD exposes (typically 32 bytes per slot).
  • The slave SDB must still be generated from a project that owns the slave; you cannot escape the need to load the slave SDB somewhere.

Recommended: use the i-slave (Configured Station) path whenever the slave is a Siemens S7 CPU with an accessible STEP 7 project. Reserve the GSD path for non-Siemens slaves or for cases where the slave's source project is unavailable.

8. Online Verification

  1. Open the master HW Config and click Online → Online View (or press Ctrl+Alt+O).
  2. Select the DP master system row. The right-hand pane should now show all slaves with their current status (green = OK, yellow = not configured, red = fault).
  3. Double-click the slave row to open the Module Information window and inspect:
    • General tab: station status, PROFIBUS address, vendor ID.
    • DP Slave Diagnostics: standard DP diagnostics including the slave's diagnostic buffer.
    • I/O: live process image of the configured transfer areas. This is the first place to confirm that data is actually crossing the bus.
  4. On the slave CPU, check the diagnostic buffer for events 4300 (DP: configuration error) and 4380 (DP: parameterisation error). Either of these indicates a mismatch between master and slave SDBs.
BF LED quick reference: A solid red BF LED on the master indicates the entire DP master system is down (cable break, terminator missing, baud-rate mismatch). A slave that is not coupled does not light the master's BF — it shows up as "not configured" in the online view only.

9. Troubleshooting Matrix

Symptom Likely Root Cause Fix
Compile error: "No transfer area configured" Slave added to master without MS Config entries Open slave DP properties → MS Config → add at least one transfer area
"Address already in use" when assigning slave address Slave was inserted as a free-standing device on the bus, not as a Configured Station Delete the wrongly inserted station, re-insert from PROFIBUS DP → Configured Stations → S7-31x
Slave visible in Accessible Nodes, not in master's online DP view Slave SDB not downloaded; or slave DP mode is still set to Master, not Slave Switch slave DP mode to DP Slave, regenerate, download both SDBs
Diagnostic buffer event 4300 on slave Configuration mismatch between master and slave SDBs Verify transfer area directions and lengths match exactly in both projects; re-download both
Diagnostic buffer event 3944 on master Master cannot reach slave at PROFIBUS address Check slave address switch, cabling, terminators, slave power, slave DP mode
Master BF LED solid red, no slaves online Physical bus fault Inspect cable, connectors, termination, baud rate consistency
Slave online but transfer area I/O always 0 Transfer area direction reversed in slave project Mirror the area: master Output = slave Input, master Input = slave Output
Compile succeeds, download OK, but slave does not appear online Slave SDB download was skipped or failed silently Force a STOP→RUN on the slave after re-download, or use PG/PC direct to slave PROFIBUS

10. Field-Commissioning Sequence (Summary)

  1. Confirm the slave is visible in Accessible Nodes with the intended address.
  2. In the master project, drag the slave from PROFIBUS DP → Configured Stations → S7-31x onto the master DP system.
  3. Assign the matching PROFIBUS address. Do not accept the catalogue's default if it differs from the physical switch.
  4. Open the slave's MS Config and define at least one transfer area. Use consistent areas only if the application will use DPRD_DAT/DPWR_DAT.
  5. Mirror the transfer areas in the slave project and set the slave's DP mode to DP Slave.
  6. Compile both projects. Download the master station. Switch PG to slave, download the slave SDB.
  7. Power-cycle or STOP→RUN the slave.
  8. Open the master's online view and confirm the slave reports OK.
  9. Read the transfer area I/O live; force a bit on the master and observe it on the slave (or vice versa).
  10. Optionally wrap the slave in SFC12 to allow runtime deactivation.

11. Frequently Asked Questions

Why does the catalogue propose a new PROFIBUS address for my slave?

Because you inserted the slave as a free DP device, not as a Configured Station. Re-insert it from PROFIBUS DP → Configured Stations → S7-31x and assign the physical address. STEP 7 will then accept the existing address because the station is no longer a new node on the bus — it is a reference to an already-planned slave.

Do I really need a transfer area even if I only want to see the slave online?

Yes. STEP 7 enforces a minimum of one transfer area in the MS Config so that the SDB is structurally valid. Define a 1-word consistent area as a placeholder; the data can be unused.

Is downloading the master HW Config enough to bring the slave into service?

No. The master download writes only the master's SDB. The slave SDB is generated from the slave project and must be loaded separately, either by a direct PG/PC connection to the slave or by reloading the slave project through its own STEP 7 instance.

Can an S7-300 CPU be a DP master and a DP slave at the same time on the same integrated port?

No. The integrated DP interface can be master or slave, not both. To combine roles, add a CP342-5 (or use the S7-31xT's second port) and assign the second role to the additional interface.

What is the difference between an i-slave and a standard DP slave added by GSD?

An i-slave is a Siemens S7 CPU acting as an intelligent slave. It runs its own user program and is configured with the Siemens Configured Stations catalogue path. A standard DP slave added by GSD is a "dumb" peripheral device whose behaviour is fully described by the GSD file. For S7-to-S7 coupling, always use the i-slave path.

What does SFC12 "D_ACT_DP" actually do?

It deactivates or reactivates a configured DP slave at runtime without removing it from the master project. Pass the slave's diagnostic address (the one assigned in HW Config) and the requested MODE (0 = deactivate, 1 = activate, 2 = acknowledge activation with new parameters). See Siemens application note 19730984.

Back to blog