Configuring an S7-300 System: CPU, I/O Modules, and HMI Setup

David Krause18 min read
S7-300SiemensTechnical Reference
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

1. System Requirements Analysis

The target build is a SIMATIC S7-300 automation cell with 48 digital inputs (24 V DC), 24 digital outputs (24 V DC, 0.5 A), an isolated 24 V load power supply, and a single-panel HMI for operator monitoring. The application profile is small to mid-size discrete control: conveyor staging, packaging cells, process skids, or building-services panels where the S7-300 footprint is acceptable. Before sizing modules, capture four hard constraints that drive every subsequent selection:

  1. I/O count: 48 DI / 24 DO. This exceeds the integrated I/O of any S7-300 compact CPU, so an S7-300 with separate SM321 / SM322 signal modules is mandatory.
  2. Network interface: The system must support an HMI. Any S7-300 CPU without a Profinet port requires either an MPI cable link (limited to single-panel, 187.5 kbit/s) or a CP module (CP342-5 Profibus, CP343-1 Profinet).
  3. Engineering tool: TIA Portal V15 and later supports the S7-300/400 family via the STEP 7 V15+ package. Legacy STEP 7 V5.5 + WinCC flexible 2008 SP2 is still functional but is end-of-life for new installations.
  4. Lifecycle: The SIMATIC S7-300 family is sold and supported until 2033 per Siemens product lifecycle policy. New plant commissioning should treat the S7-300 as a 5-8 year platform, not a 15-year platform.
Engineering note: For brand-new designs, Siemens no longer recommends Profibus for greenfield applications. Profinet with ET 200SP remote I/O is the contemporary architecture. Choose Profibus only when interfacing with existing Profibus slaves, drives, or third-party devices already on the bus.

2. CPU Selection: S7-300 vs. S7-1200 Trade-off

The cost-optimized build has two realistic Siemens candidates. The selection pivots on whether the user must have S7-300 form-factor or is open to a newer platform.

Criterion S7-300 CPU 314 (6ES7314-1AG14-0AB0) S7-300 CPU 313C-2DP (6ES7313-6CG04-0AB0) S7-1200 CPU 1214C DC/DC/DC (6ES7214-1AG40-0XB0)
Work memory (code/data) 128 KB 64 KB 100 KB
Bit execution time 0.06 µs 0.07 µs 0.08 µs
Integrated I/O None 16 DI / 16 DO on-board 14 DI / 10 DO on-board
Profibus interface None MPI/DP combo None
Profinet interface None (requires CP343-1) None (requires CP343-1) Yes, 1 port
Max. signal modules / CM / CP 32 SM / 8 FM / 8 CP 31 SM / 8 FM / 8 CP 8 SB/CM/CP + 1 comm module
Engineering tool TIA Portal V15+ or STEP 7 V5.5 TIA Portal V15+ or STEP 7 V5.5 TIA Portal Basic (STEP 7 Basic)
Typical panel partner KTP600 DP / KTP700 DP via CP KTP600 DP direct on MPI/DP KTP700 PN Basic direct
Approx. list price (CPU only) ~€650 ~€750 ~€350

For a budget-driven build where the platform is open, the S7-1200 with CPU 1214C + KTP700 PN Basic is materially cheaper (CPU + panel + engineering) and is forward-compatible with TIA Portal V20. For a build where the spec sheet mandates S7-300, the CPU 314 (without integrated I/O) is the cheapest pure S7-300 because it avoids the 313C-2DP's premium for integrated DI/DO that the user does not need.

3. S7-300 I/O Module Configuration

The 48 DI / 24 DO target maps to standard signal modules. Two configurations are realistic:

Configuration A — Central rack only (recommended)

Slot Module Order number Channels Function
1 PS 307 (5 A) 6ES7307-1EA01-0AA0 — 24 V DC load power supply
2 CPU 314 6ES7314-1AG14-0AB0 — Controller
3 SM 321 DI 32x24V DC 6ES7321-1BL00-0AA0 32 DI Inputs I 0.0 - I 3.7
4 SM 321 DI 16x24V DC 6ES7321-1BH02-0AA0 16 DI Inputs I 4.0 - I 5.7
5 SM 322 DO 32x24V DC/0.5A 6ES7322-1BL00-0AA0 32 DO Outputs Q 0.0 - Q 3.7 (24 used, 8 spare)
6 — — — Reserved for future expansion

