Provided by standard library.
Function block incrementer/decrementer
The input variables CU, CD, RESET, LOAD as well as the output variables QU and QD are type BOOL, PV and CV are type WORD.
If RESET is valid, the counter variable CV will be initialized with 0. If LOAD is valid, CV will be initialized with PV.
If CU has a rising edge from FALSE to TRUE, CV will be raised by 1. If CD has a rising edge from FALSE to TRUE, CV will be lowered by 1 provided this does not cause the value to fall below 0.
QU returns TRUE when CV has become greater than or equal to PV.
QD returns TRUE when CV has become equal to 0.
Declaration example
CTUDInst : CUTD ;
Example in Function Block Diagram

Example in Structured Text
CTUDInst(CU := VarBOOL1, RESET := VarBOOL3, LOAD:=VarBOOL4 , PV:= VarINT1);
VarBOOL5 := CTUDInst.QU ;
VarBOOL6 := CTUDInst.QD ;
VarINT2 := CTUDInst.CV;