L-force | plc designer – Lenze PLC Designer PLC Designer (R2-x) User Manual

Page 652

Advertising
background image

L-force | PLC Designer

PLC Designer Libraries

650

DMS 3.2 EN 02/2011 TD29



Example in FBD:

Example in ST:

RTRIGInst(CLK:= VarBOOL1);

VarBOOL2 := RTRIGInst.Q;

F_TRIG

Provided by standard.lib.

The function block F_TRIG a falling edge.

FUNCTION_BLOCK F_TRIG

VAR_INPUT

CLK: BOOL;

END_VAR

VAR_OUTPUT

Q: BOOL;

END_VAR

VAR

M: BOOL := FALSE;

END_VAR

Q := NOT CLK AND NOT M;

M := NOT CLK;

The output Q and the help variable M will remain FALSE as long as the input variable
CLK returns TRUE. As soon as CLK returns FALSE, Q will first return TRUE, then M will be
set to TRUE. This means each time the function is called up, Q will return FALSE until
CLK has a rising followed by a falling edge.

Advertising