Converting 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.
Converting S5 AWL to S7 SCL: Step-by-Step
AWL (Anweisungsliste / Statement List) is a low-level, assembler-like PLC language. SCL (Structured Control Language / Structured Text) is a high-level, Pascal-like language. Converting AWL to SCL means replacing implicit processor operations (accumulator, RLO, status word) with explicit variable assignments and control structures. This guide shows the conversion pattern for every common AWL construct.
AWL is deprecated on S7-1500. Siemens removed native STL support from S7-1200 entirely and runs it only in emulation mode on S7-1500. Every AWL program must eventually be converted to SCL, LAD, or FBD.
The Core Concept: RLO Becomes Boolean Expressions
AWL operates on an implicit RLO (Result of Logic Operation). SCL has no RLO. Every bit logic chain must become an explicit Boolean expression.
AWL:
U E 0.0
U E 0.1
UN M 10.0
= A 4.0
SCL:
"Motor_Run" := "Start_Button" AND "Safety_OK" AND NOT "Fault_Active";
Conversion Table: Bit Logic
| AWL (DE) | STL (EN) | SCL | Example |
|---|---|---|---|
| U | A | AND | A AND B |
| UN | AN | AND NOT | A AND NOT B |
| O | O | OR | A OR B |
| ON | ON | OR NOT | A OR NOT B |
| S | S | := TRUE (conditional) | IF cond THEN x := TRUE; END_IF; |
| R | R | := FALSE (conditional) | IF cond THEN x := FALSE; END_IF; |
| = | = | := | output := expression; |
| FP | FP | R_TRIG | R_TRIG_inst(CLK := input); |
| FN | FN | F_TRIG | F_TRIG_inst(CLK := input); |
Conversion Table: Load, Transfer, Arithmetic
| AWL | SCL | Notes |
|---|---|---|
L MW 10 | tempInt := MW10; | Load memory word |
T MW 20 | MW20 := tempInt; | Transfer to memory word |
+F / +I | + | Integer addition |
-F / -I | - | Integer subtraction |
TAK | (swap variables) | Use temp variable |
AWL accumulator math → SCL direct expression:
AWL: L MW10 / L MW12 / +I / T MW20 → SCL: MW20 := MW10 + MW12;
Converting Jumps to IF/THEN/ELSE
AWL:
U E 0.0
SPB M001
L 0
T MW 20
SPA M002
M001: L 100
T MW 20
M002: NOP 0
SCL:
IF "Start_Button" THEN
MW20 := 100;
ELSE
MW20 := 0;
END_IF;
Converting Timers
S5 AWL: U E0.0 / L KT 030.2 / SD T1 / U T1 / = A4.0
S7 SCL:
"Timer_Conveyor"(
IN := "Start_Button",
PT := T#30s
);
"Motor_Run" := "Timer_Conveyor".Q;
| S5 | S7 IEC | Function |
|---|---|---|
| SI | TP | Pulse |
| SE | TP | Extended Pulse |
| SD | TON | On Delay |
| SS | TON | Retentive On Delay |
| SA | TOF | Off Delay |
Use our S5 Timer Calculator to convert any KT value.
Converting Counters
S5: U E1.0 / L KZ 100 / ZV Z3 → S7 SCL: "Counter"(CU := "Sensor", PV := 100);
| S5 | S7 IEC |
|---|---|
| ZV | CTU |
| ZR | CTD |
Converting Data Block Access
S5 DW × 2 = S7 DBW. Example: A DB10 / L DW5 → SCL: DB10.DBW10
See our S5→S7 Address Converter for complete reference.
What Cannot Be Directly Converted
- Indirect addressing (DO, LIR, TIR): Use PEEK/POKE on S7-1500 or keep in STL blocks
- Accumulator operations (TAK, ENT): Use temporary variables
- Status word bits (OV, OS, UO): Use explicit range checks
PLCcheck Pro converts AWL to SCL automatically. Try it now →
Maintained by PLCcheck.ai. Last update: March 2026. Not affiliated with Siemens AG.
Related Articles
STL/AWL Deprecation in S7-1500: Why You Must Convert to SCL
Why AWL/STL runs only in emulation mode on S7-1500, what that means for performance and maintainability, and how to convert your STL code to SCL. Includes conversion strategy and code examples.
10 min read
migration-guideS5 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.
18 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
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.