This fits 48 DI in two modules (32+16) and 24 DO in a single 32-channel module. The DO module leaves 8 outputs unused, which is acceptable margin for future solenoid/relay additions.

Configuration B — Central rack + ET 200S distributed I/O

Position Module Order number Channels
Central slot 3 SM 321 DI 32x24V DC 6ES7321-1BL00-0AA0 32 DI
Central slot 4 SM 322 DO 32x24V DC/0.5A 6ES7322-1BL00-0AA0 24 DO used (8 spare)
ET 200S head IM 151-1 Profibus 6ES7151-1BA02-0AB0 —
ET 200S slot 1 PM-E 24V DC 6ES7138-4CA01-0AA0 Power module
ET 200S slot 2 4 DI / 8 DO digital electronic module 6ES7131-4BD01-0AA0 16 DI / 24 DO distributed

Configuration B is only required when the field wiring distance exceeds 5 m and centralization is impractical. For a single-cabinet build, Configuration A is lower-cost and easier to commission.

3.1 I/O Address Map (Configuration A)

Default addressing for Configuration A places each 32-channel module on 4 input bytes and each 16-channel module on 2 input bytes. Verify these addresses in TIA Portal under PLC tags → I/O addresses.

Address Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
IB 0 (slot 3 group 0) I 0.7 I 0.6 I 0.5 I 0.4 I 0.3 I 0.2 I 0.1 I 0.0
IB 1 (slot 3 group 1) I 1.7 I 1.6 I 1.5 I 1.4 I 1.3 I 1.2 I 1.1 I 1.0
IB 4 (slot 4 group 0) I 4.7 I 4.6 I 4.5 I 4.4 I 4.3 I 4.2 I 4.1 I 4.0
QB 0 (slot 5 group 0) Q 0.7 Q 0.6 Q 0.5 Q 0.4 Q 0.3 Q 0.2 Q 0.1 Q 0.0

Terminal-to-bit mapping: SM 321 terminal 2 = bit 0 of group 0, terminal 3 = bit 1, … terminal 9 = bit 7. SM 322 follows the same convention on its output front connector. Group 0 uses terminals 2-9, group 1 uses terminals 12-19, and so on.

3.2 Sample Program Logic

Minimal OB1 in STL that demonstrates input-to-output mapping and interlock logic:

      U   I 0.0      // Start button (terminal 2, slot 3)
      U   I 0.1      // Permissive (terminal 3, slot 3)
      UN  I 0.2      // E-Stop NC contact (terminal 4, slot 3)
      =   Q 0.0      // Motor contactor (terminal 2, slot 5)

      U   I 0.3      // Auto/Manual selector
      =   Q 0.1      // Mode indicator lamp

      UN  I 4.0      // Remote acknowledge (terminal 2, slot 4)
      O   Q 0.2      // Seal-in for horn
      =   Q 0.2      // Audible horn output

Equivalent SCL for structured-text programmers:

IF "Start" AND "Permissive" AND NOT "E_Stop" THEN
    "Motor" := TRUE;
ELSE
    "Motor" := FALSE;
END_IF;

"Mode_Lamp" := "Auto_Sel";

IF NOT "Remote_Ack" OR "Horn_Seal" THEN
    "Horn_Seal" := TRUE;
END_IF;

3.3 Front Connector Wiring Detail (SM 322 DO 32x24V)

The SM 322 32-channel output module uses a 40-pin front connector with four isolated groups of 8 channels each. L+ and M for each group must be supplied from the load voltage source, not the backplane.

Terminal Signal Terminal Signal
1 L+ group 0 (24 V supply) 21 L+ group 2 (24 V supply)
2 Q 0.0 (output bit 0, group 0) 22 Q 2.0 (output bit 0, group 2)
3 Q 0.1 23 Q 2.1
4 Q 0.2 24 Q 2.2
5 Q 0.3 25 Q 2.3
6 Q 0.4 26 Q 2.4
7 Q 0.5 27 Q 2.5
8 Q 0.6 28 Q 2.6
9 Q 0.7 29 Q 2.7
10 M group 0 (24 V return) 30 M group 2 (24 V return)
11 L+ group 1 31 L+ group 3
12 Q 1.0 32 Q 3.0
20 M group 1 40 M group 3

