Table of Contents

CTD_DINT

Block name

CTD_DINT

ST call

PROGRAM CTD_DINT_DEMO
   VAR
     BOOL1,BOOL2,BOOL3: BOOL;
    DINT1,DINT2: DINT;
  FB:CTD_DINT;
   END_VAR
    FB(CD:=BOOL1,LD:=BOOL2,PV:=DINT1,Q=>BOOL3,CV=>DINT2);
END_PROGRAM

Description

The block acts as a counter counting down to zero from the preset value pv.

Inputs

InputTypeDescription Default value
CD BOOLRising edge counts one down False
LD BOOLSets the counter to its initial value pvFalse
PV DINTInitial value of the counter 0

Outputs

OutputTypeDescription
Q BOOLState when the counter finished counting (counting finished: q=true)
CV DINTCurrent value of the counter

Application example