Re-program S7-1200 with New Configuration: Full Recovery Guide

David Krause14 min read
S7-1200SiemensTutorial / 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

Re-program an S7-1200 with a New Hardware Configuration: Full Recovery, Communication, and RUN-State Guide

This procedure covers the complete recovery of a SIMATIC S7-1200 CPU whose IP address was wiped during a factory reset, whose project no longer matches the physical module layout, and whose CPU refuses to enter RUN. It applies to firmware V4.x CPUs (CPU 1211C, 1212C, 1214C, 1215C, 1217C) and to TIA Portal V15.1 through V18. All references below come from the official S7-1200 Programmable Controller System Manual (entry ID 36932465) and the TIA Portal online help: Resetting to factory settings.

Safety first. Place the CPU in STOP before downloading a new hardware configuration. Removing or inserting signal modules (SM), signal boards (SB), or battery boards on a powered CPU can cause undefined behavior and module damage. Disconnect the 24 V DC load supply from the CPU and any SM before changing the physical layout.

1. Problem Scope and Typical Failure Chain

When an S7-1200 has been programmed once and is later reused with a different module lineup, three independent faults usually appear in sequence:

  1. Layer 2 — IP loss: A manual "Reset to factory settings" (MRES via TIA Portal or mode selector) wipes the IP address, subnet mask, and PROFINET device name. The CPU keeps its MAC address but is no longer reachable at the previous IPv4.
  2. Layer 3 — Discovery failure: TIA Portal "Online > Accessible devices" returns no nodes even after the user manually enters the previously used IP. The CPU still responds to DCP/PN-DCP identification frames, so PROFINET tools can still see it.
  3. Layer 4 — Configuration mismatch: After the user re-uses a different project, the CPU refuses RUN, and the SM DIAG LED begins to blink because the configured topology does not match the plugged-in modules.

Each layer has to be cleared in order. Skipping Layer 2 (e.g. trying to download a project before the CPU is reachable) produces the "CPU will not go to RUN" symptom with alternating RUN/STOP LED activity.

2. Prerequisites

Item Specification Notes
CPU S7-1200, firmware V4.0 or higher CPU 1211C / 1212C / 1214C / 1215C / 1217C
TIA Portal V15.1, V16, V17, or V18 Project must be compiled against the same firmware as the target CPU
PG/PC Ethernet Realtek / Intel / Broadcom NIC, 100 Mbit/s or 1 Gbit/s Disable Wi-Fi and any VPN client before commissioning
Patch cable Cat 5e or higher, straight-through Direct PG-to-CPU connection: do not cross cables between two NICs; both modern ports auto-MDIX
PROFINET tool Siemens PRONETA V2.4 or higher Free, includes network analysis, IP assignment, and topology view
User rights Local administrator on the PG Required for raw socket DCP discovery and for firewall exceptions

3. Physical and Electrical Inspection

Before any software step, confirm that the CPU is alive and that the network is wired correctly.

  1. Apply 24 V DC to terminals 1L+ and 1M. The CPU's RUN/STOP LED must react (even if it only glows solid orange). No LED at all means the power section or the fuse on the SB 1223/DO board is open.
  2. Insert the Ethernet patch cable into the CPU PROFINET port. The port's green Link LED must come up within 3 s. A yellow/green pair without activity indicates the CPU is on a different subnet or the cable is broken.
  3. Note the order of the plugged-in modules from left (CPU side) to right. Each module has a slot label engraved on the front: CPU, SM1, SM2, ... SM8. The first SM plugged next to the CPU occupies slot 1, the next slot 2, and so on.
  4. Compare the engraved catalog numbers (e.g. 6ES7 221-1BF32-0XB0) to the project's device configuration. Mismatched MLFBs are the single most common cause of "CPU will not enter RUN".

4. Step 1 — Configure the PG/PC IP Address

Set the engineering station to a static IPv4 inside the same subnet as the CPU's next address. The S7-1200 PROFINET interface defaults to 0.0.0.0 after a factory reset, so any well-formed address in 192.168.0.0/24 is acceptable as long as the host portion is not .0 or .255.

  1. Open Control Panel > Network and Sharing Center > Change adapter settings.
  2. Right-click the wired Ethernet adapter (typically "Realtek PCIe GBE Family Controller" or "Intel I210") and select Properties.
  3. Select Internet Protocol Version 4 (TCP/IPv4) → Properties.
  4. Choose Use the following IP address and enter:
    Field Value
    IP address 192.168.0.254
    Subnet mask 255.255.255.0
    Default gateway (leave blank for direct connection)
  5. Click OK and close all dialogs. Verify with ipconfig /all in an elevated command prompt.
