848
26 COUNTER FUNCTION BLOCKS
26.1 Up Counter
26 COUNTER FUNCTION BLOCKS
26.1 Up Counter
CTU(_E)
These function blocks count up the number of times of rising of a signal.
â– Descriptions, types, and data types
â– Operation processing
1. Count up
• These function blocks count up (add "1" to) the value of (d2) when (s1) turns ON from OFF.
• When the value of (d2) reaches the value of (n) of the counter, (d1) turns ON and the function blocks stop counting up.
• Set the maximum value of the counter for (n). When (s2) is turned ON, (d1) turns OFF and (d2) is set to 0.
2. Count maximum 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]
CTU_1(CU:=s1,R:=s2,PV:=n,Q:=d1,CV:=d2);
[With EN/ENO]
CTU_E_1(EN:=EN, ENO:=ENO CU:=s1,R:=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 reset Input variable BOOL
n Count maximum 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