Each group supports up to 4 A total output current. Exceeding this trips the group's electronic fuse and forces all 8 channels of the group off until the overload clears.

4. HMI Selection: KTP Basic Panels

The Siemens Basic Panel line is the cost-optimized operator interface for S7-300 systems. Two panel families are practical:

Panel Order number Display Interface Compatible engineering
KTP600 Basic DP 6AV6647-0AD11-3AX0 5.7" mono Profibus DP slave (MPI compatible) WinCC flexible 2008 SP2 Compact, WinCC Basic V11+
KTP600 Basic PN 6AV6647-0AD11-3AX1 5.7" mono Profinet WinCC Basic V11+ (TIA Portal)
KTP700 Basic DP 6AV2123-2GB03-0AX0 7" TFT color Profibus DP WinCC Basic V11+
KTP700 Basic PN 6AV2123-2GB03-0AX3 7" TFT color Profinet WinCC Basic V11+
Important constraint: The DP variants only speak Profibus (and MPI fallback). Connecting a DP panel to a CPU 314 (which has only MPI) requires the MPI/Profibus port on the CPU to operate in MPI mode and the panel to be configured for MPI at 187.5 kbit/s. If a CP342-5 Profibus master is installed, the panel connects to the Profibus network through that CP, not through the CPU's MPI port.

For a true Profinet HMI on a CPU 314, install a CP343-1 Lean (6GK7343-1CX10-0XE0) and connect the KTP700 PN Basic. The CP343-1 Lean supports S7 communication and one Profinet port.

4.1 HMI Tag Configuration

After creating the panel in TIA Portal, define the connection in the project's HMI tag table. For a Profibus panel talking to a CPU 314 via CP342-5:

  1. Open Devices & Networks → select the panel → Connections.
  2. Create a new "S7 connection" pointing to the CPU 314 rack 0 slot 2.
  3. Set Profibus address of the panel = 1; set Profibus address of the CP342-5 = 3.
  4. Set the Profibus network to 1.5 Mbit/s (default for new networks).
  5. Compile the panel project → download via MPI/Profibus to the panel.

Tags referenced in the panel must be defined in the PLC tag table with consistent names. Symbolic addressing is preferred (e.g., "Motor_Start" instead of I 0.0) for readability and to survive hardware reconfiguration.

5. Network Architecture

For a 48 DI / 24 DO single-cell build, three network topologies are valid. Each has different cost, complexity, and upgrade paths.

S7-300 Rack Topology - Configuration A PS 307 5 A Slot 1 CPU 314 MPI Slot 2 SM 321 32 DI Slot 3 SM 321 16 DI Slot 4 SM 322 32 DO Slot 5 KTP600 DP HMI MPI cable (187.5 kbit/s) - alternate via CP342-5 if Profibus 24V backplane Process wiring

5.1 MPI-only (cheapest, lowest performance)

  • CPU 314 MPI port → MPI cable (6ES7901-0BF00-0AA0) → KTP600 DP configured as MPI slave.
  • 187.5 kbit/s, max. 32 nodes, max. 50 m total bus length without repeaters.
  • Use for single-panel, single-CPU, no-distributed-I/O applications.

5.2 Profibus with CP342-5

  • CPU 314 → CP342-5 (6GK7342-5DA03-0XE0) Profibus master → Profibus cable → ET 200S stations and KTP panel.
  • Up to 12 Mbit/s, max. 32 nodes per segment, max. 1000 m with repeaters.
  • Critical constraint: I/O data of Profibus slaves is exchanged with the CPU via the CP342-5's I/O image. Direct I/O access (L PIB/PQB from the S7-300 user program) is not supported; communication uses FC AG_SEND / AG_RECV or the configured I/O area.