Why 192.168.0.254? The default PROFINET discovery uses link-local ARP and DCP multicast, so the PG does not strictly need to be in the same subnet to find the CPU. However, the moment the user tries to assign a new IP via TIA Portal, the PG does need to be in the same /24. Choosing a high host value such as .254 prevents collisions with future DHCP leases on the same network.

5. Step 2 — Discover the CPU with PRONETA

PRONETA reads the CPU's MAC address through the standard PROFINET DCP protocol, even when the CPU has no IP. The TIA Portal "Online > Accessible devices" search can fail to return anything if Windows firewall blocks the UDP ports used by PN-DCP (ports 34964/UDP for DCP).

  1. Download PRONETA from the Siemens support site (search for entry ID 67460624, free of charge).
  2. Start PRONETA and click Network Analysis. The CPU should appear within 5–10 s with status "No IP address".
  3. Switch to the IO Test tab, right-click the CPU, and choose Set IP address > Static. Assign 192.168.0.1 with subnet mask 255.255.255.0 and router 0.0.0.0.
  4. Assign a PROFINET device name, e.g. s71200. The name is mandatory if the CPU is part of a PROFINET IO system with a controller; for a stand-alone CPU it is still recommended for clarity.
  5. Click Apply and wait for the green status confirmation. The CPU's Link LED will blink briefly while the assignment is written to flash.

Alternative discovery tools: Siemens Primary Setup Tool (PST), the command-line pnio_diag (part of the SIMATIC NET toolbox), and the free TIA Selection Tool. All of them speak the same DCP protocol, so if PRONETA cannot find the CPU, none of the others will — the issue is the physical layer, not the application.

6. Step 3 — Verify Reachability from TIA Portal

  1. Open the project in TIA Portal that contains the new configuration.
  2. In the project tree, expand Online access and locate the wired Ethernet adapter.
  3. Double-click Update accessible devices. The CPU should now appear with its assigned IP 192.168.0.1 and its PROFINET device name.
  4. If the CPU still does not appear, verify with a raw ping:
    ping 192.168.0.1 -n 4
    A reply confirms Layer 3 is up. A "Destination host unreachable" reply points to a subnet mismatch.
  5. If the ping succeeds but TIA Portal reports "no devices", close all firewalls temporarily: netsh advfirewall set allprofiles state off (re-enable with on after the session).

7. Step 4 — Download the New Hardware Configuration

  1. In the project tree, right-click the CPU and select Download to device > Hardware and software (only changes).
    Why "only changes"? A full download also rewrites the program blocks and the data blocks, which can wipe retained tags. Use the variant "Hardware configuration" if you only want to update the topology.
  2. TIA Portal shows a "Select target device" dialog. The CPU's IP should already be filled in. Confirm by clicking Flash LED; the CPU's RUN/STOP and ERROR LEDs will blink for a few seconds, proving the route is correct.
  3. Follow the download dialog. When prompted, choose Stop all and Reset only if the existing program must be replaced. To preserve retentive data, choose Stop all and skip the reset.
  4. After the download, TIA Portal offers to Go online. Click Go online and observe the diagnostic buffer.

8. Step 5 — Decode the RUN/STOP LED Pattern

The user reports orange–green–orange–green then back to orange. The table below maps every RUN/STOP and ERROR pattern documented in the S7-1200 system manual.

RUN/STOP ERROR MAINT Meaning Corrective action
Off Off Off No 24 V supply Check 1L+/1M, fuse
Solid orange Off Off CPU in STOP, no error None — start CPU
Solid green Off Off CPU in RUN None
Blinking green Off Off CPU is starting / OB startup executing Wait up to 10 s
Blinking green/orange Off Off CPU in startup, partner CPU in STOP, or H-solo startup Check partner CPU if redundant
Blinking orange Off Off CPU in STOP because of a programming error or a hardware configuration error Read diagnostic buffer; check topology
Solid orange Blinking red Off Hardware configuration mismatch (configured slot empty or wrong module) Compare physical modules to HWCN
Solid orange Flashing red 1 Hz — Forced I/O error / I/O access error Check direct I/O access, OB82 call
Solid orange Solid red — Fatal firmware error — CPU defective Replace CPU
Solid green — Solid yellow Maintenance demanded Open diagnostic buffer; replace indicated component
Solid green — Blinking yellow Maintenance required Schedule replacement

