PLCcheck

S5 AWL Command: SPA (Unconditional Jump)

S5 AWL instruction SPA: Unconditional jump to a label. Always executed regardless of VKE state.

·3 min read
S5AWLSPAjumpunconditionalSprunglabel

Diesen Artikel auf Deutsch lesen

S5 AWL Command: SPA (Unconditional Jump)

SPA jumps unconditionally to a label (Sprungmarke). The jump is always executed regardless of the VKE state. In S7, SPA remains SPA (identical syntax).

Syntax

SPA =M001          // Jump to label M001
...
M001: U E 0.0      // Label M001

S7 Equivalent

S5 AWLS7 STLS7 SCL
SPA =M001JU M001 (EN) / SPA M001 (DE)No direct equivalent — use IF/ELSE/GOTO

Code Example — Skip a Section

U   E 0.0
SPB =M010          // If E 0.0 = TRUE, jump to M010
L   KF +0          // This only executes if E 0.0 = FALSE
T   MW 20
SPA =M020          // Skip past M010 code

M010: L KF +100    // This executes if E 0.0 = TRUE
T   MW 20

M020: NOP 0        // Both paths continue here

This pattern implements an IF/ELSE structure. In SCL: IF E0_0 THEN MW20 := 100; ELSE MW20 := 0; END_IF;

Common Patterns


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.