2 f-trig, F_trig, Drive plc developer studio – Lenze DDS v2.3 User Manual

Page 305

Advertising
background image

Drive PLC Developer Studio

IEC 61131-3 Standard functions

14-13

l

DDS EN 2.3

14.5.2

F_TRIG

Falling edge detector

FUNCTION_BLOCK F_TRIG
VAR_INPUT

CLK : BOOL;

END_VAR
VAR_OUTPUT

Q : BOOL;

END_VAR
VAR

M : BOOL := TRUE;

END_VAR

Q := NOT CLK AND NOT M;
M := NOT CLK;

END_FUNCTION_BLOCK

As long as the input variable CLK returns TRUE,
the output Q and the auxiliary variable M will be FALSE.

As soon as S1 is FALSE, Q will first return TRUE and then M will be switched to TRUE.

I.e.: with every subsequent function call,
Q

will return FALSE until CLK has a rising and another falling edge.

Examples
Declaration:

FTRIGInst : F_TRIG;

IL

FBD

CAL FTRIGInst(CLK:=VarBOOL1)
LD FTRIGInst.Q
ST VarBOOL2

ST

FTRIGInst(CLK:=VarBOOL1);
VarBOOL2:=FTRIGInst.Q;

Show/Hide Bookmarks

Advertising