Rising edge differential
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.
Input
Output
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: F19_SJP
All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.
VAR
Increment: BOOL:=FALSE;
Counter: INT:=0;
END_VAR
Each rising edge at the input Increment increments the counter.
BODY
WORKSPACE
NETWORK_LIST_TYPE := NWTYPELD ;
ACTIVE_NETWORK := 0 ;
END_WORKSPACE
NET_WORK
NETWORK_TYPE := NWTYPELD ;
NETWORK_LABEL := ;
NETWORK_TITLE := ;
NETWORK_HEIGHT := 5 ;
NETWORK_BODY
B(B_F,DF!,Instance,7,0,12,3,,?Di?Co);
B(B_VARIN,,Increment,5,1,7,3,);
B(B_F,E_ADD-2!,Instance,16,0,22,5,,?DEN?D?D?AENO?C);
B(B_VARIN,,Counter,14,2,16,4,);
B(B_VARIN,,1,14,3,16,5,);
B(B_VAROUT,,Counter,22,2,24,4,);
L(12,2,16,2);
L(1,0,1,5);
END_NETWORK_BODY
END_NET_WORK
END_BODY
IF DF(Increment) then
Counter:=Counter+1;
END_IF;