S5 AWL Command: ZV (Count Up)
S5 AWL instruction ZV (Count Up): Increments a counter by 1 on each rising edge of the VKE. Counter range 0–999 (BCD).
S5 AWL Command: ZV (Count Up)
ZV increments a counter by 1 on each rising edge of the VKE. The counter value is stored in BCD format with a range of 0–999.
Syntax
U E 0.0 // Count pulse input
ZV Z n // Increment counter n
To set a preset value:
U E 0.1 // Set condition
L KZ 050 // Preset value = 50
S Z 1 // Set counter Z1 to 50
S7 Equivalent
| S5 AWL | S7 Function | IEC 61131-3 |
|---|---|---|
| ZV | S_CU | CTU (Count Up) |
Code Example — Parts Counter
U E 0.0 // Sensor detects part
ZV Z 1 // Count up
U E 0.1 // Reset button
L KZ 000 // Preset = 0
S Z 1 // Reset counter to 0
L Z 1 // Load current count value into ACCU1
T MW 10 // Store count in MW10 for display
Reading Counter Values
U Z n— Tests if counter > 0 (boolean: TRUE if count ≥ 1)L Z n— Loads the current BCD count value into ACCU1
Related: ZR (Count Down)
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
Migrating S5 Counter Programs (Z/ZV/ZR) to S7
How to migrate S5 counter programs to S7. Covers ZV (count up), ZR (count down), BCD format differences, S7 equivalents (S_CU, S_CD, CTU, CTD, CTUD), and common pitfalls.
10 min read
plc-documentationReading 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
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.