S5 to S7 Migration: The Complete Guide (2026)
Step-by-step guide for migrating Siemens S5 PLC programs to S7-1500. Covers AWL→SCL conversion, timer mapping, address translation, and hardware selection.
S5 to S7 Migration: The Complete Guide (2026)
Migrating a Siemens S5 PLC to S7-1500 requires converting AWL/STL code to SCL, translating S5 addresses to S7 byte-addressing, replacing BCD timers with IEC timers, and selecting compatible S7-1500 hardware. This guide covers every step of the process with concrete code examples.
Siemens ended all S5 support on September 30, 2020. No spare parts, no repairs, no technical support. Every S5 system still running is operating on borrowed time. The S7-300 — the most common migration target until recently — entered its own phase-out on October 1, 2023, with spare parts guaranteed only until 2033. The only future-proof target is the S7-1500 with TIA Portal.
Why You Must Migrate Now
The SIMATIC S5 was launched in 1979 and served the industry for over 40 years. Since October 1, 2020, Siemens provides zero support for the entire S5 product family. Here is what that means in practice:
No spare parts from Siemens. A failed CPU module cannot be replaced through official channels. Third-party refurbished parts exist but at 3–10× the original price, with no guaranteed availability and limited warranty.
No software support. STEP 5 runs on DOS or Windows XP. Modern operating systems do not support it natively. The programming cable (PG cable with AS511 protocol) requires legacy hardware interfaces.
No qualified personnel. Engineers who learned S5 programming in the 1980s and 1990s are retiring. Finding someone who can troubleshoot S5 AWL code becomes harder every year.
The S7-300 is next. If you were considering migrating S5 to S7-300 — don't. The S7-300 entered product discontinuation (PM410) on October 1, 2025. From that date, components are only available as spare parts at increasing prices. Spare part availability is guaranteed only until October 2033. The only migration target that makes sense today is the S7-1500.
The 6-Step Migration Process
Step 1: Document the Existing S5 Program
Before touching any code, create a complete inventory of the existing system:
- Block list: All OBs, PBs, FBs, FXs, SBs, DBs, DXs with their sizes
- I/O map: All physical inputs (E), outputs (A), and their wiring
- Cross-reference list: Which blocks call which, which addresses are used where
- Timer/counter list: All T and Z addresses with their configured values
- Symbol table: If available (many S5 programs have no symbolic names)
Use STEP 5 or S5 for Windows (S5W) to generate these lists. If you have only the S5D binary file without original software, a demo version of S5W can open files for offline viewing.
PLCcheck Pro tip: Upload your S5 AWL source code and get an instant analysis with block inventory, cross-references, timer list, and I/O map — without needing STEP 5 software. Try PLCcheck Pro →
Step 2: Select S7-1500 Hardware
Choose an S7-1500 CPU based on two critical parameters from your S5 system:
Work memory: Your S7-1500 needs at least 2× the S5 program memory. S7 programs are larger because SCL code is more verbose than AWL, and S7 uses byte-addressing (doubling DB sizes).
I/O addressing capacity: Count total digital and analog I/O points. The S7-1500 supports all common S5 I/O configurations via PROFINET-connected ET 200SP distributed I/O.
Common S5 → S7-1500 CPU mapping:
| S5 CPU | Memory | Recommended S7-1500 | S7-1500 Memory |
|---|---|---|---|
| S5-90U / S5-95U | 2–8 KB | CPU 1511-1 PN | 150 KB |
| S5-100U (CPU 103) | 6–16 KB | CPU 1511-1 PN | 150 KB |
| S5-115U (CPU 941–944) | 16–64 KB | CPU 1513-1 PN | 300 KB |
| S5-135U (CPU 922/928) | 64–256 KB | CPU 1515-2 PN | 750 KB |
| S5-155U (CPU 946/947/948) | 256–512 KB | CPU 1517-3 PN/DP | 2 MB |
I/O adapter modules: Siemens offers adapter modules (e.g., IM 461-1) that allow reusing existing S5 I/O racks with S7 controllers. This can reduce migration cost and downtime significantly by keeping existing field wiring intact.
Step 3: Convert the PLC Program
You have three options:
Option A: Use the Siemens S5→S7 Converter (fastest, ~60–80% automatic)
The STEP 7 software (V5.x) includes a built-in S5→S7 conversion tool. It converts S5 AWL source files into S7 STL source files.
What the converter handles: basic logic (U, O, UN, ON, S, R, =), load/transfer (L, T), jumps (SPA, SPB), basic arithmetic (+F, -F), comparisons.
What the converter does NOT handle:
- Timers: S5 KT format → must be manually converted to IEC timers (TON/TOF/TP)
- Data blocks: DW word-addressing → DBW byte-addressing (multiply by 2)
- Indirect addressing: DO, LIR, TIR, B MW → pointer/AR1/AR2 addressing
- Special blocks: OB21/22 (startup), SB, S5 system FBs (FB250/FB251 for analog I/O)
- Extended DBs: DX blocks have no S7 equivalent
Option B: Rewrite in SCL (best long-term, most effort)
Rewriting the program in SCL produces the cleanest result. SCL is the IEC 61131-3 Structured Text language and the recommended programming language for S7-1500.
Option C: Hybrid approach (recommended)
Use the converter for basic logic, then manually convert timers, data blocks, and special functions. Finally, refactor critical sections into SCL for maintainability. This is the most common approach in practice.
Step 4: Convert Timers and Counters
This is the most error-prone step. S5 timers use a BCD-encoded format (KT) with a time base selector. S7 IEC timers use the TIME data type.
S5 timer format: KT [value].[timebase]
- Time base 0 = 10 ms, 1 = 100 ms, 2 = 1 s, 3 = 10 s
- Example: KT 030.2 = 30 × 1 s = 30 seconds
S5 timer types → S7 IEC equivalents:
| S5 Timer | S5 Name | S7 IEC | S7 Function |
|---|---|---|---|
| SI | Pulse | TP | Generates a pulse of fixed duration |
| SE | Extended Pulse | TP | Generates a pulse, restarts on re-trigger |
| SD | On Delay | TON | Output ON after delay |
| SS | Retentive On Delay | TON | Like SD, but retains elapsed time |
| SA | Off Delay | TOF | Output OFF after delay |
Example conversion:
S5 AWL:
U E 0.0
L KT 030.2
SD T 1
U T 1
= A 4.0
S7 SCL:
"Timer_Conveyor"(
IN := "Start_Button",
PT := T#30s,
Q => "Motor_Run",
ET => "Elapsed_Time"
);
Free tool: Use our S5 Timer Calculator to convert any KT value to seconds and IEC format instantly.
Step 5: Convert Addresses
S5 and S7 use different addressing schemes. Inputs, outputs, and flags are straightforward. Data blocks are the critical difference.
Simple conversions (address number stays the same):
| S5 (German) | S7 (German) | S7 (English) | Type |
|---|---|---|---|
| E 0.0 | E 0.0 | I 0.0 | Input bit |
| EW 0 | EW 0 | IW 0 | Input word |
| A 4.0 | A 4.0 | Q 4.0 | Output bit |
| M 10.0 | M 10.0 | M 10.0 | Flag/memory bit |
| MW 100 | MW 100 | MW 100 | Flag/memory word |
Data block conversion (CRITICAL — most common error):
S5 uses word addressing (DW). S7 uses byte addressing (DBW). The S7 address is always S5 address × 2.
| S5 | S7 | Calculation |
|---|---|---|
| DB10 DW 0 | DB10.DBW 0 | 0 × 2 = 0 |
| DB10 DW 1 | DB10.DBW 2 | 1 × 2 = 2 |
| DB10 DW 5 | DB10.DBW 10 | 5 × 2 = 10 |
| DB10 DW 100 | DB10.DBW 200 | 100 × 2 = 200 |
Free tool: Use our S5→S7 Address Converter to convert any S5 address to S7 format with explanation.
Step 6: Test, Commission, and Go Live
Offline testing: Use PLCSIM (included with TIA Portal) to simulate the S7 program before connecting to real hardware.
Cutover strategy:
- Big Bang: Switch from S5 to S7 in one shutdown window. Fastest but highest risk.
- Gradual: Migrate one section at a time using IM adapter modules.
- Hot standby: Run S7 in shadow mode, switch over when confidence is high.
Common Pitfalls
1. Forgetting the DW × 2 conversion. Every data block address must be doubled. Missing even one creates silent data corruption.
2. Assuming S5 timers work the same in S7. Always use IEC timers (TON, TOF, TP), not S5 legacy timers.
3. Ignoring OB21/OB22 startup blocks. S5 uses OB21 (warm restart) and OB22 (cold restart). S7 uses OB100 and OB102.
4. Not testing indirect addressing. S5 commands like DO FW, LIR, TIR have no direct S7 equivalents.
5. Losing the S5 backup. Before starting migration, create multiple backups of the S5 program on different storage media.
Migration Checklist
- Back up complete S5 program (S5D file, multiple copies)
- Create block inventory (OB, PB, FB, FX, SB, DB, DX)
- Document all I/O addresses with wiring diagrams
- List all timers with KT values and convert to IEC format
- List all counters with types (ZV/ZR) and convert to CTU/CTD
- Map all data block addresses (DW × 2 = DBW)
- Identify special S5 blocks (OB21/22, system FBs, DO/LIR/TIR)
- Select S7-1500 CPU and I/O configuration
- Run S5→S7 converter on AWL source
- Fix all converter errors manually
- Convert remaining code to SCL where possible
- Test in PLCSIM with simulated I/O
- Commission on real hardware with safety backup
- Verify all timer durations match original S5 behavior
- Verify all data block values are correctly addressed
- Update HMI/SCADA system to communicate with S7
- Create final documentation with cross-reference tables
What PLCcheck Pro Does for You
PLCcheck Pro automates the most time-consuming parts of S5→S7 migration:
- Explain: Upload S5 AWL code and get a plain-language explanation of every block.
- Document: Generate complete program documentation with I/O map and cross-references.
- Migrate: Convert S5 AWL to S7 SCL with correct timer conversion and address mapping.
- Optimize: Identify dead code, unused variables, and potential bugs.
Maintained by PLCcheck.ai. Last update: March 2026. Not affiliated with Siemens AG.
Related Articles
S7-300 to S7-1500 Migration: Complete Guide
Step-by-step guide for migrating Siemens S7-300 PLC programs to S7-1500 using TIA Portal. Covers hardware mapping, software migration wizard, optimized data blocks, AWL→SCL conversion, and common pitfalls.
15 min read
migration-guideThe Siemens S5/S7 Converter Tool: What It Does and What It Doesn't
Honest assessment of the Siemens STEP 7 S5→S7 conversion tool. What it converts automatically, what it cannot handle, common errors, and how to deal with the remaining 20–40% that requires manual work.
12 min read
migration-guideConverting S5 AWL to S7 SCL: Step-by-Step
Practical guide for converting Siemens S5 AWL (Instruction List) code to S7 SCL (Structured Text). Includes conversion tables, code examples for bit logic, timers, counters, jumps, and data blocks.
14 min read
Analyze your PLC code with AI
PLCcheck Pro explains, documents, optimizes, and migrates PLC code — automatically.
Try PLCcheck Pro →Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7, and TIA Portal are trademarks of Siemens AG.