Converting STEP 5 to STEP 7: S5/S7 Converter and TIA Portal

David Krause12 min read
SiemensTIA PortalTutorial / 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

Converting STEP 5 to STEP 7: S5/S7 Converter and TIA Portal

Siemens SIMATIC S5 controllers (S5-90U, S5-95U, S5-100U, S5-115U, S5-135U, S5-155U) reached end-of-life decades ago, but a large installed base still runs STEP 5 programs written in STL, LAD, CSF, or SCL. Modern S7-300, S7-400, and TIA Portal controllers require STEP 7 (SIMATIC Manager) or TIA Portal projects. Migrating legacy code therefore involves two distinct toolchains: the S5/S7 Converter (ships with STEP 7 classic) for the first hop into STEP 7, and the TIA Portal migration tool for the second hop into the current engineering framework. This reference documents both stages, the conversion errors you will hit, and the manual fix-up steps required when automated conversion cannot resolve them.

1. Migration Path Overview

A STEP 5 project does not become a TIA Portal project in a single operation. Siemens defines the canonical path as two sequential transformations:

  1. STEP 5 → STEP 7 (classic): Performed by the S5/S7 Converter that ships with STEP 7 V5.x. The tool reads *.S5D files and emits a STEP 7 project consumable by SIMATIC Manager.
  2. STEP 7 (classic) → TIA Portal: Performed by the TIA Portal migration tool, which reads the STEP 7 V5.x project and produces a *.ap20 / *.am20 migration project that TIA Portal V20 (or the target version) opens and converts.
Important: The S5/S7 Converter is part of STEP 7 V5.x, not TIA Portal. TIA Portal cannot read *.S5D files directly. Skipping the classic STEP 7 stage is not supported by Siemens tooling.

Per the official Siemens migration documentation, the TIA Portal migration tool produces an initial migration project (*.am20) that the user must open, review, recompile, and save as a regular TIA Portal project. No fully automatic "one-click" path exists for STEP 5 → TIA Portal.

2. Prerequisites and Tool Versions

Tool Version Notes
STEP 5 source files STL / LAD / CSF / SCL Format *.S5D, archive or unzipped directory
STEP 7 (SIMATIC Manager) V5.5 SP4 or later (V5.7 supported) Includes S5/S7 Converter in installation tree
S5/S7 Converter Bundled with STEP 7 V5.x Located at Start → SIMATIC → STEP 7 → S5 Converter
TIA Portal V20 (or target version) Migration tool reads STEP 7 V5.x *.S7P projects
Microsoft Windows 10/11 (TIA V20); 7/10 (STEP 7 V5.5) TIA V20 supports 64-bit Windows only

Install STEP 7 V5.x first and confirm the S5/S7 Converter is present in the Windows Start menu. Verify Windows file association for *.S5D opens the converter rather than a text editor. The conversion manual STEP 7 From S5 to S7 is available on Siemens Industry Online Support as a PDF (entry ID 45531547) and should be downloaded before starting.

3. S5/S7 Converter Workflow

3.1 Launch and select source

  1. Start → SIMATIC → STEP 7 → S5 Converter.
  2. Select File → Open and navigate to the STEP 5 project (*.S5D or unpacked directory containing S5DAT.A0D, S5DAT.A1D, ... S5DAT.A7D).
  3. The converter parses the S5 program and displays the FB/FC/PB/OB structure in a tree view.

3.2 Configure target S7 CPU

The S5/S7 Converter requires a target S7-300 or S7-400 CPU to be selected because the address space, organization blocks, and I/O layout differ from the S5 source. Typical mappings:

S5 Family Recommended S7 CPU Notes
S5-90U / S5-95U S7-314C-2 PN/DP (6ES7314-6EH04-0AB0) Compact, sufficient for small S5 programs
S5-100U S7-314C-2 PN/DP or S7-315-2 PN/DP (6ES7315-2EH14-0AB0) Match I/O count
S5-115U S7-315-2 PN/DP or S7-317-2 PN/DP (6ES7317-2EK14-0AB0) Use 317 for high-FB-count programs
S5-135U / S5-155U S7-414-3 PN/DP (6ES7414-3EM07-0AB0) or S7-416-3 PN/DP (6ES7416-3ES07-0AB0) Large address space, multi-CPU rack support

