S5 AWL Command: FP (Positive Edge)
S5 AWL instruction FP (Positive Edge): Detects a rising edge (FALSE→TRUE transition) of the VKE. Requires a flag bit for edge memory.
S5 AWL Command: FP (Positive Edge)
FP detects a positive (rising) edge — the transition from FALSE to TRUE. The VKE is TRUE for exactly one scan cycle when the monitored signal changes from FALSE to TRUE. FP requires a marker bit (flag) to store the previous state.
Syntax
U E 0.0 // Signal to monitor
FP M 10.0 // Edge memory flag (must be unique to this edge detection)
= A 4.0 // Output: TRUE for one scan on rising edge
S7 Equivalent
| S5 AWL | S7 STL | S7 SCL |
|---|---|---|
FP M 10.0 | FP M 10.0 (identical) | R_TRIG function block |
Code Example — Count Button Presses
U E 0.0 // Push button
FP M 10.0 // Detect rising edge only
ZV Z 1 // Count up once per press (not continuously)
Without FP, the counter would increment every scan cycle while the button is held down. With FP, it increments exactly once per press.
How It Works
| Scan | E 0.0 | M 10.0 (old) | Edge detected? | VKE after FP |
|---|---|---|---|---|
| 1 | FALSE | FALSE | No | FALSE |
| 2 | TRUE | FALSE | YES | TRUE |
| 3 | TRUE | TRUE | No | FALSE |
| 4 | FALSE | TRUE | No | FALSE |
M 10.0 stores the previous value of the VKE. FP sets VKE to TRUE only when the current VKE is TRUE and M 10.0 (previous state) was FALSE.
Common Errors
Reusing the same edge memory flag for multiple FP instructions: Each FP must have its own unique marker bit. Sharing M 10.0 between two FP instructions produces unpredictable results.
Related: FN (Negative Edge) — Detects TRUE→FALSE transition
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.