Edge detection instructions
885
Part III FP Instructions
DFN
Falling edge differential
PLC types
Availability of DFN (see page 1319)
Be careful when programming with commands that effect the order in which a
program is carried out, e.g. jump or loop instructions within a sequential
function chart or a function block. The order of the instructions might change
depending on the time when the instruction is carried out or the input value.
Specific basic JUMP and LOOP instructions are:
- MC (see page 1007) to MCE (see page 1008)
- JP (see page 1009) to LBL (see page 1013)
- F19_SJP (see page 1010) to LBL (see page 1013)
- LOOP (see page 1012) to LBL (see page 1013)
Variable Data type
input BOOL
output BOOL
For Relay T/C Register Constant
i X Y R L T C - - - -
o - Y R L - - - - - -
Description
The DFN instruction executes and turns ON output o for a single scan duration if the trigger i
changes from an ON to an OFF state.
Data types
Operands
Example
In this example the function has been programmed in ladder diagram (LD) and structured text (ST).
The same POU header is used for all programming languages.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
Body
Each falling edge at the input Decrement decrements the couter.
LD
ST
When programming with structured text, enter the following:
IF DFN(Decrement) THEN
Counter:=Counter-1;
END_IF;