3.3 Run conversion

Select Convert → Start Conversion. The S5/S7 Converter performs the following sequence internally:

  1. Parses STEP 5 STL statements and translates to STEP 7 STL (AWL) and SCL equivalents.
  2. Maps S5 bit memory, timers, counters, and I/O to S7 equivalent areas:
S5 Operand S7 Equivalent Conversion Note
F 0.0 - F 255.7 (flags) M 0.0 - M 255.7 Direct 1:1 map
T 0 - T 255 (timers) DB or IEC timers in FB S5 timer word becomes multi-instance IEC timer
C 0 - C 255 (counters) DB or IEC counter in FB Same treatment as timers
I 0.0 - I 127.7 I 0.0 - I 127.7 Process image preserved
Q 0.0 - Q 127.7 Q 0.0 - Q 127.7 Process image preserved
PY 0 - PY 255 (peripheral) PIB / PQB / PID / PQD on ET 200S or PN head Distributed I/O mapping
DW 0 - DW 255 (data words) DB with symbolic names Each S5 DX/DY/DW block converted to S7 DB

The conversion manual STEP 7 From S5 to S7 (Siemens entry 45531547) explicitly notes: "The S5/S7 Converter uses STEP 7 instructions to convert indirect addressing with DO FW and DO DW. The instruction sequence generated is generally very extensive." In practice, a single S5 DO FW loop may expand to dozens of STEP 7 STL statements using pointer arithmetic and indirect addressing.

4. STEP 5 vs STEP 7 Instruction Mapping

The S5/S7 Converter handles a large portion of the standard instruction set automatically, but several S5 constructs require manual review. The table below summarizes the principal mappings; a complete list is in the conversion manual.

S5 Instruction STEP 7 Equivalent Conversion
A I 0.0 / O I 0.0 A I 0.0 / O I 0.0 Automatic
L IB 0 / T QB 0 L IB 0 / T QB 0 Automatic
L DW 5 / T DW 5 DB load/store with symbol Auto with symbolic DB
SP T 1 (start pulse timer) SE / SI / SS / SA IEC timer instance Multi-instance in FB
CU C 5 (up counter) IEC_CTU instance Multi-instance in FB
SLW 1 (shift left word) SLW 1 Automatic
DO FW 0 (loop on flag word) Pointer-based indirect addressing Expands; verify manually
DO DW 10 (loop on data word) Pointer-based indirect addressing on DB Expands; verify manually
JU FB 10 (jump unconditional) CALL FB 10 with IN/OUT/STAT/INOUT Interface inferred from declaration
JC FB 10 (conditional) Conditional CALL with RLO check Manual review of branch placement
GED FX 0 (graph block) Not directly supported Manual rewrite required
STEP 5 SCL (structured text) STEP 7 SCL Closely compatible, manual fix-up
Warning: The S5 GED (graph sequencer) and several S5 special function blocks have no direct STEP 7 equivalent. The converter emits placeholder code that will not compile; you must replace these blocks manually with STEP 7 logic or with a third-party sequencer.

5. Handling Conversion Errors and Warnings

When the S5/S7 Converter completes, it produces a diagnostic log. Errors block compilation of the STEP 7 program; warnings do not block but indicate code that requires manual review.

5.1 Common errors

Error Class Example Resolution
Unsupported instruction Step 5 IP/OP modules, IM 308C Replace with PROFINET / PROFIBUS PN head
Memory overflow Flags > M 255.7 (rare S5 programs) Remap to DB
Block not found Call to missing FB Restore source S5 file or comment call
Address conflict Same DB number used twice Renumber and update references
Type mismatch Word written to byte operand Insert explicit type conversion

If errors persist after the converter has produced its best-effort output, manual intervention is required. There is no fully automatic recovery path; users must open the resulting STEP 7 blocks in SIMATIC Manager and edit them directly.

