beautypg.com

Count up (ctu), Preface, Using status bits – Rockwell Automation 1761 MicroLogix 1000 Programmable Controllers User Manual

Page 116

background image

Preface

MicroLogix 1000 Programmable Controllers User Manual

6–18

Count Up (CTU)

The CTU is an instruction that counts false-to-true rung transitions. Rung
transitions can be caused by events occurring in the program (from internal logic or
by external field devices) such as parts traveling past a detector or actuating a limit
switch.

When rung conditions for a CTU instruction have made a false-to-true transition,
the accumulated value is incremented by one count, provided that the rung
containing the CTU instruction is evaluated between these transitions. The ability
of the counter to detect false-to-true transitions depends on the speed (frequency) of
the incoming signal.

Note

The on and off duration of an incoming signal must not be faster than the scan time
2x (assuming a 50% duty cycle).

The accumulated value is retained when the rung conditions again become false.
The accumulated count is retained until cleared by a reset (RES) instruction that has
the same address as the counter reset.

Using Status Bits

This Bit

Is Set When

And Remains Set Until One

of the Following

Count Up Overflow Bit OV (bit
12)

accumulated value wraps
around to –32,768 (from
+32,767) and continues
counting up from there

a RES instruction having the
same address as the CTU
instruction is executed OR
the count is decremented
less than or equal to +32,767
with a CTD instruction

Done Bit DN (bit 13)

accumulated value is equal
to or greater than the preset
value

the accumulated value
becomes less than the preset

Count Up Enable Bit CU
(bit 15)

rung conditions are true

rung conditions go false OR
a RES instruction having the
same address as the CTU
instruction is enabled

The accumulated value is retained after the CTU instruction goes false, or when
power is removed from and then restored to the controller. Also, the on or off status
of counter done, overflow, and underflow bits is retentive. The accumulated value
and control bits are reset when the appropriate RES instruction is enabled. The CU
bits are always set prior to entering the REM Run or REM Test modes.

Execution Times

(

µ

sec) when:

True

False

29.84

26.67

(CU)

(DN)

CTU

COUNT UP
Counter
Preset
Accum