5.3 Profinet with CP343-1

  • CPU 314 → CP343-1 (6GK7343-1EX30-0XE0) Profinet interface → ET 200SP stations and KTP700 PN panel.
  • 100 Mbit/s, full TCP/IP transport, S7 communication, open IE communication.
  • Recommended for any new S7-300 build that must interface with current-generation HMI or I/O.
Engineering caveat: With a CP342-5 Profibus master, the slave I/O is mapped into the CPU's process image only if the CP342-5 is configured in "DP master mode" with the slave configured as a "DP slave." If the CP342-5 is configured as a passive S7 communication partner, the I/O is not automatically mapped and must be polled via AG_SEND / AG_RECV.

6. Power Supply Sizing

The PS 307 power supply feeds the backplane bus. Sizing requires the sum of backplane current consumption plus the 24 V sensor/actuator load. Use the PS 307 5 A (6ES7307-1EA01-0AA0) for any configuration including CPU 314.

Backplane consumption (typical, 5 V):

  • CPU 314: ~700 mA
  • SM 321 DI 32x24V: ~30 mA
  • SM 321 DI 16x24V: ~25 mA
  • SM 322 DO 32x24V/0.5A: ~80 mA
  • CP342-5: ~150 mA

Configuration A total 5 V backplane current: 700 + 30 + 25 + 80 = 835 mA. The PS 307 (5 A) provides 5 A on the 24 V output for the backplane; headroom is comfortable. PS 305 (2 A) is insufficient for CPU 314 + SM modules combined.

Field-side 24 V load (separate sizing on a dedicated SITOP or similar):

I_field = (N_DI × I_sensor) + (N_DO_active × I_DO) + I_HMI + margin

For 48 DI at 5 mA sensor current + 16 active DO at 0.3 A average + KTP panel at 0.5 A:

I_field = (48 × 0.005) + (16 × 0.3) + 0.5 = 0.24 + 4.8 + 0.5 = 5.54 A

Apply a 25 % derating factor for inrush and ambient:

I_rated = 5.54 × 1.25 = 6.93 A → SITOP PSU8200 10 A (6EP1334-3BA10) or equivalent

Safety note: S7-300 DO modules source current from the load voltage supply (L+ terminal on the front connector), not from the backplane. A separate 24 V DC supply for the actuator loads is mandatory. Never feed load current through the PS 307.

7. Step-by-Step Hardware Configuration

  1. Open TIA Selection Tool and create a new S7-300 project. Drag PS 307 (5 A), CPU 314, and the configured signal modules to the rack in slot order 1-2-3-4-5.
  2. Assign Profibus / Profinet addresses on each Profibus-capable module. Default CPU MPI address = 2; default CP342-5 Profibus address = 3; default KTP panel Profibus address = 1.
  3. Wire the front connectors of SM 321 / SM 322 modules. SM 321 uses 40-pin front connector (6ES7392-1AM00-0AA0); SM 322 uses the same. Use the shield contact kit (6ES7390-5AA00-0AA0) for noisy inputs.
  4. Connect the load power supply to terminals 1 (L+) and 20 (M) of each SM 322 front connector. Use a fused distribution (Phoenix Contact UK 10 N or equivalent).
  5. Configure the KTP panel in TIA Portal. For a DP panel on the CPU 314 MPI port, set the panel's MPI/DP switch to MPI and configure the connection in WinCC Basic at 187.5 kbit/s.
  6. Download the hardware configuration to the CPU (online → download to target device). Verify that the CPU's SF and BF LEDs extinguish within 5 seconds.
  7. Download the HMI configuration to the panel via Profibus/MPI or Ethernet.
  8. Run a warm restart: Turn CPU key from STOP to RUN. Verify that the SF/BF LEDs remain off and that the RUN LED is solid green.

8. Cost Comparison Matrix

