S5→S7 Periphery Address Mapping: PEW/PAW/PEB/PAB Conversion
Reference table for converting S5 peripheral input/output addresses (PEW, PAW, PEB, PAB) to S7 equivalents. Covers analog modules, direct I/O access, and address assignment differences.
S5→S7 Periphery Address Mapping: PEW/PAW/PEB/PAB Conversion
Peripheral addresses (PEW, PAW, PEB, PAB) provide direct access to I/O modules, bypassing the process image. In S5 and S7, the mnemonics and address ranges differ. This reference covers the conversion.
What Are Peripheral Addresses?
Normal I/O access in a PLC reads from the process image — a snapshot of all inputs taken at the beginning of each scan cycle and all outputs written at the end. Peripheral access reads/writes directly from/to the I/O module hardware, outside the process image update cycle.
When peripheral access is used:
- Analog input modules (PEW for analog input word)
- Analog output modules (PAW for analog output word)
- Fast signals that cannot wait for the next process image update
- Diagnostic reads from intelligent modules
Address Mnemonics: S5 vs. S7
German Mnemonics (SIMATIC default)
| Access | S5 | S7 | Description |
|---|---|---|---|
| Peripheral input byte | PEB | PEB | Peripheral Input Byte (Peripherie-Eingangsbyte) |
| Peripheral input word | PEW | PEW | Peripheral Input Word (Peripherie-Eingangswort) |
| Peripheral input double word | PED | PED | Peripheral Input Double Word |
| Peripheral output byte | PAB | PAB | Peripheral Output Byte (Peripherie-Ausgangsbyte) |
| Peripheral output word | PAW | PAW | Peripheral Output Word (Peripherie-Ausgangswort) |
| Peripheral output double word | PAD | PAD | Peripheral Output Double Word |
International Mnemonics (IEC)
| Access | S7 International | Description |
|---|---|---|
| Peripheral input byte | PIB | Peripheral Input Byte |
| Peripheral input word | PIW | Peripheral Input Word |
| Peripheral input double word | PID | Peripheral Input Double Word |
| Peripheral output byte | PQB | Peripheral Output Byte |
| Peripheral output word | PQW | Peripheral Output Word |
| Peripheral output double word | PQD | Peripheral Output Double Word |
Key point: The German mnemonics (PEW, PAW) are identical between S5 and S7. The addresses may differ depending on hardware configuration, but the mnemonic itself does not change.
Address Ranges: S5 vs. S7
S5 Address Assignment
In S5, peripheral addresses are fixed by slot position in the rack:
| Rack | Slot | Address Range |
|---|---|---|
| 0 (Central) | 0–7 | PEW/PAW 128–254 (analog typically starts at 128) |
| 1 (Expansion) | 0–7 | Depends on configuration |
S5 analog modules were typically assigned starting at address 128 (PEW 128 for the first analog input channel).
S7 Address Assignment
In S7, peripheral addresses are configurable in hardware configuration:
- S7-300: Addresses assigned based on rack/slot, but can be modified in HW Config
- S7-1500 (TIA Portal): Addresses are freely configurable per module. Default addresses are auto-assigned but can be changed.
Migration implication: S5 address PEW 128 does not automatically become PEW 128 in S7. The address depends on where you configure the analog module in the S7 hardware configuration. You must create an explicit address mapping.
Common Conversion Examples
| S5 Code | Purpose | S7 Equivalent | Notes |
|---|---|---|---|
L PEW 128 | Read first analog input | L PEW xxx | xxx depends on S7 HW config |
T PAW 128 | Write first analog output | T PAW xxx | xxx depends on S7 HW config |
L PEB 0 | Read digital input byte directly | L PEB xxx | Rarely needed in S7 (use process image) |
Analog Value Ranges
| System | Module Type | Raw Value Range |
|---|---|---|
| S5 (analog) | AI module | Varies by module (often ±2048 or ±512 for old modules) |
| S7-300/400 (analog) | SM 331 | 0–27648 (unipolar) or ±27648 (bipolar) |
| S7-1200 (analog) | AI module | 0–27648 (unipolar) |
| S7-1500 (analog) | AI module | 0–27648 (unipolar) |
Migration trap: S5 analog modules often had different raw value ranges than S7. When migrating, the analog scaling in the program must be adjusted to match the new module's range. A formula designed for 0–512 will produce wrong results with 0–27648.
Direct Peripheral Access in SCL
In SCL, peripheral access uses the same syntax but with the % prefix for IEC-style addressing:
// Read analog input (German mnemonic)
rawValue := PEW 256;
// Write analog output
PAW 256 := outputValue;
// SCL with IEC addressing
rawValue := %IW256; // PIW 256
%QW256 := outputValue; // PQW 256
Best practice on S7-1500: Avoid direct peripheral access when possible. Use the process image (standard I/O access) and configure process image partitions (OB6x) for time-critical I/O instead.
Frequently Asked Questions
Do PEW/PAW addresses change when migrating S5→S7?
The mnemonics stay the same (PEW is PEW in both systems). But the actual address numbers depend on the hardware configuration. In S5, addresses were fixed by slot. In S7, they are configurable. You must map each module's address in the S7 hardware configuration.
When should I use peripheral access instead of process image?
Only when you need to read/write a value outside the normal scan cycle — typically for analog values that must be read at a specific point in the program, or for diagnostic data from intelligent modules. For normal digital I/O, always use the process image.
Map Your Peripheral Addresses Automatically
PLCcheck Pro identifies all peripheral access instructions in your S5 program and generates an address mapping table for your S7 hardware configuration.
Upload S5 code for address mapping → | Complete Address Mapping Reference →
Part of the Address Mapping Reference. Maintained by PLCcheck.ai. Not affiliated with Siemens AG.
Related Articles
Handling S5 Special Function Blocks (OB, SB) in S7
How to migrate S5 organization blocks (OB) and step blocks (SB) to S7. Covers OB number mapping, startup OBs, interrupt OBs, and SB conversion strategies.
12 min read
migration-guideS5 Absolute Addressing vs. S7 Symbolic Addressing
Why S5 uses absolute addresses (E 0.0, MW 10, DB10.DW5) and S7 prefers symbolic names (Start_Button, Temperature, Motor.Speed). Migration strategy for converting absolute to symbolic.
8 min read
migration-guideMigrating S5 Counter Programs (Z/ZV/ZR) to S7
How to migrate S5 counter programs to S7. Covers ZV (count up), ZR (count down), BCD format differences, S7 equivalents (S_CU, S_CD, CTU, CTD, CTUD), and common pitfalls.
10 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.