The reported "orange–green–orange–green and then back to orange" pattern matches the blinking green/orange row combined with a hardware configuration error: the CPU tries to enter RUN, fails to start its I/O, and falls back to STOP. The flash sequence repeats every 2 s.

9. Step 6 — Decode the I/O Module DIAG LED

The user reports the DIAG LED on the SM blinking green continuously. For the SM 1221, SM 1222, SM 1223, SM 1231, SM 1232, SM 1234, and SM 1278 families, the DIAG LED has three states documented in the system manual:

DIAG LED Meaning
Off No diagnostic event pending; module OK
Flashing green 0.5 Hz Module is reporting at least one channel-level diagnostic event (wire break, overflow, overtemperature, range error)
Solid green Module has just powered up but is not yet configured — appears for ~2 s during slot recognition
Solid red Module fault (no or invalid configuration data)
Flashing red 0.5 Hz Module has wrong firmware version or wrong catalog number for the slot

Continuous flashing green on the SM means at least one channel is raising a diagnostic interrupt. The most common causes are:

  • Wire break on a 4–20 mA analog input (SM 1231 / SM 1234): the input is enabled but the transducer is not connected or the loop is open. Disable unused channels in the device configuration to suppress the diagnostic.
  • 24 V missing on the load supply (SM 1223 DO): the SM has 24 V logic but no 24 V on 2L+/3L+, so the outputs flag "load voltage missing".
  • Overrange on a thermocouple (SM 1231 TC): open thermocouple junction triggers a wire-break event.
  • Channel-level configuration error: a digital input configured as HSC (high-speed counter) without a valid wiring assignment raises "type 3" diagnostics.

To clear the LED, fix the channel or disable the unused channel in TIA Portal → device configuration → properties → inputs/outputs → diagnostics, then redownload the hardware configuration.

10. Step 7 — Read the Diagnostic Buffer

  1. In TIA Portal, mark the CPU in the project tree.
  2. Select Online > Online & diagnostics > Diagnostics buffer.
  3. Read the most recent event first. Common entries seen after a topology mismatch:
    0xE002 — "Parameter assignment error". The CPU could not download parameters to an SM. Click the entry to see the slot number and the cause byte.
    0xE001 — "Module removed/inserted". Reported by an SM that lost IO data.
    0x4380 — "Channel-level diagnostic". Wire break or overrange on a specific channel.
  4. Right-click the relevant entry and select Open in the project to jump directly to the offending module.

11. Verification Checklist

Check Expected result Pass criterion
Link LED on CPU PROFINET port Solid green Cable and PHY are good
PRONETA network analysis CPU visible with correct MLFB and firmware PROFINET stack is alive
PG IP 192.168.0.254 / 255.255.255.0 Same /24 as CPU
CPU IP 192.168.0.1 / 255.255.255.0 Ping reply < 1 ms
Online > Accessible devices CPU shown with green status icon TIA Portal sees CPU
Hardware configuration download "Download successful" dialog No "configuration error" popup
CPU RUN/STOP LED Solid green after Start User program is executing
SM DIAG LED Off (or briefly solid during slot recognition) No channel-level diagnostic
Diagnostic buffer No new events after 60 s of RUN No 0xE0xx, 0x4xxx entries

12. Troubleshooting Matrix

Symptom Likely cause First action
CPU not visible in "Accessible devices" PG and CPU in different subnets Set PG to 192.168.0.254/24
CPU not visible, Link LED off Cable / port fault Swap cable, try another switch port
CPU not visible, Link LED on Firewall blocking DCP Disable Windows firewall or add UDP 34964/34965 exception
CPU visible, IP cannot be set PROFINET interface disabled in project Enable "PROFINET interface" in device configuration
CPU visible, download fails with "Protected" Know-how protection or access level set Provide correct password or use a project with the same protection level
Download OK, CPU stays in STOP, RUN/STOP blinks orange Hardware configuration mismatch Compare configured slots to physical slots, check MLFB of each module
CPU goes to RUN then back to STOP Programming error / OB not present Check OB1, OB82, OB121 in program; read diagnostic buffer
SM DIAG LED solid red Wrong module in slot or firmware too old Replace module or update firmware
SM DIAG LED flashing green Channel-level diagnostic Open device configuration → module → diagnostics
CPU ERROR LED solid red Fatal firmware error Power cycle, if it returns replace the CPU

