Provided by standard library.
The function block TOF implements a turn-off delay.
TOF(IN, PT, Q, ET) means:
IN and PT are input variables type BOOL respectively TIME. Q and E are output variabls type BOOL respectively TIME. If IN is TRUE, the outputs are TRU respectively 0.
As soon as IN becomes FALSE, in ET the time will begin to be counted in milliseconds in ET until its value is equal to PT. It will then remain constant.
Q is FALSE when IN is FALSE und ET equal PT. Otherwise it is TRUE.
Thus, Q has a falling edge when the time indicated in PT in milliseconds has run out.
Graphic display of TOF behavior over time:

Declaration example
TOFInst : TOF ;
Example in Function Block Diagram

Example in Structured Text
TOFInst(IN := VarBOOL1, PT:= T#5s);
VarBOOL2 :=TOFInst.Q;