Component S7-300 (CPU 314) configuration S7-1200 (CPU 1214C) configuration
CPU 6ES7314-1AG14-0AB0 (~€650) 6ES7214-1AG40-0XB0 (~€350)
I/O modules (48 DI / 24 DO) SM 321 ×2 + SM 322 ×1 (~€700) SM 1221 ×2 + SM 1222 ×1 (~€550) or SB cards (~€300)
Power supply PS 307 5A (~€220) PM 1207 (~€120)
HMI panel KTP600 Basic DP (~€700) KTP700 Basic PN (~€650)
Engineering tool TIA Portal V15+ (~€1,500 floating) or STEP 7 V5.5 + WinCC flexible TIA Portal Basic (~€1,000 floating)
Network CP (if Profibus/Profinet) CP342-5 or CP343-1 (~€500-€900) Included in CPU
Approx. total (CPU + I/O + PSU + HMI) ~€2,770 ~€1,670

The S7-1200 alternative is approximately 40 % cheaper for the controller/IO/HMI bill of materials. The S7-300 is justified only when:

  • The plant standard mandates S7-300 form-factor.
  • Existing spare parts inventory must be reused.
  • Functional safety (S7-300F) is required.
  • Distributed I/O on Profibus PA or HART must be integrated.
Procurement note: List prices above are approximate EU distributor list prices as of 2024. Distributor discounts for volume quotes, OEM contracts, or stock clearance can reduce the S7-300 total to within 15 % of the S7-1200 BOM. Request a quote from a Siemens Solution Partner or authorized distributor for accurate pricing.

9. Verification and Commissioning

After hardware build, run this verification sequence:

  1. Insulation test (500 V DC) between 24 V L+ and PE for 5 s. Reading ≥ 1 MΩ.
  2. Power-on sequence: Energize PS 307 → verify green 24 V LED → CPU STOP mode with no SF/BF.
  3. MRES reset: Turn key to MRES → STOP within 3 s → MRES again → STOP. This clears the user program and resets the CPU to factory state.
  4. Download project: TIA Portal → online → extended download to PG/PC → reset to factory settings. Confirm CPU enters RUN.
  5. I/O loopback: Force each DO and read back via the corresponding DI (or use a wiring loop). Verify 48 DI and 24 DO in the variable table.
  6. HMI ping: Open a WinCC tag with the panel → press a button → observe the corresponding bit toggling in the PLC tag table.
  7. Diagnostic buffer: In TIA Portal, open Online → Diagnostics → Diagnostic buffer. Confirm zero error events during a 10-minute idle.

9.1 LED Diagnostic Reference

LED State Meaning Action
SF (red) On Group error: hardware fault, programming error, or diagnostic event Open TIA Portal → Online → Diagnostics → Diagnostic buffer to identify the event
BF (red, flashing) Flashing Bus fault on Profibus/MPI/Profinet - cable or partner issue Check cable, termination, partner address, baud rate
BF (red, solid) Solid Bus fault - no connection to any partner Verify cable continuity; check if any partner is powered
DC5V (green) On 5 V backplane OK —
DC5V (off) Off PS 307 failure or backplane short Check PS 307 output; isolate modules one-by-one
RUN (green) On CPU executing user program —
RUN (green, flashing) Flashing CPU in start-up / commissioning phase Wait 5-10 s; if persistent, check project download
STOP (yellow) On CPU stopped, no execution Switch to RUN; if SF/BF is also on, resolve first
FRCE (yellow) On Force function active Deactivate force table when commissioning complete
MAINT (yellow) On Maintenance demanded (e.g., MMC full, fan warning) Check diagnostic buffer

10. Troubleshooting Matrix

Symptom Likely cause Corrective action
CPU SF LED red, BF LED off Hardware fault: missing or wrong module in a slot Compare physical rack to hardware configuration in TIA Portal; reseat modules
CPU BF LED flashes red Profibus/MPI cable fault or wrong baud rate Verify Profibus connector pinout (A = green, B = red); set baud rate 187.5 kbit/s for MPI
SM 321 SF LED red Sensor 24 V missing on a channel group; wire break on channel Check L+ at terminals 1/11/21/31 of front connector; check channel wiring against assignment
SM 322 SF LED red Output overload or short circuit Measure resistance of each output load; replace failed solenoid/relay; verify total load < 0.5 A per channel and < 4 A per group
Panel "Connection failed" alarm Wrong PLC address or HMI connection parameter In WinCC, open Connections → verify PLC address matches CPU MPI/Profibus address; verify rack/slot = 0/2 for S7-300
CP342-5 SF LED red No Profibus termination or duplicate slave address Enable termination on first and last Profibus connector; check each node's Profibus address for duplicates
CPU in STOP with SF red after download Hardware configuration mismatch Online → Diagnostics → Module information; compare expected vs. actual module type per slot
Inputs read TRUE but wiring shows 0 V Source vs. sink wiring error on SM 321 Confirm sensor NPN/PNP type matches SM 321 group configuration (Type 1 / Type 3)
Outputs energize briefly then drop Load inrush exceeds group current limit Measure cold resistance of solenoid/relay; verify inrush < 4 A per group; add inrush limiter
HMI tags flicker between 0 and 1 Baud rate mismatch or EMI on Profibus cable Verify consistent baud rate on all nodes; route Profibus cable away from VFD power cables; check shield grounding

