S5 AWL Commands: SPA FB / SPA PB (Block Calls)
S5 AWL instructions SPA FB and SPA PB for calling function blocks and program blocks. S7 equivalents: CALL FB / CALL FC.
S5 AWL Commands: SPA FB / SPA PB (Block Calls)
S5 uses SPA (jump) to call blocks. SPA FB calls a function block, SPA PB calls a program block. In S7, both become CALL.
SPA FB — Call Function Block
SPA FB 10 // Call function block FB10
S5 function blocks (FB) have parameters passed through formal operands. The Siemens converter translates FB calls to CALL FB10, DB10 in S7 (FB with instance DB).
SPA PB — Call Program Block
SPA PB 5 // Call program block PB5
S5 program blocks (PB) are parameterless subroutines. In S7, there is no PB type — PBs become FCs (functions).
S7 Equivalents
| S5 AWL | S7 STL | S7 SCL | Notes |
|---|---|---|---|
| SPA FB 10 | CALL FB10, DB10 | FB10_Instance(); | FB with instance DB |
| SPA PB 5 | CALL FC5 | FC5(); | PB becomes FC |
| SPA FX 10 | CALL FB10 (extended) | — | FX = extended FB (S5-135U/155U) |
| SPA OB 1 | — | — | OB calls handled by OS, not user |
S5 Block Types vs. S7
| S5 Block | S7 Equivalent | Description |
|---|---|---|
| OB (Organisationsbaustein) | OB | Organization block (same concept) |
| PB (Programmbaustein) | FC | Program block → Function |
| FB (Funktionsbaustein) | FB + DB | Function block (needs instance DB in S7) |
| FX (Erweiterter FB) | FB + DB | Extended FB (S5-135U/155U only) |
| DB (Datenbaustein) | DB | Data block (different addressing!) |
| SB (Schrittbaustein) | FB/FC | Step block → FB or FC |
Common Migration Issue
S5 FBs use a different parameter passing mechanism than S7 FBs. S5 passes parameters through formal operand declarations (name:type at the top of the FB). The Siemens converter handles this, but manual verification is needed for complex FBs.
Part of the S5 AWL Command Reference. Maintained by PLCcheck.ai.
Analyze Your S5 Code Automatically
PLCcheck Pro reads your complete S5 AWL program and explains every instruction — including this one — in plain language. Upload your code and get instant documentation, S7 equivalents, and migration guidance.
Upload S5 code for free analysis → | S5→S7 Migration Guide →
Related Articles
S5 Function Blocks to S7: FB/FX Migration Guide
How to migrate S5 function blocks (FB, FX) to S7. Covers parameter passing differences, formal operands vs. block interface, instance data blocks, and standard FBs (FB250, FB251).
12 min read
plc-documentationReading and Understanding S5 AWL Code: A Practical Guide
Learn to read Siemens S5 AWL (Instruction List) code from scratch. Covers the accumulator model, bit logic, load/transfer, timers, counters, jumps, and data blocks with real code examples and line-by-line explanations.
16 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.