Skip to main content

7.1.4 F_TRIG

Function

F_TRIG is called falling edge detection and is used for falling edge detection of variables or logical operation results.

LD graphics

Alt ​​text

Parameter description

Interface variablesDeclarationData typeDescription
CLKVar_InputBOOLThe result of the current logical operation (input as Boolean signal)
QVar_InputBOOLThe result of edge detection

Corresponding syntax

  • Compare the current CLK value with the last CLK value stored in the specified instance;
  • The CLK value changes from TRUE to FALSE, and a signal falling edge is generated in the output Q. The value of the Q value output in a cycle is TRUE;
  • In other cases, the signal output by this instruction is FALSE
warning

Function block usage requires global declaration of an instance

Example

  • LD example is shown in the following animation:

alt text

  • ST example is shown in the following code:
F_TRIG_1(CLK:=bVar,Q=>OUT);
IF OUT THEN
iVar:=iVar+1;
END_IF;