Overview: S7-300 Program Transfer Scenarios
When a SIMATIC S7-300 CPU fails, the engineering priority is recovering the user program and bringing a replacement CPU into the same operational state with minimal downtime. Three independent recovery paths exist, and the correct one depends on the condition of the original CPU, the integrity of the Micro Memory Card (MMC), and whether a STEP 7 archive is available on the engineering station. The order of preference is:
- Upload the project directly from the defective CPU using STEP 7 V5.x "Upload to PG" while the CPU is still capable of communicating.
- Move the MMC from the defective CPU into a compatible replacement CPU and let the firmware unpack the project on power-up.
- Retrieve a STEP 7 backup archive (.zip / .arj) and download it to a freshly configured replacement CPU with a new MMC.
Each method is explained below, followed by commissioning, TIA Portal migration, and S7-1200/1500 replacement considerations. The reference platform is the original CPU 6ES7 312-1AE13-0AB0 (CPU 312) and its direct successor 6ES7 312-1AE14-0AB0, but the workflow applies to any S7-300 CPU 31x family.
Hardware Identification and CPU Compatibility
Before any program transfer, identify every component in the rack. The typical S7-300 station in this scenario contains the following Siemens catalog numbers:
| Slot / Function | Order Number (MLFB) | Description |
|---|---|---|
| CPU (original) | 6ES7 312-1AE13-0AB0 | CPU 312, 32 KB work memory, MPI, MMC required |
| CPU (replacement) | 6ES7 312-1AE14-0AB0 | CPU 312 successor, drop-in compatible, MMC required |
| Digital Output | 6ES7 322-1BH01-0AA0 | SM 322 DO 16 x 24 V DC / 0.5 A |
| Digital Input | 6ES7 321-1BH02-0AA0 | SM 321 DI 16 x 24 V DC |
| Analog Module | 6ES7 334-0KE00-0AB0 | SM 334 AI 4 / AO 2 x 12 bit |
The 6ES7 312-1AE14-0AB0 is the firmware-updated successor to the 1AE13-0AB0 and is a pin-, project-, and MMC-compatible replacement. Either MMC can be transferred between the two CPUs without reformatting. Always verify on the rating plate that the firmware version is 3.x or higher; older firmware (V2.x) is incompatible with 1AE14 hardware.
For the complete CPU 31x specifications and the official list of compatible modules, refer to the SIMATIC S7-300 CPU 31xC and CPU 31x Operating Instructions.
Prerequisites: Cables, Software, and Memory Cards
Stage every tool before powering the rack. A missing PC adapter or a forgotten MMC capacity check is the most common cause of a second failure during a first failure.
- Programming software: STEP 7 V5.5 + SPx or TIA Portal V13 SP1 / V14 / V15 / V16 with the "STEP 7 V5" optional package enabled. TIA Portal is required only if migration is planned; the original project remains valid in STEP 7 V5.x.
- PC adapter: 6ES7 972-0CB20-0XA0 (USB-MPI/DP) for any CPU 31x with only an MPI port. Set the rotary switch to MPI and a bus terminator at each physical end of the MPI segment if a PROFIBUS connector is used.
- MMC: A 6ES7 953-8LF20-0AA0 (64 KB) is sufficient for the CPU 312 with 32 KB of work memory. Higher capacity cards (128 KB, 256 KB, 1 MB, 2 MB, 4 MB) are catalog numbers 6ES7 953-8LG/LJ/LL/LM/LP20-0AA0. The MMC must be a Siemens original; third-party SD cards do not initialize reliably on S7-300 CPUs.
- PG/PC interface: Confirm via Options → Set PG/PC Interface in the SIMATIC Manager that "PC Adapter (Auto)" or "PC Adapter (MPI)" is selected. With a USB adapter, the COM port is replaced by the Siemens virtual COM port and the interface type must be set to MPI with a transmission rate of 187.5 kbps (default for MPI).
-
Project backup: Locate the most recent archive. STEP 7 archives are
.zipfiles containing aGlobalandomplus/cpu31xdirectory tree. Older archives are.arjformat (STEP 7 V4.x).
Method 1: Upload the Project from the Defective CPU
If the original CPU still goes to RUN, STOP, or at least powers up with the SF LED off, attempt an upload. This is the only method that guarantees the project matches the as-running configuration, including any online changes that were never archived.
- Connect the PC adapter to the CPU's MPI port and the engineering station. Apply rack power.
- In the SIMATIC Manager, select File → New and create an empty project. Use the same project name as the original (or any descriptive name such as
RECOVER_312). - Insert a SIMATIC 300 station: Insert → Station → SIMATIC 300 Station. Open the station and select the CPU slot object.
- Choose PLC → Upload Station to PG. STEP 7 will query the target CPU type, its MPI address, and the baud rate. Confirm the address matches the DIP switch on the physical CPU (default 2).
- After upload, compare the recovered project against any offline archive: Options → Compare Blocks. Differences in timestamps, comments, or interface descriptions indicate the archive was out of date; resolve each delta before proceeding.
- Save the recovered project, then File → Archive to a new
.zipfor download to the replacement CPU.
Method 2: Transfer the Micro Memory Card (MMC)
The MMC is the persistent store for S7-300 CPUs that do not have integrated EPROM. If the defective CPU's MMC is intact, this is the fastest recovery method.
- Power down the S7-300 rack.
- Open the cover on the front of the CPU. The MMC slot is behind the lower flap, beneath the mode selector.
- Press the ejector and withdraw the MMC. Note its catalog number and capacity stamped on the label.
- Insert the MMC into the replacement CPU (6ES7 312-1AE14-0AB0). The card orientation is keyed; do not force.
- Re-apply power. The CPU performs a memory test, reads the project from the MMC, and unpacks it into internal work RAM. The STOP LED flashes during unpack, then turns solid when complete.
- Switch to RUN. Verify the SF and BF LEDs are off. If the CPU stays in STOP with SF lit, the MMC is incompatible (e.g., from a different CPU family) or corrupt; fall back to Method 3.
The MMC also contains the hardware configuration (HW Config) including the rack layout and module addresses. If the original 6ES7 322-1BH01, 6ES7 321-1BH02, and 6ES7 334-0KE00 modules remain in the same slots, no reconfiguration is required. If the rack differs, you must edit HW Config in the project before download.
For more detail on MMC behavior, see the SIMATIC S7-300 MMC Information entry in the Siemens Industry Online Support knowledge base.
Method 3: Restore from a STEP 7 Backup Archive
When the original CPU is unrecoverable and the MMC is damaged, the only remaining source is the offline archive. STEP 7 supports two archive formats:
| Format | Source Version | Retrieval Path |
|---|---|---|
| .zip | STEP 7 V5.x | File → Retrieve → browse to .zip |
| .arj | STEP 7 V4.x or older | File → Retrieve → browse to .arj (requires ARJ extractor or V5.x) |
- In the SIMATIC Manager, select File → Retrieve... and browse to the archive.
- Choose a target directory. STEP 7 extracts the project and opens it.
- Open the Blocks folder and verify that
OB1,OB100(warm restart), and any FBs/FCs/DBs are present. The system data blocks (SDBs) under System Data contain HW Config; do not delete them. - Insert a new MMC into the replacement CPU if it is blank, or reuse a Siemens-formatted MMC.
- Highlight the Blocks folder, click the Download icon in the toolbar (or PLC → Download).
- When prompted, select "Delete all blocks" or "Download with overwrite" to ensure no stale blocks remain.
If the original archive was generated by a third-party controller vendor (PDF + folder tree), it is most likely an exported STEP 7 project. The folder structure will contain S7Proj and STEP7 subfolders; if it is wrapped in a single archive, rename or open it as a .zip in SIMATIC Manager's Retrieve dialog.
Downloading the Project to the Replacement CPU
The download sequence is identical regardless of the recovery path used:
- Set the replacement CPU's MPI address via the rotary switch to match the original. If you change the address, also update the online interface parameters in the project under PLC → Properties → Interface.
- Connect the PC adapter, set the PG/PC interface, and place the CPU in STOP.
- Select the Blocks folder and click Download. STEP 7 transfers OB, FB, FC, DB, SDB, and SFC content in that order. The progress bar and online window show each block.
- When the download completes, perform a CPU memory reset (MRES) only if the CPU will not start. A memory reset clears work RAM and forces a fresh reload from MMC; the MMC contents are preserved.
- Switch to RUN. Monitor the CPU diagnostics buffer (PLC → Diagnostic Buffer) for the last 50 events. The first entry should be a successful restart; any subsequent entry reading "Startup not possible" or "Module not configured" indicates a configuration mismatch between the loaded HW Config and the actual rack population.
If you must also update the hardware configuration (for example, to add or remove a module), open HW Config, modify the rack, and save and compile. The CPU then re-loads SDBs on the next download.
Migrating a STEP 7 V5.x Project to TIA Portal
To move a STEP 7 V5.x S7-300 project into the TIA Portal engineering environment, the TIA Portal installation must include the optional "STEP 7 V5" package. This package is not selected by default and is the most common cause of the error: "The migration option is not installed in the TIA Portal, as it was not activated during setup."
- Close TIA Portal and run the Setup in modify mode (Control Panel → Programs → TIA Portal → Change).
- Select "Modify" and on the Packages screen, check "STEP 7 V5". Continue the installation.
- Re-launch TIA Portal. Open or create the target project, then choose Project → Migrate project and point to the STEP 7 V5.x project file (
.s7p). - Review the migration log. Blocks with unsupported constructs (S5-standard FBs, custom data types that reference deleted system blocks, or absolute pointer arithmetic) appear with warnings. Most OB1, FB, FC, DB, and UDT content migrates cleanly.
- After migration, recompile the project, re-insert the CPU into the device view, and verify that the module addresses match the physical rack.
If migration continues to fail after reinstalling the optional package, verify that the STEP 7 V5.x project is not a TIA-Portal-generated S7-300 subproject (these round-trip but require a compatible TIA Portal version) and that the project does not use Smart Access tags or S7-1500-specific instructions.
For an authoritative reference on the migration scope and limitations, see the Migrating from STEP 7 V5 to TIA Portal entry in Siemens Industry Online Support.
Migrating to S7-1200 or S7-1500: Hardware Considerations
Replacing the S7-300 with an S7-1200 or S7-1500 is not a drop-in swap. The following hardware-level deltas must be accounted for before commissioning:
| Subsystem | S7-300 (CPU 312) | S7-1200 | S7-1500 |
|---|---|---|---|
| Digital I/O modules | SM 321/322 (6ES7 3xx) | SM 1221/1222/1223 (6ES7 2xx) | ET 200SP / S7-1500 SM (6ES7 5xx / 6ES7 1xx) |
| Analog I/O modules | SM 334 (6ES7 334) | SB/SM 1231/1232/1234 (6ES7 2xx) | ET 200SP AQ/IQ modules |
| MPI | Standard on CPU 31x | Not available | Not available |
| PROFINET | Only on 31x PN/DP variants | Standard (1 or 2 ports) | Standard (2 ports) |
| PROFIBUS DP | Yes (on 31x-2DP) | Via CM 1243-5 | Via CM 1542-5 |
| Memory card | MMC (proprietary) | SIMATIC Memory Card (SD-form factor, different file system) | SIMATIC Memory Card (SD-form factor) |
Because the CPU 312 only communicates via MPI, every peripheral device (HMI, drives, third-party controllers) on the MPI segment must be re-engineered on PROFIBUS or PROFINET. The S7-1500 migration path is the most direct; Siemens provides a tool in TIA Portal (S7-300 → S7-1500 migration) that translates the hardware configuration, I/O symbols, and most of the STEP 7 code, and is documented under Migrating an S7-300 to an S7-1500.
HMI Compatibility and Communication Protocols
Identify the HMI part number before any CPU swap. The HMI's connection to the CPU defines which replacement paths are feasible:
- MPI HMI (e.g., OP 73, TP 177A, OP 77B, MP 177): can only communicate with an MPI-equipped CPU. S7-1200/1500 do not support MPI. Either retain the S7-300 CPU or replace the HMI with a PROFINET-capable Comfort Panel (e.g., KTP1200 Comfort 6AV2 124-1MC01-0AX0) and re-engineer the project in WinCC Comfort / TIA Portal.
- PROFIBUS HMI (e.g., MP 277, TP 277, OP 277B): compatible with both S7-300 and S7-1200/1500 when a CM/CP PROFIBUS module is added on the S7-1200/1500 side. Some Comfort Panels also have PROFIBUS variants.
- PROFINET HMI (e.g., Comfort Panels, Unified Comfort Panels): native PROFINET; no extra module required on the CPU.
Tags and screens defined in ProTool, WinCC flexible, or WinCC TIA must be migrated in the same engineering session as the CPU. A half-migrated station (TIA Portal CPU + WinCC flexible HMI) is not supported.
Verification, Commissioning, and Safety Checks
After download, perform the following verification sequence before returning the machine to production:
- Online → Compare Blocks: confirms that the offline project in the engineering station matches the project in the CPU's work RAM.
- Diagnostic Buffer: must be free of "Module error," "I/O access error," or "Communication error" entries. The last entry should be a clean warm restart.
- Monitor / Modify (VAT): force each digital output briefly (0.5 s pulse) to verify the slot address resolves to the correct channel on the SM 322-1BH01. Repeat for the SM 321-1BH02 inputs by toggling field signals.
- Analog loop check: the SM 334-0KE00-0AB0 has four inputs and two outputs, 12-bit resolution. Apply 0%, 25%, 50%, 75%, 100% of span (typically 0–10 V or 0–20 mA, jumper-selected per channel) and verify the raw value via the corresponding Process Image word (PIW) address.
- Function test: run the machine through one full cycle. The S7-300 with CPU 312 has only 32 KB work memory, so the program may not contain a full simulation; rely on operator sign-off per machine-specific I/O list.
Troubleshooting Matrix
| Symptom | Probable Cause | Resolution |
|---|---|---|
| CPU stays in STOP with SF lit after MMC swap | MMC is corrupt, wrong file system, or from a different CPU family | Reformat MMC in a working CPU of the same family; reload blocks; if MMC hardware is dead, replace the MMC |
| Online → "Accessible node" returns no devices | Wrong baud rate, MPI address mismatch, missing bus terminator, defective PC adapter | Set PG/PC interface to PC Adapter (Auto); verify CPU MPI address via the rotary switch; check that the PROFIBUS connector has terminator ON at both ends of the segment |
| Download fails with "Online: Connection to PLC broken" | Incorrect interface parameter, USB driver issue, voltage dip on rack | Re-seat the PC adapter, check the rack 24 V supply, re-install the Siemens PC Adapter USB driver |
| SF LED on after download, but CPU goes to RUN | I/O module type mismatch or wrong slot in HW Config | Open HW Config, compare against the physical rack, recompile and re-download SDBs |
| BF LED flashes at 1 Hz | PROFIBUS cable broken, terminator missing, slave address conflict | Check the PROFIBUS DP segment with a BT-200 tester; verify slave addresses against the project |
| TIA Portal migration fails: "migration option is not installed" | STEP 7 V5 optional package not selected at TIA Portal setup | Run TIA Portal setup in Modify mode and enable the STEP 7 V5 package; reboot and retry migration |
| Download completes but blocks have only "Header" entries | Know-how protection blocks without the original password | Retrieve the password from the engineering documentation archive; the program cannot be reverse-engineered from the compiled block |
| CPU 312 fails to start with new MMC, no SF | Wrong MMC capacity (too small for project size) or third-party SD card | Use a Siemens MMC at least 64 KB (6ES7 953-8LF20-0AA0); verify the project size in STEP 7 → PLC → Module Information → Memory |
FAQ
Can I swap the MMC from a defective S7-300 CPU directly into a replacement CPU?
Yes. Power down the rack, remove the MMC from the defective CPU, and insert it into a compatible replacement (for example, 6ES7312-1AE14-0AB0 in place of 6ES7312-1AE13-0AB0). On power-up, the replacement CPU unpacks the project from the MMC and runs it as-is, provided the rack population matches the hardware configuration stored on the card.
What MMC size is required for an S7-300 CPU 312?
The CPU 312 has 32 KB of work memory, so a 64 KB Siemens MMC (6ES7953-8LF20-0AA0) is the minimum. Larger cards (128 KB up to 4 MB, part numbers 6ES7953-8LG/LJ/LL/LM/LP20-0AA0) are supported and do not change the runtime behavior. Third-party SD cards are not recommended; Siemens MMCs use a proprietary flash layout that the CPU firmware recognizes.
How do I retrieve a STEP 7 V5.x project from a .zip archive?
In the SIMATIC Manager, select File → Retrieve, browse to the .zip (or .arj) file, and choose a target directory. STEP 7 extracts the project and opens it. Verify that the Blocks folder contains OB1, OB100, your FBs, FCs, and DBs, then connect to the replacement CPU and download.
Why does TIA Portal report "the migration option is not installed" even after a fresh installation?
The STEP 7 V5 optional package is not selected by default. Re-run the TIA Portal setup in Modify mode, enable "STEP 7 V5" on the Packages screen, and complete the install. Launch TIA Portal and the migration option under Project → Migrate project becomes available.
Can I replace the S7-300 CPU 312 with an S7-1200 or S7-1500 without re-engineering the entire station?
No. S7-1200 and S7-1500 use different I/O modules, do not support MPI, and require TIA Portal-based engineering. The S7-300 SM modules (6ES7 3xx) are not mechanically or electrically compatible. You must replace the I/O cards, re-engineer the HMI to PROFINET (MPI is unsupported), and migrate the STEP 7 V5 project into TIA Portal before download. The S7-1500 is the more direct successor thanks to the Siemens S7-300 → S7-1500 migration tool.