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.
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 AWL | S7 STL | S7 SCL |
|---|---|---|
U E 0.0 | A 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
- First U in a logic chain: VKE = value of the operand
- Subsequent U: VKE = VKE AND operand
- After =, S, R: VKE is reset (new chain begins)
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).
Related Commands
- UN (AND NOT) — AND with negation
- O (OR) — OR operation
- = (Assign) — Assign VKE to output
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
Reading and Understanding S5 AWL Code: A Practical Guide
Learn to read Siemens S5 AWL (Instruction List) code from scratch. Covers the accumulator model, bit logic, load/transfer, timers, counters, jumps, and data blocks with real code examples and line-by-line explanations.
16 min read
migration-guideThe Siemens S5/S7 Converter Tool: What It Does and What It Doesn't
Honest assessment of the Siemens STEP 7 S5→S7 conversion tool. What it converts automatically, what it cannot handle, common errors, and how to deal with the remaining 20–40% that requires manual work.
12 min read
migration-guideS5 to S7 Migration: The Complete Guide (2026)
Step-by-step guide for migrating Siemens S5 PLC programs to S7-1500. Covers AWL→SCL conversion, timer mapping, address translation, and hardware selection.
18 min read
Analyze your PLC code with AI
PLCcheck Pro explains, documents, optimizes, and migrates PLC code — automatically.
Try PLCcheck Pro →Not affiliated with Siemens AG. S5, S7, STEP 5, STEP 7, and TIA Portal are trademarks of Siemens AG.