System Overview and Feasibility
The Siemens SIMATIC S7-300 CPU 315-2DP integrates two communication interfaces on the front faceplate: X1 (MPI only) and X2 (MPI/DP combo, software-selectable as MPI, DP Master, or DP Slave). Because the X2 port can be placed in any of those three roles independently on each station, two identical CPU 315-2DP units can be linked on a single PROFIBUS DP segment with one acting as DP Master (Class 1) and the other as an Intelligent Slave (I-Slave). No additional communication processor (CP 342-5 or CP 343-5) is required. STEP 7 V5.4 SP5 and V5.5 fully support the configuration through HW Config and NetPro.
The communication is cyclic: the master polls the slave's I/O transfer areas, writes outputs to the slave, and reads inputs from it. The slave CPU continues to execute its own user program; the exchanged bytes appear in its peripheral I/O or process image. Default bus profile is DP at 1.5 Mbps; allowed rates are 9.6 kbps up to 12 Mbps. The PROFIBUS physical layer, frame format, and master-slave protocol are defined by IEC 61158 (CPF 3, PROFIBUS) and IEC 61784-1 (CP 3/1, PROFIBUS DP profile).
Design rule: A DP master system permits exactly one Class 1 master. The integrated DP port of the CPU 315-2DP can occupy only one role at a time. If both peers must act as master to a third DP device, add a CP 342-5 to one station to keep the X2 port free for that role.
Prerequisites and Required Materials
| Item | Specification | Order Number / Source |
|---|---|---|
| 2 x CPU 315-2DP | Integrated MPI/DP interface (X2) | 6ES7315-2AG10-0AB0, 6ES7315-2AH14-0AB0, 6ES7315-2AF03-0AB0 |
| 2 x S7-300 power supply | PS 307 5A or PS 305 | 6ES7307-1EA01-0AA0, 6ES7305-1BA80-0AA0 |
| 2 x DIN rail | 530 mm, 2000 mm lengths | 6ES7390-1AF30-0AA0 |
| 2 x PROFIBUS DP connector | D-sub 9-pin, 150 ohm termination, with or without PG port | 6ES7972-0BA12-0XA0 (90 deg, no PG), 6ES7972-0BB12-0XA0 (90 deg, with PG) |
| PROFIBUS cable | Twisted pair, shielded, 150 ohm impedance, violet | 6XV1830-0EH10 (FC Standard), 6XV1830-3EH10 (FC Robust) |
| FastConnect stripping tool | For FC cable | 6GK1905-6AA00 |
| STEP 7 V5.4 SP5 / V5.5 | HW Config, NetPro, SFC / SFB libraries | Siemens SIMATIC Manager |
| PG cable (MPI/DP) | For online programming and diagnostics | 6ES7901-1BD00-0XA0 (PC Adapter USB A2) |
Additional recommended items: spare SM 321/SM 322 digital I/O modules for local I/O at each station, PROFIBUS diagnostic repeater (6ES7972-0AB01-0XA0) for long-cable commissioning, and a CP 5611 (6GK1561-1AA01) for PC-based DP master diagnostics if the PG cable is not available.
Hardware Configuration - Master CPU 315-2DP
Create a single STEP 7 project that contains both stations. Two stations in one project is the only topology that allows STEP 7 to link master and slave without a GSD file.
- In SIMATIC Manager: File > New Project. Name it (for example
CPU315_DP_MS). - Insert > SIMATIC 300 Station. Rename the station to
MASTER. - Open HW Config for the master station.
- Drag a DIN rail from the catalog (RACK-300), then a PS 307 power supply into slot 1, and the CPU 315-2DP into slot 2.
- Save and compile (Station > Save and Compile).
Configure the X2 interface as DP Master:
- Double-click the CPU row. In the Properties dialog navigate to the Interface tab.
- Click Properties next to PROFIBUS interface MPI/DP.
- In the PROFIBUS Interface dialog, click New next to Subnet. Create subnet
PROFIBUS(1), profile DP, transmission rate 1.5 Mbps. - Set the master's PROFIBUS address to 1.
- Confirm the Operating Mode is set to DP Master.
- Click OK to close all dialogs.
Open the Operating Mode tab on the DP interface and confirm:
- DP Master enabled.
- Diagnostic address 8190 (default, used by OB82).
- Group Diagnostics active (so that slave failures raise a diagnostic interrupt).
Hardware Configuration - Slave CPU 315-2DP
- Insert a second SIMATIC 300 Station into the same project. Name it
SLAVE. - Open HW Config for the slave. Build the same rack: rail, PS 307, CPU 315-2DP, optional local SM modules.
- Double-click the slave CPU. Open Interface > Properties on the PROFIBUS interface.
- Select the existing subnet
PROFIBUS(1). Set the slave's PROFIBUS address to 2. - Switch the Operating Mode from DP Master to DP Slave. This places the integrated port in I-Slave (Intelligent Slave) mode.
- Click Properties under the I-Slave box to open the I-Slave configuration.
Define the transfer areas the master will exchange. The I-Slave model treats each direction as a separate slot. Slot 0 is reserved for device diagnostics. Configure the remaining slots per the following mapping:
| Slot | Direction | Length | Slave CPU Address | Notes |
|---|---|---|---|---|
| 0 | Diagnostics | 6 bytes standard DP-V0 | Diagnostic frame | Always present, do not modify |
| 1 | Input to master | 4 bytes | IB 100..IB 103 | Master reads, slave writes via OB1 |
| 2 | Output from master | 4 bytes | QB 100..QB 103 | Master writes, slave reads via OB1 |
Keep slot sizes at 4 bytes or smaller for atomic consistency in the slave user program; the 315-2DP I-Slave does not guarantee atomicity across cycles for larger blocks. If larger data sets are required, split them into multiple 4-byte slots and use a handshake bit to mark validity.
Process image boundary: The slave's I-Slave addresses must lie within the OB1 process image (default 0..127 byte) for them to be read or written directly in OB1. If higher addresses are needed, enable Update Process Image on OB1 in the slave CPU's cycle/OB1 properties or use direct peripheral access (PIB / PQB) in the user program.
Wiring the PROFIBUS Bus
The integrated DP port of the CPU 315-2DP uses a 9-pin D-sub female connector with the IEC 61158 pinout:
| Pin | Signal | Function |
|---|---|---|
| 1 | Shield | Optional cable shield bonding via connector housing |
| 2 | M24 | 24 V return for repeater power |
| 3 | RxD/TxD-P (B line) | Receive/Transmit data plus (red conductor) |
| 4 | RTS | Request to Send direction control |
| 5 | M5V | Data ground reference for +5 V |
| 6 | P5V | +5 V isolated supply for bus termination (max 90 mA) |
| 7 | P24V | +24 V for repeater power (max 100 mA) |
| 8 | RxD/TxD-N (A line) | Receive/Transmit data minus (green conductor) |
| 9 | DPR | Not used for DP-V0/DP-V1 |
Wire the segment in a linear topology with termination at the two physical ends. The Siemens 6ES7972-0BA12 / 0BB12 connector includes a 220 ohm resistor between pins 3 and 8 with 390 ohm pull-up to pin 6 and 390 ohm pull-down to pin 5, and exposes a slide switch to engage or disengage the network.
- Set terminator switch to ON on the connectors at the master and the most distant slave.
- Set the switch to OFF on every connector in between.
- Verify with an ohmmeter on a powered-down segment: with both terminators ON, the resistance between pins 3 and 8 should measure approximately 110 ohm; with both OFF, the line should read high impedance.
Maximum segment length as a function of baud rate (per IEC 61158-2 and Siemens PROFIBUS application guidelines):
| Baud rate (kbps) | Max segment length (m) | Application profile |
|---|---|---|
| 9.6 | 1200 | MPI/DP long-reach |
| 19.2 | 1200 | MPI/DP long-reach |
| 45.45 | 1200 | MPI/DP long-reach |
| 93.75 | 1200 | MPI/DP long-reach |
| 187.5 | 1000 | MPI/DP mid-reach |
| 500 | 400 | DP mid-rate |
| 1500 | 200 | DP standard profile (default) |
| 3000 | 100 | DP high-speed |
| 6000 | 100 | DP high-speed |
| 12000 | 100 | DP high-speed, shortest cycle |
Stub (T-drop) cable length limits: less than or equal to 0.3 m at 12 Mbps, less than or equal to 6.6 m at 1.5 Mbps or lower. Stub-free daisy-chaining is preferred for EMC margin. Maintain a minimum 200 mm clearance between PROFIBUS cable and VFD power cables, or use a grounded metal separator.
Approximate DP cycle time at 1.5 Mbps for a two-station segment:
t_cycle = 11 * n_bytes * t_bit + 33 * t_bit + 2 * t_propagation
where t_bit = 1 / 1.5e6 = 0.667 us, n_bytes is the total cyclic payload per station in this cycle, the 33 bit-times is the PROFIBUS idle period, and t_propagation ~ 5 ns/m * segment_length. For 4 input bytes and 4 output bytes per station, the minimum cycle is roughly 1.0 ms plus propagation delay, putting typical bus cycle time in the 1 to 5 ms range for a 10 m to 200 m link.
Configuring I/O Transfer Areas in the Master
With both stations configured inside the same STEP 7 project, the slave is automatically known to the master. Link the slave to the master bus:
- Open HW Config for the MASTER station.
- Select the cyan PROFIBUS(1) line emanating from the CPU 315-2DP X2 port.
- In the right-hand catalog tree, expand PROFIBUS DP > Configured Stations > SIMATIC 300 > SLAVE > CPU 315-2DP.
- Drag the slave CPU onto the master system line. STEP 7 inserts a slave icon at address 2 matching the slave's configured PROFIBUS address.
- Save and recompile the master station to regenerate the system data blocks (SDB 1000 and below for the master).
Open the slave's properties from the master view:
- Double-click the slave icon. The DP-Slave Properties dialog appears.
- Select the Configuration tab. Verify the slot list matches the slave's I-Slave configuration: Slot 1 = 4 bytes input, Slot 2 = 4 bytes output.
- In the master's I/O column, assign addresses that do not collide with the master's local SM I/O. The default is often IB 0..IB 3 and QB 0..QB 3; remap to a free range such as IB 100..IB 103 and QB 100..QB 103.
- Click OK to apply.
The master now sees the slave as if its I/O slots were local peripheral modules. The slave's I-Slave area uses the slave's own address space (here IB 100..IB 103 and QB 100..QB 103). The two address spaces are independent; the data is copied between them each DP cycle.
Address collisions: Do not assign the same I/O address to a local SM in the master and to a slave slot. STEP 7 may not warn at compile time; the failure is a configuration error at first I/O update with the master reporting a station status byte bit 3 (slave has not yet been parameterised) and bit 5 (static diagnostics). Move the slot to a non-overlapping range.
User Program for Data Exchange
The exchanged bytes behave as standard process image data. The simplest demonstration is one OB1 cycle that writes a flag word to the master-to-slave output and reads the slave-to-master input into a flag word, on both stations.
Master OB1 (S7-300 STL):
L IB 100 // Master reads slave's I-Slave area (slot 1)
T MB 50
L MW 60 // Master sends 4 bytes to slave (slot 2)
T QB 100
Slave OB1 (S7-300 STL):
L IB 100 // Slave reads master's slot 2 mapped to its IB 100..103
T MB 70
L MW 80 // Slave sends 4 bytes back to master (slot 1)
T QB 100
Both stations should also have OB 82 (diagnostic interrupt), OB 86 (rack failure), OB 100 (warm restart), OB 121 (programming error), and OB 122 (I/O access error) inserted from the standard library. Without OB 86 the master CPU goes to STOP on loss of the slave. Without OB 82 the diagnostic interrupt for a slave that reports a static diagnostic is rejected and the CPU enters STOP.
Download, Commissioning, and Online Verification
- Connect the PG to the master's MPI/DP port (X1 in MPI mode if X2 is dedicated to DP, or X2 set temporarily to MPI for download then back to DP).
- Station > Download to Target. Choose the master. The CPU will stop briefly if the system data changed; if it stays in RUN-P the download is a non-stop online change.
- Repeat for the slave.
- Set both CPUs to RUN with the mode switch in the middle position.
- Observe the LED stack on each CPU. The expected steady-state for a healthy link is shown below.
| LED | Color | Expected state | Meaning |
|---|---|---|---|
| SF (system fault) | Red | OFF | No system error |
| BF (bus fault) on X2 | Red | OFF | DP communication healthy |
| RUN | Green | ON, solid | CPU in RUN |
| STOP | Yellow | OFF | CPU not in STOP |
| DC5V | Green | ON | Internal 5 V power good |
| FRCE | Yellow | OFF (unless a force is active) | No forced I/O |
| MP (on X1 or X2) | Green | Flashing | MPI traffic visible |
| DP (on X2) | Green | Flashing with cycle | Token / data traffic on DP |
Online verification procedures in STEP 7:
- Open a VAT (Variable Table) and monitor IB 100..IB 103 / QB 100..QB 103 on the master. The values should update each OB1 cycle.
- Right-click the master system line > DP Master System Diagnostics. The slave icon should show a green OK status; selecting it displays the standard DP-V0 diagnostic frame (8 bytes including the station status byte, vendor ID, and PROFIBUS address).
- Right-click the slave icon > Diagnose slave for a full diagnostic dump and the slave's local I/O image.
- Programmatic access: in the master, call SFC 13 (DPNRM_DG) to read the slave's diagnostic frame in OB1 and feed the station status byte into a data block for SCADA visibility.
S7-PLCSIM Limitation and the Real-Hardware Boundary
S7-PLCSIM V5.4 SP5 (and the V5.4 SP5 + UPD1 update instance) simulates a single S7 station. Its MPI, TCP, and ISO-on-TCP interfaces are emulated; the PROFIBUS DP layer is not. Two PLCSIM instances running on the same or different PCs cannot establish DP master-slave communication between each other because PLCSIM has no DP bus.
Implications for a bench setup:
- PLCSIM is acceptable for testing the user program of a single station, but it cannot test the DP link itself.
- If a quick sanity check of the master logic is needed, run the master in PLCSIM and force the I/O areas that the slave would have written; this tests only the master logic, not the link.
- For end-to-end validation, the link must be on physical CPU 315-2DP hardware with a real PROFIBUS cable and terminated segment.
To test the I-Slave with PLCSIM, the master must be a real CPU 315-2DP and only the slave may be PLCSIM. The reverse (master in PLCSIM, slave in real hardware) will report "Slave not found" because PLCSIM has no DP bus. Plan bench hardware accordingly. PLCSIM V5.4 also has no support for DP-V1 acyclic services (SFB 52/53), only the cyclic DP-V0 used here.
LED Diagnostics and Fault Code Reference
| LED | Pattern | Likely cause | Action |
|---|---|---|---|
| BF (master) flashing at 0.5 Hz | Periodic flash | Slave missing on the bus; address conflict; cable break | Check cable, terminators, slave address, slave power |
| BF (master) steady ON | Constant red | Physical bus fault, no token passing | Verify terminator at both ends, baud rate match, shield continuity |
| SF (master) steady ON | Constant red | Slave diagnostic; configuration mismatch; OB82 not loaded | Open slave diagnostics in STEP 7; load OB82, OB86, OB100, OB121, OB122 |
| BF (slave) flashing at 0.5 Hz | Periodic flash | No master on the bus; wrong address; wiring wrong | Verify master address 1, slave address 2, terminator engagement |
| BF (slave) steady ON | Constant red | Bus fault, baud rate mismatch | Match baud rate to master (default 1.5 Mbps) |
| SF (slave) steady ON | Constant red | I-Slave not enabled; slot length mismatch | Re-verify Operating Mode = DP Slave and I-Slave slot lengths |
| All LEDs off (slave) | No light | No power; mode switch in MRES; CPU defective | Check PS 307 output, mode switch position |
| FRCE steady ON | Constant yellow | Forced I/O on this station | Clear forces in VAT or via STEP 7 |
The DP-V0 standard diagnostic frame (8 bytes) returned by the slave includes the station status byte. Common bit meanings that appear in the master's diagnostic view and the slave's diagnostic buffer:
| Bit | Meaning | Typical trigger |
|---|---|---|
| 0 to 1 | Reserved (always 0) | — |
| 2 | Slave cannot be addressed | Address conflict; slave in power-down |
| 3 | Slave has not yet been parameterised | Master not started; configuration mismatch |
| 4 | Slave diagnostic pending | Slave is in error state; read extended diagnostic |
| 5 | Slave static diagnostics | I-Slave mis-configuration; slot length mismatch |
| 6 | Slave in protected mode | Master Sync / Freeze handling issue |
| 7 | Slave is not in this DP master exchange | Wrong master address in slave configuration |
Common Configuration Errors and Workarounds
| Symptom | Root cause | Workaround |
|---|---|---|
| Master BF flashing; slave not found in online view | Slave's X2 still in MPI mode | Open slave HW Config, set X2 mode to DP Slave, redownload |
| Master BF steady; slave BF steady | Baud rate mismatch between master and slave | Match baud rate; align PG/PC interface project setting to DP profile |
| SF on master; "Configuration error" in diagnostic buffer | Master's I/O addresses overlap a local SM | Move slave slot to a free address range on the master |
| BF on master; slave BF steady; SF off | Cable break or short circuit on the bus segment | Disconnect segments; measure between pins 3 and 8 (110 ohm with both terminators ON, high-Z with OFF) |
| Communication works for seconds, then BF lights | EM disturbance from a VFD or welding plant | Increase cable clearance; add ferrite on VFD side; replace FC Standard with FC Robust cable |
| I-Slave data appears reversed in master | Byte swap in 16-bit values (big-endian / little-endian) | Use byte-level transfers; if 16-bit, swap words in user program (TAW / CAW) |
| DP master works; OB82 triggers after power cycle | OB82 not loaded; CPU goes to STOP on slave error | Insert OB82, OB86, OB100, OB121, OB122 from standard library |
| Force on slave has no effect on master | Forces are station-local | Apply force on slave's I-Slave area; verify in master's monitor |
| Diagnostic on slave reports "Length error in slot 1" | Master's slot 1 length differs from slave's I-Slave slot | Open slave icon in master HW Config and set length to match exactly |
| BF on master disappears only after power cycle | Watchdog on slave triggered | Increase master's DP cycle time, or reduce the slave's diagnostic data volume |
| Both CPUs RUN, BF off, but data never updates | Master's I/O addresses wrong end (input vs output reversed) | Swap slot direction: master input is slave's output area, vice versa |
Field-Proven Commissioning Checklist
- Both CPUs 315-2DP report RUN green, SF off, BF off.
- PROFIBUS connectors are fully screwed onto the D-sub jacks; thumb screws are tight.
- Terminator switch is ON only on the two physical end connectors.
- Baud rate is 1.5 Mbps on both stations; visible in PG/PC interface properties and in the slave's HW Config.
- Master I/O addresses for slave slots 1 and 2 are configured and do not collide with local SMs.
- Slave I-Slave addresses (slots 1 and 2) lie within the OB1 process image (0..127 byte) or are accessed via PIB / PQB.
- OB82, OB86, OB100, OB121, OB122 are present in both projects.
- Master HW Config online view shows the slave icon in green "OK" state.
- Master VAT shows the slave's I-Slave data updating each OB1 cycle.
- Reverse direction: a force on the slave's I-Slave area is visible in the master within one DP cycle.
- Power-cycle the slave: the master should report a slave-missing diagnostic and recover automatically when the slave returns (requires OB86).
- Disconnect the bus cable: the master should report BF and the slave should report BF. Reconnect: both recover without CPU restart.
- Capture the diagnostic buffer from both stations (PLC > Diagnostic Buffer) and save it as part of the commissioning report.
Frequently Asked Questions
Do I need a GSD file to add the second CPU 315-2DP as a slave in STEP 7?
No. GSD files are required only for third-party slaves or Siemens stations that are not present in the STEP 7 hardware catalog. Two S7-300 stations inside the same STEP 7 project are connected through the Configured Stations branch of the catalog, which uses the project's own type information, not a GSD.
Can I run this configuration entirely inside S7-PLCSIM?
No. PLCSIM instances do not exchange PROFIBUS DP frames between each other; the PLCSIM DP layer is a stub. Use physical CPU 315-2DP hardware for the DP segment. PLCSIM can be used on the master CPU side only if the master is connected to a real bus through CP 5611 / CP 5621 or via S7 communication over Industrial Ethernet.
Why does the master CPU go to STOP after I disconnect the slave?
By default the CPU enters STOP on a slave station failure unless OB82 (diagnostic interrupt) and OB86 (rack failure) are present. Load both OBs from the standard library; the CPU will then remain in RUN and pass the failure to the user program for graceful handling.
What is the maximum number of I/O bytes the CPU 315-2DP can exchange as an I-Slave?
The integrated I-Slave of the CPU 315-2DP supports up to 244 input bytes and 244 output bytes total, distributed across slots of 1 to 32 bytes each. For 4-byte atomic consistency, keep individual slots at 4 bytes or smaller; for larger data sets, split the transfer into multiple slots and use a handshake bit to mark validity.
What baud rate should I select for a 1:1 link on a short bench cable?
1.5 Mbps is the safest default. It supports up to 200 m of cable, is the standard DP profile, and matches the default of almost every Siemens DP device. 12 Mbps is permitted but adds no benefit for a two-station segment and tightens the EMC margin on long cables.