PLCcheck

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.

·4 min read
S5AWLSPAFBPBcallfunction blockCALL

Diesen Artikel auf Deutsch lesen

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 AWLS7 STLS7 SCLNotes
SPA FB 10CALL FB10, DB10FB10_Instance();FB with instance DB
SPA PB 5CALL FC5FC5();PB becomes FC
SPA FX 10CALL FB10 (extended)FX = extended FB (S5-135U/155U)
SPA OB 1OB calls handled by OS, not user

S5 Block Types vs. S7

S5 BlockS7 EquivalentDescription
OB (Organisationsbaustein)OBOrganization block (same concept)
PB (Programmbaustein)FCProgram block → Function
FB (Funktionsbaustein)FB + DBFunction block (needs instance DB in S7)
FX (Erweiterter FB)FB + DBExtended FB (S5-135U/155U only)
DB (Datenbaustein)DBData block (different addressing!)
SB (Schrittbaustein)FB/FCStep 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

Analyze your PLC code with AI

PLCcheck Pro explains, documents, optimizes, and migrates PLC code — automatically.

Try PLCcheck Pro →
← Back to Blog

Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7, and TIA Portal are trademarks of Siemens AG.