S7-300 S7-1200 PROFIBUS DP Communication Using CM 1242-5 Module

David Krause12 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

Architecture Overview

This reference describes a homogeneous Siemens PROFIBUS DP network in which a SIMATIC S7-300 CPU with an integrated DP master interface acts as the class-1 master and an S7-1200 station equipped with the CM 1242-5 communication module acts as a DP-V0 slave. The typical hardware arrangement is the 313C-2DP (or any CPU 31x with integrated DP port, e.g. 315-2DP / 317-2DP) on the master side and a CPU 121x (firmware V4.0 or later required for CM 1242-5) on the slave side.

The CM 1242-5 is the dedicated PROFIBUS DP slave module for the S7-1200 family (article number 6GK7 242-5DX30-0XE0). It supports all standard baud rates from 9.6 kbps to 12 Mbps and a maximum payload of 244 bytes input / 244 bytes output per slave, which is well below the PROFIBUS DP-V0 theoretical maximum of 244 bytes per direction. The companion module CM 1243-5 (6GK7 243-5DX30-0XE0) is the DP master counterpart; do not confuse the two when ordering.

Because the CM 1242-5 does not expose any cyclic program blocks to the user, the slave side does not require a single line of code. The master simply reads and writes the configured I/O areas as peripheral I/O.

Hardware Prerequisites

Component Article Number Notes
S7-300 CPU with DP port (e.g. 313C-2DP) 6ES7 313-6CG04-0AB0 Integrated MPI/DP interface (X2)
S7-1200 CPU (firmware ≥ V4.0) 6ES7 2xx-1xxxx-xxxx Firmware V4.x required for CM 1242-5
CM 1242-5 DP slave module 6GK7 242-5DX30-0XE0 Plugs into left of CPU
PROFIBUS DP cable 6XV1 830-0EH10 (violet) Shielded twisted pair, 2-core
PROFIBUS connector with PG port 6GK1 500-0FC10 or 6ES7 972-0BA12-0XA0 Switchable termination resistor
Termination resistors must be ON at the two physical ends of the bus segment and OFF on all intermediate stations. Leaving a middle station terminated is one of the most common causes of intermittent bus faults that look like configuration errors in the diagnostic buffer.

Software Prerequisites

  • STEP 7 V5.5 SP4 or V5.6 for the S7-300 master (HW Config is still the standard tool for 300-series hardware, even when commissioning the network from a TIA Portal project).
  • TIA Portal V13 SP1 or later for the S7-1200 / CM 1242-5 slave configuration. The reverse-order transfer-area behaviour described in this article was verified against TIA V13, V15, and V16.
  • GSD file for CM 1242-5 (file name typically SI0180B8.GSD or successor). Download from the official Siemens Product Support portal at support.industry.siemens.com (search term "CM 1242-5 GSD"). The file is mandatory because the CM 1242-5 is not in the legacy STEP 7 V5.x hardware catalogue.

Network Topology and Cable Limits

Maximum segment length depends on the configured baud rate:

Baud Rate Max Segment Length
9.6 / 19.2 / 45.45 kbps 1 200 m
93.75 kbps 1 200 m
187.5 kbps 1 000 m
500 kbps 400 m
1.5 Mbps 200 m
3 / 6 / 12 Mbps 100 m

A maximum of 32 stations is allowed per segment without a repeater (RS-485 physical layer). Each repeater adds a segment with another 31 nodes. Valid PROFIBUS addresses are 1 through 126; address 0 is reserved for a class-2 master (PG) and address 127 is reserved for broadcast.

S7-300 Master Configuration (STEP 7 V5.x)

Step 1 — Install the GSD

  1. Open SIMATIC Manager and load the project containing the 313C-2DP station.
  2. Open HW Config and select Options → Install GSD File….
  3. Browse to the directory containing the extracted CM 1242-5 GSD, then choose Install. Wait for the catalogue to update.
  4. The slave will appear under PROFIBUS DP → Additional Field Devices → I/O → CM 1242-5.

