PLCcheck

S5 AWL Commands: SET / CLR (VKE Control)

S5 AWL instructions SET (force VKE to TRUE) and CLR (force VKE to FALSE). Unconditionally set the VKE state.

·2 min read
S5AWLSETCLRVKEunconditionalbit control

Diesen Artikel auf Deutsch lesen

S5 AWL Commands: SET / CLR (VKE Control)

SET forces the VKE to TRUE. CLR forces the VKE to FALSE. Both are unconditional — they override any previous VKE state.

Syntax

SET                 // VKE = TRUE
CLR                 // VKE = FALSE

S7 Equivalent

S5 AWLS7 STLS7 SCL
SETSETNot needed (use := TRUE)
CLRCLRNot needed (use := FALSE)

Code Example

SET                 // Force VKE = TRUE
=  A 4.0            // A 4.0 is unconditionally TRUE (always on)

CLR                 // Force VKE = FALSE
=  A 4.1            // A 4.1 is unconditionally FALSE (always off)

Typical Use

Note

SET and CLR are rarely seen in well-written code. They are typically used for initialization, testing, or as workarounds. In SCL, the equivalent is simply output := TRUE; or output := FALSE;.


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.