850
26 COUNTER FUNCTION BLOCKS
26.2 Down Counter
26.2 Down Counter
CTD(_E)
These function blocks count down the number of times of rising of a signal.
â– Descriptions, types, and data types
â– Operation processing
1. Count down
• These function blocks count down (subtract "-1" from) the value of (d2) when (s1) turns ON from OFF.
• When the value of (d2) is 0, (d1) turns ON and the function blocks stop counting down.
• Set the count start value for (n). When (s2) is turned ON, (d1) turns OFF and (n) is set for (d2).
2. Count start value
The effective setting range of (n) is from 0 to 32767.
Ladder diagram Structured text
[Without EN/ENO] [With EN/ENO] [Without EN/ENO]
CTD_1(CD:=s1,LD:=s2,PV:=n,Q:=d1,CV:=d2);
[With EN/ENO]
CTD_E_1(EN:=EN, ENO:=ENO CD:=s1,LD:=s2,PV:=n,Q:=d1,CV:=d2);
Argument Description Type Data type
EN Execution condition (TRUE: Execution, FALSE: Stop) Input variable BOOL
s1 Count signal input Input variable BOOL
s2 Count value set Input variable BOOL
n Count start value Input variable INT
ENO Output status (TRUE: Normal, FALSE: Abnormal) Output variable BOOL
d1 Count end Output variable BOOL
d2 Count value Output variable INT