Count Up (CTU)
Mnemonic
Data Type
.CU
BOOL
.DN
BOOL
.OV
BOOL
.UN
BOOL
.PRE
DINT
.ACC
DINT
Description:
Count-up Enable Bit (.CU)
Count-up Done Bit (.DN)
Counter Accumulated Value (.ACC)
Timer and Counter Instructions (TON, TOF, RTO, TONR, TOFR, RTOR, CTU, CTD, CTUD, RES)
The CTU instruction counts upward.
This instruction is available in structured text and function block as CTUD.
Operands:
Relay Ladder
Operand
Counter
Preset
Accum
COUNTER Structure
Description
The count up enable bit indicates that the CTU instruction is enabled.
The done bit indicates that .ACC ≥ .PRE.
The overflow bit indicates that the counter exceeded the upper limit of 2,147,483,647. The counter then
rolls over to -2,147,483,648 and begins counting up again.
The underflow bit indicates that the counter exceeded the lower limit of -2,147,483,648. The counter
then rolls over to 2,147,483,647 and begins counting down again.
The preset value specifies the value that the accumulated value must reach before the instruction sets
the .DN bit.
The accumulated value specifies the number of transitions the instruction has counted.
When enabled and the .CU bit is cleared, the CTU instruction increments the
counter by one. When enabled and the .CU bit is set, or when disabled, the CTU
instruction retains its .ACC value.
Rung-condition-in
Preset
Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Type
Format
COUNTER
Tag
DINT
Immediate
DINT
Immediate
Description
Counter structure
How high to count
Number of times the counter has counted
Initial value is typically 0
Chapter 3
16636
141