Edge detection instructions
884
Part III FP Instructions
DF
Rising edge differential
PLC types
Availability of DF (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
DF is a rising edge differential instruction. The DF instruction executes and turns ON output o for a
singular scan duration if the trigger i changes from an OFF to an ON 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 rising edge at the input Increment increments the counter.
LD
ST
When programming with structured text, enter the following:
IF DF(Increment) THEN
Counter:=Counter+1;
END_IF;