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
Parameter description
| Interface variables | Declaration | Data type | Description |
|---|---|---|---|
| CLK | Var_Input | BOOL | The result of the current logical operation (input as Boolean signal) |
| Q | Var_Input | BOOL | The 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:

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