11. Programming Best Practices

  • Use symbolic addressing. Tag names ("Motor_Start") instead of absolute addresses (I 0.0) survive hardware reconfiguration and improve readability.
  • Reserve a DB for HMI tags. All process variables exposed to the HMI should live in a single data block (e.g., DB100 "HMI_Interface"). This makes the HMI tag table a one-time setup.
  • Use OB1 for cyclic, OB35 (or OB32) for time-critical, OB82 for diagnostics. Avoid placing all logic in OB1 if scan time is critical.
  • Implement a status word per motor/valve. A 16-bit status word (running, fault, mode, permissives, etc.) simplifies HMI display and reduces tag count.
  • Cycle time budget: For a 48 DI / 24 DO application, expect OB1 scan time of 5-15 ms. If the application includes PID or fast counting, monitor OB1 execution time in TIA Portal → Online → Cycle time.
  • Memory card handling: Always keep the program on a SIMATIC MMC (6ES7953-8LG30-0AA0 or larger). The CPU 314 cannot retain the program on power-down without an MMC.
  • Backup configuration: Use TIA Portal → Project → Archive to create a .zap file backup after every functional milestone. Store one copy on the MMC if supported.

12. Frequently Asked Questions

What is the cheapest S7-300 CPU for a 48 DI / 24 DO build?

The CPU 314 (6ES7314-1AG14-0AB0) at approximately €650 list price is the lowest-cost pure S7-300 CPU without integrated I/O. The CPU 313C-2DP (6ES7313-6CG04-0AB0) at approximately €750 list price includes 16 DI/16 DO on-board but its MPI/DP port and integrated I/O are not required for this I/O count.

Does the CPU 314 have Profinet for HMI?

No. The CPU 314 has only an MPI port. To connect a Profinet HMI (KTP700 PN Basic) you must add a CP343-1 (6GK7343-1EX30-0XE0). To connect a Profibus HMI (KTP600 DP Basic) you must add a CP342-5 (6GK7342-5DA03-0XE0) or operate the panel in MPI mode at 187.5 kbit/s.

Can I extend I/O later without changing the CPU?

Yes. The CPU 314 supports up to 32 signal modules centrally and 8 CP/CM modules. Adding distributed I/O requires a Profibus (CP342-5) or Profinet (CP343-1) interface plus ET 200S (Profibus) or ET 200SP (Profinet) head stations with PM-E power modules.

Is S7-300 still supported for new designs?

Yes. Per the Siemens product lifecycle statement, the SIMATIC S7-300 family is sold and supported until 2033. Spare parts availability extends through 2043. For new plant design with a 10+ year horizon, however, Siemens recommends S7-1500 with Profinet.

Why is the S7-1200 cheaper than S7-300 for this I/O count?

The S7-1200 CPU 1214C integrates Profinet, has lower list price (€350 vs €650), accepts cheaper SB/CM signal boards instead of rack-mounted SM modules, and uses the lower-cost TIA Portal Basic engineering license. Total BOM savings for a 48 DI / 24 DO + HMI build are approximately 40 %.

What MC MMC size is required for the CPU 314?

A 2 MB MMC (6ES7953-8LL20-0AA0) is sufficient for typical 48 DI / 24 DO projects. A 4 MB or 8 MB card is recommended for projects with large recipe DBs, extended diagnostics, or large HMI tag cross-references.

Back to blog