PLCcheck

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.

·3 min read
S5AWLFPpositive edgerising edgeFlankeR_TRIG

Diesen Artikel auf Deutsch lesen

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 AWLS7 STLS7 SCL
FP M 10.0FP 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

ScanE 0.0M 10.0 (old)Edge detected?VKE after FP
1FALSEFALSENoFALSE
2TRUEFALSEYESTRUE
3TRUETRUENoFALSE
4FALSETRUENoFALSE

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.


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.