150 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 3 Timer and Counter Instructions (TON, TOF, RTO, TONR, TOFR, RTOR, CTU, CTD, CTUD, RES)
Description When enabled and CUEnable is set, the CTUD instructions increments the
counter by one. When enabled and CDEnable is set, the CTUD instruction
decrements the counter by one. Both the CUEnable and CDEnable input
parameters can both be toggled during the same scan. The instruction executes
the count up prior to the count down.
Figure 1 - Counting Up
Output Parameter Data Type Description
EnableOut BOOL The instruction produced a valid result.
ACC DINT Accumulated value.
CU BOOL Count up enabled.
CD BOOL Count down enabled.
DN BOOL Counting done. Set when accumulated value is greater than or equal to preset.
OV BOOL Counter overflow. Indicates the counter exceeded the upper limit of 2,147,483,647.
The counter then rolls over to −2,147,483,648 and begins counting down again.
UN BOOL Counter underflow. Indicates 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.
CUEnable
Count-up Enable Bit (CU)
Count-up Done Bit (DN)
Counter Accumulated Value (ACC)
Preset
16636