13. How to Avoid the Problem Next Time

  • Always upload the existing project to TIA Portal before any reset. The "Upload device as new station" action captures the current hardware configuration, symbols, and DB contents.
  • Use the mode selector's MRES position only as a last resort. The recommended factory reset path is TIA Portal → Online & diagnostics > Reset to factory settings, which keeps the IP intact unless explicitly cleared.
  • Keep a separate "template project" with the correct topology. Compare the new project's HWCN against the template before download.
  • Document the IP plan. A simple .txt in the project folder listing CPU, HMI, PG, and any switched subnet avoids the 192.168.0.1 collision that brought the PG and the CPU onto the same address in the first place.

14. Quick-Reference LED Tables

14.1 CPU Status LEDs

LED Color State Indication
RUN/STOP Green Solid RUN mode
RUN/STOP Green Flashing 2 Hz Startup (OB100 / OB101)
RUN/STOP Orange Solid STOP mode
RUN/STOP Orange Flashing 0.5 Hz CPU has detected a fault and is in STOP
ERROR Red Flashing Diagnostic event pending
ERROR Red Solid Fatal fault
MAINT Yellow Solid Maintenance demanded
MAINT Yellow Flashing Maintenance required
LINK Green Solid Ethernet link up
RX/TX Yellow Flashing PROFINET traffic

14.2 SM Status LEDs (SM 1221 / 1222 / 1223 / 1231 / 1232 / 1234 / 1278)

LED Color State Indication
DIAG Green Off No diagnostic event
DIAG Green Flashing 0.5 Hz Channel-level diagnostic pending
DIAG Green Solid Module unconfigured (≤ 2 s after power-up)
DIAG Red Flashing 0.5 Hz Module type / firmware mismatch
DIAG Red Solid No valid configuration data
24 V Green Solid Load voltage OK

15. Diagnostic Event ID Cheat Sheet

Event ID Meaning Action
0x1155 Module inserted Informational
0x1156 Module removed Check slot population
0x1381 Firmware update started Do not power off
0x1382 Firmware update finished Power cycle recommended
0x3042 Communication error PROFINET IO Check cable, partner device
0x4380 Channel-level diagnostic Open channel diagnostics
0x4E02 Comparison error (expected ≠ actual topology) Synchronize HWCN
0x79E2 IP address conflict Change CPU or PG IP
0xE001 Module removed/inserted Check slot
0xE002 Parameter assignment error Check cause byte, fix module config

16. Frequently Asked Questions

Why does the S7-1200 refuse to enter RUN after I add a new SM?

The hardware configuration (HWCN) in TIA Portal must exactly match the plugged-in modules by catalog number (MLFB) and slot position. If slot 2 in the project holds an SM 1223 16DI/16DO but the physical slot has an SM 1231 AI8, the CPU enters STOP with ERROR blinking red. Open the project, double-click the new module, and download the configuration again.

What IP does the S7-1200 have right out of the box?

After a complete factory reset the PROFINET port has IP 0.0.0.0 and no PROFINET device name. The CPU is still discoverable via DCP (PROFINET Discovery and Configuration Protocol) on UDP port 34964, which is exactly how PRONETA finds it.

Can I keep the original IP after a factory reset?

No. The factory reset clears the IP. If you used "Reset to factory settings" in TIA Portal, re-assign the IP from the same dialog before the CPU goes back to STOP. If you used the mode selector's MRES, the IP must be re-assigned afterwards with PRONETA or TIA Portal.

The SM DIAG LED blinks green continuously. Is that normal?

No. Solid off is the normal state. A flashing green DIAG LED means at least one channel is reporting a diagnostic event (wire break, overrange, missing load voltage, configuration error). Either fix the wiring, supply the missing 24 V, or disable the unused channel in the device configuration.

Why does the alternating orange-green LED pattern mean STOP, not RUN?

The CPU tries to enter RUN, executes the startup OBs, then fails on a hardware or programming error and falls back to STOP. The 2 Hz green flash is the startup indicator; the orange state is the resulting STOP. Reading the diagnostic buffer in TIA Portal (Online > Online & diagnostics > Diagnostics buffer) shows the exact cause, most often event ID 0xE002 "Parameter assignment error".

Back to blog