S5 to S7 Data Block Address Mapping: DW → DBW (×2 Rule)
Critical S5 to S7 data block address conversion. The DW×2 rule: S5 DW n becomes S7 DBW (n×2). Complete conversion table with bit-level mapping. The #1 source of migration errors.
S5 to S7 Data Block Address Mapping: DW → DBW (×2 Rule)
This is the most error-prone address conversion in S5→S7 migration. S5 addresses data block words by word number (DW 0, DW 1, DW 2). S7 addresses by byte offset (DBW 0, DBW 2, DBW 4). Since each word is 2 bytes, the conversion rule is: S7 byte address = S5 word number × 2.
The ×2 Rule
S7 DBW address = S5 DW number × 2
Word Conversion Table
| S5 AWL | S7 STL | Calculation | Description |
|---|---|---|---|
| DW 0 | DBW 0 | 0 × 2 = 0 | First word |
| DW 1 | DBW 2 | 1 × 2 = 2 | Second word |
| DW 2 | DBW 4 | 2 × 2 = 4 | Third word |
| DW 3 | DBW 6 | 3 × 2 = 6 | Fourth word |
| DW 4 | DBW 8 | 4 × 2 = 8 | Fifth word |
| DW 5 | DBW 10 | 5 × 2 = 10 | |
| DW 8 | DBW 16 | 8 × 2 = 16 | |
| DW 10 | DBW 20 | 10 × 2 = 20 | |
| DW 15 | DBW 30 | 15 × 2 = 30 | |
| DW 20 | DBW 40 | 20 × 2 = 40 | |
| DW 50 | DBW 100 | 50 × 2 = 100 | |
| DW 100 | DBW 200 | 100 × 2 = 200 | |
| DW 255 | DBW 510 | 255 × 2 = 510 |
Double Word (DD → DBD)
| S5 AWL | S7 STL | Calculation |
|---|---|---|
| DD 0 | DBD 0 | 0 × 2 = 0 |
| DD 1 | DBD 2 | 1 × 2 = 2 |
| DD 2 | DBD 4 | 2 × 2 = 4 |
| DD 4 | DBD 8 | 4 × 2 = 8 |
Note: DD in S5 accesses 4 bytes starting at word n. DD 0 = DW 0 + DW 1. In S7, DBD 0 = DBW 0 + DBW 2 = bytes 0–3. Same data, different numbering.
Byte Access (DL/DR → DBB)
S5 uses DL (left byte = high byte) and DR (right byte = low byte) within a word:
| S5 AWL | S7 STL | Description |
|---|---|---|
| DL 0 | DBB 0 | High byte of DW 0 |
| DR 0 | DBB 1 | Low byte of DW 0 |
| DL 1 | DBB 2 | High byte of DW 1 |
| DR 1 | DBB 3 | Low byte of DW 1 |
| DL n | DBB (n×2) | High byte of DW n |
| DR n | DBB (n×2 + 1) | Low byte of DW n |
Bit Access (D x.y → DBX)
S5 bit access within data blocks uses D word.bit:
| S5 AWL | S7 STL | Calculation |
|---|---|---|
| D 0.0 | DBX 1.0 | Word 0, bit 0 → byte 1, bit 0 |
| D 0.7 | DBX 1.7 | Word 0, bit 7 → byte 1, bit 7 |
| D 0.8 | DBX 0.0 | Word 0, bit 8 → byte 0, bit 0 |
| D 0.15 | DBX 0.7 | Word 0, bit 15 → byte 0, bit 7 |
| D 1.0 | DBX 3.0 | Word 1, bit 0 → byte 3, bit 0 |
| D 1.8 | DBX 2.0 | Word 1, bit 8 → byte 2, bit 0 |
| D 25.3 | DBX 51.3 | Word 25, bit 3 → byte 51, bit 3 |
| D 25.8 | DBX 50.0 | Word 25, bit 8 → byte 50, bit 0 |
Bit mapping formula:
- S5 bit 0–7 (low byte) → S7 DBX (word×2 + 1).bit
- S5 bit 8–15 (high byte) → S7 DBX (word×2).(bit - 8)
DB Access Syntax
| S5 AWL | S7 STL | Description |
|---|---|---|
| A DB 10 | OPN DB 10 | Open data block 10 |
| L DW 5 | L DBW 10 | Load word 5 (after A DB) → byte 10 |
| L DB10.DW5 | L DB10.DBW10 | Direct access (no A DB needed in S7) |
S7 advantage: In S7, you can access DB10.DBW10 directly without opening the DB first. In S5, A DB 10 must precede data access.
This Is the #1 Migration Error
Forgetting the ×2 conversion causes the program to read/write wrong data. The program compiles without errors — the addresses are syntactically valid. But the data is shifted by half, causing unpredictable behavior.
Example of the error:
- S5 code reads DW 5 (timer setpoint = 3000 ms)
- Incorrect migration: L DBW 5 → reads the wrong memory location
- Correct migration: L DBW 10 → reads the correct setpoint
Use our free S5→S7 Address Converter to verify any conversion.
Part of the S5→S7 Address Mapping Reference. Maintained by PLCcheck.ai.
Related Articles
S5 to S7 Address Mapping: Complete I/O Conversion Table
Complete reference for converting Siemens S5 PLC addresses to S7 format. Covers inputs (E→I), outputs (A→Q), flags (M/F), data blocks (DW→DBW×2 with bit-level mapping), timers, counters, and peripherals.
14 min read
migration-guideUnderstanding S5 Data Blocks (DB0, DB1, DX0) in S7
What are S5 system data blocks DB0, DB1, and DX0? Why they exist, what they contain, and how to handle them during S5 to S7 migration.
10 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.