Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 141
Timer and Counter Instructions (TON, TOF, RTO, TONR, TOFR, RTOR, CTU, CTD, CTUD, RES) Chapter 3
Count Up (CTU)
The CTU instruction counts upward.
This instruction is available in structured text and function block as CTUD.
Operands:
Relay Ladder
COUNTER Structure
Description: 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.
Operand Type Format Description
Counter COUNTER Tag Counter structure
Preset DINT Immediate How high to count
Accum DINT Immediate Number of times the counter has counted
Initial value is typically 0
Mnemonic Data Type Description
.CU BOOL The count up enable bit indicates that the CTU instruction is enabled.
.DN BOOL The done bit indicates that .ACC ≥ .PRE.
.OV BOOL 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.
.UN BOOL 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.
.PRE DINT The preset value specifies the value that the accumulated value must reach before the instruction sets
the .DN bit.
.ACC DINT The accumulated value specifies the number of transitions the instruction has counted.
Rung-condition-in
Count-up Enable Bit (.CU)
Count-up Done Bit (.DN)
Counter Accumulated Value (.ACC)
Preset
16636