PLCcheck

S5 AWL Command: U (AND)

S5 AWL instruction U (UND/AND): Syntax, description, S7 equivalent, code examples, and common errors. Complete reference for the AND bit logic operation.

·3 min read
S5AWLUANDUNDbit logicinstructionreference

Diesen Artikel auf Deutsch lesen

S5 AWL Command: U (AND) / UND

The U instruction performs a logical AND operation on the VKE (Verknüpfungsergebnis / Result of Logic Operation). It reads a boolean operand and ANDs it with the current VKE.

Syntax

U  <operand>

Valid operands: E (Input), A (Output), M (Marker/Flag), T (Timer), Z (Counter), D (Data bit)

S7 Equivalent

S5 AWLS7 STLS7 SCL
U E 0.0A I 0.0 (EN) / U E 0.0 (DE)IF Input_0_0 AND ...

In S7 STL (English mnemonics), U becomes A (AND). In German mnemonics, U remains U.

Code Example

S5 AWL — Two inputs AND-linked to one output:

U  E 0.0       // Input 0.0 (e.g., Start button)
U  E 0.1       // Input 0.1 (e.g., Safety door closed)
=  A 4.0       // Output 4.0 (e.g., Motor on)

Equivalent S7 SCL:

Motor_On := Start_Button AND Safety_Door_Closed;

Behavior: A 4.0 is TRUE only when both E 0.0 AND E 0.1 are TRUE.

VKE Behavior

Common Errors

Forgetting that U starts a new VKE chain after = / S / R:

U  E 0.0
=  A 4.0       // VKE reset here
U  E 0.1       // This starts a NEW chain (not AND with E 0.0)
=  A 4.1

Confusing U with O: U = AND (both must be true), O = OR (either can be true).


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.