5.2 Common warnings

Warning Meaning Action
Indirect addressing expanded DO FW / DO DW generated verbose code Review for correctness, simplify if possible
Block interface inferred No declaration found in S5 source Verify IN/OUT/INOUT assignment
Symbol lost S5 symbolic name not preserved Add symbol table entry manually
Timer type approximated S5 pulse vs extended pulse distinction Select correct IEC timer (TP, TON, TOF)
Counter type approximated S5 up vs down vs up-down Select correct IEC counter (CTU, CTD, CTUD)

6. Manual Conversion Approach

When the S5/S7 Converter fails or yields code that cannot be salvaged, the only remaining path is manual conversion. The recommended procedure is:

  1. Document the S5 program: Print the STL listing with cross-references; record all FB/FC/PB/DB numbers, the cyclic OB structure, and the I/O map.
  2. Build a new STEP 7 project: In SIMATIC Manager, insert a new S7-300 or S7-400 station, insert the target CPU, and create the OB1 cyclic, OB100 warm restart, OB101 hot restart, OB102 cold restart, and any required error OBs (OB80-OB87) to match the S5 program structure.
  3. Re-create the symbol table: In S7, edit the symbol table (S7 Program → Symbols) and add every S5 symbolic name. This is critical for readability and for the TIA Portal migration step.
  4. Port FBs block by block: Open the S5 STL listing side by side with a new STEP 7 STL source file. Re-translate each instruction. Replace S5 timers/counters with multi-instance IEC blocks within the FB; this requires adding VAR / END_VAR declarations.
  5. Port DBs as UDTs first when shapes repeat: If multiple DBs share the same structure, define a UDT and instantiate it, mirroring S5 DX practice.
  6. Compile, download, and test in PLCSIM: Before touching a real CPU, install S7-PLCSIM V5.x and run the OB1 in simulation against simulated I/O. Walk through the original S5 program state table and confirm each step.

For a 1000-line S5 program, manual conversion typically consumes 2-5 engineering days; for 10,000+ line programs expect several weeks and consider whether a full PLC replacement is more economical.

7. Migrating STEP 7 to TIA Portal

Once a STEP 7 V5.x project compiles cleanly, it can be migrated to TIA Portal. The official Siemens procedure is documented in the TIA Portal help under Migration of STEP 7 projects (S7-300, S7-400):

  1. Open TIA Portal V20 (or target version).
  2. Select Project → Migrate project.
  3. Browse to the STEP 7 V5.x project file (*.S7P).
  4. TIA Portal produces a migration file (*.am20) and opens it. At this stage the project is read-only and displays conversion diagnostics.
  5. Review the migration log. The tool highlights unsupported hardware (e.g., older CP 443-1), unsupported blocks, and licensing notes.
  6. Resolve the migration diagnostics: replace obsolete CPs with current models (e.g., CP 443-1 EX30, 6GK7443-1EX30-0XE0), recompile the SCL and STL sources, and migrate any HMI ProTool projects to WinCC Unified.
  7. Save the result as a normal TIA Portal project (*.ap20).
Hardware replacement notice: TIA Portal migration does not preserve all legacy S7-300/S7-400 modules. Signal modules in the long lifecycle phase (e.g., SM 321-1BL00, 6ES7321-1BL00-0AA0) are mapped; very old modules (SM 321-1BH01 with firmware < V2.0.0) require manual replacement with current equivalents such as SM 321-1BH02 (6ES7321-1BH02-0AA0).

After the STEP 7 V5.x project migrates, every S7-300/S7-400 station and program is visible in the TIA Portal project tree. The HMI connection data, network configuration, and user program are preserved with the diagnostic warnings noted in the migration log.

8. Common Conversion Issues and Diagnostics