Step 2 — Insert the Slave on the PROFIBUS Subnet

  1. Drag the CM 1242-5 from the catalogue onto the PROFIBUS(1):DP master system rail.
  2. Assign PROFIBUS address 3 (master should be address 2; slaves may use any free address 1–126 except the master's).
  3. Confirm the proposed baud rate (1.5 Mbps is the most common production default; 12 Mbps is permitted but reduces cable length to 100 m).

Step 3 — Configure the Transfer Areas

The CM 1242-5 GSD exposes up to 16 modular slots. Each configured slot becomes one transfer area. Two slots are sufficient for cyclic I/O exchange:

  1. Double-click Slot 1 (the first universal module in the catalogue tree) and select 2 bytes I input. From the master side this is data the master reads from the slave.
  2. Double-click Slot 2 and select 2 bytes O output. From the master side this is data the master writes to the slave.
  3. Note the peripheral input/output addresses assigned by HW Config, e.g. PEW 256 / PAW 256. The peripheral address range is what the slave's transfer areas map into.
The I/O slot ordering on the master defines how the slave's transfer areas will be matched. This is the source of the well-known "reverse order" pitfall explained in the next section.

Step 4 — Save and Compile

  1. Station → Save and Compile (Ctrl+S).
  2. Download the hardware configuration to the S7-300 CPU.
  3. Set the CPU to RUN. The DP master should begin polling address 3.

CM 1242-5 Slave Configuration (TIA Portal)

Step 1 — Add the Module to the Device View

  1. Open the S7-1200 project in TIA Portal.
  2. In Device View, drag the CM 1242-5 from the catalogue (Communication modules → PROFIBUS) into a free slot left of the CPU.

Step 2 — Configure the PROFIBUS Interface

  1. Select the CM 1242-5, then open Properties → PROFIBUS interface.
  2. Click Add new subnet; TIA will create a PROFIBUS_1 with the parameters you enter.
  3. Set the PROFIBUS address to 3, matching the HW Config entry on the S7-300 side.
  4. Set the baud rate to the same value as the master (1.5 Mbps recommended for new installations).
  5. Confirm that the highest PROFIBUS address is 126 (default).

Step 3 — Define Transfer Areas

  1. In the Properties → Transfer areas tab of the CM 1242-5, add a new transfer area.
  2. Configure Transfer Area 1:
    • Type: Input (data the slave receives from the master)
    • Length: 2 bytes
    • Consistency: Total length (or Byte, depending on payload < 4 bytes)
    • Starting address: e.g. %IW100
  3. Configure Transfer Area 2:
    • Type: Output (data the slave sends to the master)
    • Length: 2 bytes
    • Consistency: Total length
    • Starting address: e.g. %QW100

Step 4 — Compile and Download

  1. Compile → Hardware (rebuild all).
  2. Download the configuration to the S7-1200 CPU.
  3. Cycle power to the CM 1242-5 only if the BF LED remains solid red after download.

The Reverse Transfer Area Rule

The most common failure mode on first attempt is "no diagnostic error, but the data on the slave is what I wrote from the master to itself". This is caused by a mirroring mistake between the slot configuration on the master side and the transfer area configuration on the slave side.

The rule is:

What the master considers Output is Input for the slave, and vice-versa. Each master slot N corresponds to slave transfer area N.

Worked example with two 16-bit areas:

Master Slot (S7-300) Direction (Master View) Peripheral Address on Master Slave Transfer Area (CM 1242-5) Direction (Slave View) PLC Address on Slave
1 16-byte Input (Master reads) PEW 256 … PEW 286 Transfer Area 1 Output (Slave sends) %QD100 … %QD115
2 16-byte Output (Master writes) PAW 256 … PAW 286 Transfer Area 2 Input (Slave receives) %ID100 … %ID115

If the order is reversed (master Slot 1 = Output, master Slot 2 = Input), the slave must mirror it: Transfer Area 1 = Input, Transfer Area 2 = Output. The GSD slot numbers always correlate one-to-one with the slave's transfer area numbers regardless of direction.

With TIA Portal V13 a simple rule applies: Slot 1 on the master ↔ Transfer Area 1 on the slave. Always keep the same numeric index even if the data direction is flipped.

Programming the Data Exchange

Because the CM 1242-5 is a slave, the S7-1200 user program only manipulates the process image addresses that the transfer areas point to. A 16-bit hand-shake example in structured text:

// S7-1200 side (slave), cyclic OB1
#SlaveSetpoint   := %IW100;        // value written by S7-300 master
#SlaveFeedback   := %QW100;        // value read back by S7-300 master
%QW100 := INT_TO_WORD(#ActualSpeed); // local feedback to master

On the S7-300 master the same data is read and written as peripheral I/O:

// S7-300 side (master), OB1 (ST)
L PEW 256;          // read 16-bit feedback from CM 1242-5
T MW 200;           // buffer for evaluation
L MW 100;           // local setpoint
T PAW 256;          // write to CM 1242-5

No special function blocks (FCs/FBs) are required on the slave. The CP integrates itself into the peripheral address space of the master.

LED Status and Diagnostic Indicators

The CM 1242-5 has three status LEDs that must be interpreted together with the S7-300 master's DP diagnostics.

LED Colour State Meaning
ON Green On Power OK
BF Red Off Bus OK, configuration matches master
BF Red Flashing Bus physically present but no parameterisation received; check DP address / baud rate match
BF Red Solid on No bus signal — cable, connector, or termination problem
SF Red Off No module fault
SF Red Flashing Configuration mismatch — slot lengths or consistency do not match between master and slave
SF Red Solid on Hardware fault — cycle power, replace module if persistent
MAINT Yellow On Maintenance demanded (firmware update pending or diagnostic interrupt pending)

Reading the S7-300 Diagnostic Buffer

If the master CPU is in STOP with SF (system fault) on, the diagnostic buffer will contain the exact cause. In STEP 7:

  1. PLC → Module Information.
  2. Click the Diagnostic Buffer tab.
  3. Read the most recent events; the codes most commonly seen are:
    • Event ID 39 84 — DP slave fault (slot diagnostics indicate which slave failed).
    • Event ID 38 04 — Slave parameter assignment error (configuration length or consistency mismatch).
    • Event ID 38 05 — Slave configuration error (slot does not match GSD).

Click Open Block on a station-fault event to drill into the slot-level diagnostics and see exactly which slot number is failing. This is the fastest path to diagnosing the "SF only when payload > 1 byte" problem reported by multiple integrators.

Troubleshooting Matrix

Symptom Likely Cause Action
BF solid on CM 1242-5 No bus signal Check connector, termination, cable polarity (A = green, B = red)
BF flashing, no SF Master not polling Confirm master RUN, DP address match, baud rate match
BF off, SF flashing Slot configuration mismatch Verify slot lengths and consistency on both sides
BF off, SF solid on Hardware fault Cycle power, replace module, check firmware ≥ V4.0 on S7-1200
No LEDs active at all No 24 V supply to CM Check power connector, max 200 mA draw from CPU
Communication works for 1 byte but SF for ≥ 2 bytes Reverse-order mapping with mismatched lengths Swap slot indexing on master or transfer-area indexing on slave to match
Master reads its own written value back Transfer-area direction reversed Apply the Reverse Transfer Area Rule from this article
BF off, communication works, but data is corrupt Consistency mismatch (byte vs total length) Use Total Length consistency for payloads ≥ 4 bytes
CM1242-5 diagnostics LED blinking continuously Y-Link topology issue Verify Y-Link is set to "DP slave" mode and configure the proxy

Advanced — Communicating Through a Y-Link

When the DP master is a redundant H-system (e.g. S7-400H), the CM 1242-5 cannot be connected directly to either CPU. A Y-Link (e.g. 6GK1 416-2CK00-0AA0 for PROFIBUS, or 6ES7 197-1LA04-0XA0 with appropriate IM) must be inserted. The Y-Link is configured in the H-station's PCS 7 / STEP 7 HW Config as a proxy for the CM 1242-5. Inside the Y-Link, the lower-level PROFIBUS master exchanges data with the CM 1242-5 transparently. The transfer-area configuration in the TIA Portal for the CM 1242-5 remains exactly as described above; only the upstream master changes.

If the CM 1242-5 diagnostics and error LEDs both blink continuously and the S7-400H is the master, the most common root cause is a missing or misconfigured proxy entry for the Y-Link. The slave configuration alone is never enough to clear this condition.

Payload Limits and Consistency

  • Maximum 244 bytes input and 244 bytes output per slave — confirmed in the GSD catalogue.
  • For payloads ≤ 4 bytes, "Unit" or "Byte" consistency is sufficient. The data is transferred atomically with the peripheral I/O update of the CPU.
  • For payloads > 4 bytes, always set consistency to "Total Length". On the S7-300 master this requires DPRD_DAT / DPWR_DAT system function blocks rather than direct PEW/PAW access, otherwise the slave may read partially updated data within the same cycle.

Verification and Commissioning Checklist

  1. After download, power-cycle the CM 1242-5 once to ensure the parameter assignment from the master is fresh.
  2. Confirm BF off and SF off on the CM 1242-5 within 5 seconds of master RUN.
  3. On the S7-300 side, monitor the peripheral addresses in Monitor/Modify. Write a known pattern (e.g. 16#AAAA) to PAW 256 from the master and read PEW 100 on the slave — values must match.
  4. Reverse the check: write a known pattern from the S7-1200 to %QW100 and verify the same value appears at PEW 256 on the master.
  5. Toggle a free status bit in both directions at 100 ms to confirm the update rate matches the configured baud rate (≈ 1 ms cycle at 1.5 Mbps with two 16-bit areas).
  6. Unplug the bus connector — both stations must flag a station failure within the watchdog time (default 10 s × 2 base time on S7-300).

Reference Documents

The behaviour of the CM 1242-5 within TIA Portal, including the transfer-area editor described above, is documented in the SIMATIC S7-1200 Communication Function Manual:
Configuring a PROFIBUS S7 connection — TIA Portal manual collection.

Additional supporting material is available on the Siemens Industry Online Support portal:
support.industry.siemens.com — entry point for S7-1200 system manual, S7-300 system manual, CM 1242-5 operating instructions, and the CM 1242-5 GSD file.

FAQ

Do I need any FCs or FBs on the S7-1200 slave side?

No. The CM 1242-5 integrates itself into the process image and peripheral I/O. You only read and write the configured transfer-area addresses (e.g. %IW100 and %QW100) from your standard cyclic OB.

What is the maximum cyclic payload between S7-300 master and CM 1242-5?

Up to 244 bytes input and 244 bytes output per slave, as defined in the CM 1242-5 GSD file. For payloads greater than 4 bytes use Total-Length consistency and access via DPRD_DAT / DPWR_DAT on the master.

Why does communication work for 1 byte but fail with SF on 2 bytes or more?

This is the classic reverse-order symptom. The slot number on the master side must match the transfer-area number on the slave side; what is "Output" for the master is "Input" for the slave and vice-versa. Re-map with the rule described in this article.

Can I use the CM 1242-5 with an S7-400H redundant master?

Yes, but only through a Y-Link. The Y-Link must be configured in the H-station's PCS 7 / STEP 7 HW Config as a proxy, and the CM 1242-5 transfer areas are configured in TIA Portal exactly as for a single master. A continuously blinking diagnostics LED on the CM 1242-5 in this topology is almost always a missing or misconfigured proxy entry.

How do I read the master DP diagnostic information if the CPU is in STOP?

Open STEP 7, connect online, then use PLC → Module Information → Diagnostic Buffer. The most recent events will show the slave address, slot number, and DP error code (e.g. station failure = 39 84, parameter error = 38 04). The slot-level diagnostics identify the exact slot causing the SF.

Back to blog