PLCcheck

S5 AWL Command: SPBN (Jump if NOT)

S5 AWL instruction SPBN: Jump to label if VKE is FALSE. The inverse of SPB.

·2 min read
S5AWLSPBNjumpconditionalNOTguard clause

Diesen Artikel auf Deutsch lesen

S5 AWL Command: SPBN (Jump if NOT)

SPBN jumps to a label only if the VKE is FALSE. It is the inverse of SPB. Useful for "skip this section when condition is not met" patterns.

Syntax

U   E 0.0
SPBN =M001         // Jump to M001 if E 0.0 is FALSE
// ... code that only runs when E 0.0 is TRUE ...
M001: NOP 0

S7 Equivalent

S5 AWLS7 STLS7 SCL
SPBN =M001JCN M001 (EN) / SPBN M001 (DE)IF NOT condition THEN ...

Typical Use — Guard Clause

U   E 0.0          // Mode selector
SPBN =SKIP         // If not in this mode, skip entire section
// ... mode-specific code ...
SKIP: NOP 0

This is cleaner than SPB for "skip" patterns because you avoid an extra SPA.


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.