Symptom Likely Cause Fix
Converter aborts immediately S5 file corrupt or password-protected Obtain unprotected *.S5D; re-export from PG
Output blocks will not compile in STEP 7 Missing UDT or wrong DB number Compare cross-reference against S5 source
Runtime: outputs flicker on first cycle S5 process image updated continuously; S7 only at OB1 start Insert SET / CLR defaults or use OB100 init
Timer values differ at runtime S5 time base vs IEC TP/TON time base Recalibrate time constants; IEC uses 1 ms ↔ 1 s selection bits
TIA migration: CP not found Legacy CP not in TIA hardware catalog Replace with current CP 443-1 EX30 or similar
TIA migration: SCL source red-lined Syntax change between S7 V5.5 SCL and TIA SCL Review each red entry; STRING and DATE_AND_TIME conversions differ
HMI tags broken after TIA migration ProTool project not supported Re-create HMI in WinCC Unified; re-link tags

9. Verification and Commissioning

Before downloading the converted STEP 7 or TIA Portal program to a real CPU, perform the following verification sequence:

  1. Static checks: Compile in STEP 7 / TIA Portal with no errors and no warnings unresolved.
  2. Cross-reference review: In SIMATIC Manager Options → Reference Data → Display (or TIA Portal Tools → Cross-reference), verify that every input, output, flag, timer, counter, and DB used in the original S5 program has a counterpart in the converted program.
  3. Simulation: Run the program in S7-PLCSIM (STEP 7) or PLCSIM Advanced (TIA Portal). Drive inputs, observe outputs, and compare to the S5 simulation trace if available.
  4. Fatigue test: Run for 24-72 hours of simulated time covering all sequences, fault paths, and operator modes.
  5. Field validation: With the plant in a safe state, download to the real CPU in STOP mode, perform a warm restart (OB100), and step through the first cycle manually with the operator station in hand-control.
  6. Parallel run: If downtime is critical, run the S5 and S7 CPUs in parallel for a defined window and compare outputs via a Y-cable on the field wiring before final cutover.
Safety notice: Conversion of safety-related STEP 5 programs (S5-95F, S5-115F) is not covered by the S5/S7 Converter. Safety functions must be re-implemented on a certified S7-1500F/ET 200SP F system using TIA Portal Safety. Do not attempt to convert F-programs with the standard toolchain.

10. Key Documentation References

Both references are official Siemens documentation and should be cross-checked against the installed TIA Portal version, as the migration tool behavior is updated between major releases (V15, V16, V17, V18, V19, V20).

Which Siemens tool converts STEP 5 (.S5D) projects?

The S5/S7 Converter bundled with STEP 7 V5.x (SIMATIC Manager) converts *.S5D files to STEP 7 V5.x. It is found in the Windows Start menu under SIMATIC → STEP 7 → S5 Converter. TIA Portal cannot read *.S5D directly.

What happens if the S5/S7 Converter reports errors?

Errors block STEP 7 compilation. The converter's best-effort output must be opened in SIMATIC Manager and fixed manually: unsupported instructions (such as GED graph blocks), address conflicts, and missing blocks are typical issues. There is no fully automatic error recovery; manual fix-up is required.

How do I migrate a STEP 7 V5.x project to TIA Portal?

Open the project in TIA Portal V20 (or target version) and use Project → Migrate project. TIA Portal produces a *.am20 migration file, opens it for review, and the user must resolve any migration diagnostics and save as a *.ap20 project. The full procedure is in the TIA Portal help under Migration of STEP 7 projects (S7-300, S7-400).

Can I convert STEP 5 timers and counters automatically?

Yes, the S5/S7 Converter translates SP, SE, SR, SS, SF timer instructions and CU, CD, CUD counter instructions to multi-instance IEC timers (TP, TON, TOF) and IEC counters (CTU, CTD, CTUD) inside an FB. Review the generated FB instance DB to confirm the time base and counter direction match the original S5 behavior.

Are STEP 5 safety programs supported by the converter?

No. The standard S5/S7 Converter does not handle S5-95F or S5-115F safety programs. Safety functions must be re-implemented on a certified S7-1500F or ET 200SP F controller using TIA Portal Safety, following IEC 61508 / IEC 62061 guidelines and TÜV-certified blocks. Do not attempt automatic conversion of F-programs.

Back to blog