Counters are used in applications that require items or products to be counted.
- Counter instructions contain three words. The bits and words of counter instructions have addresses that can be used in the program of a PLC.
- All counter instructions consist of three words: word 0, word 1, and word 2. Each word contains 16 bits.Word 0 contains five bits that are available for use in a PLC program:
• bit 15—Count up (CU) enable
• bit 14—Countdown (CD) enable
• bit 13—done (DN)
• bit 12—overflow (OV)
• bit 11—underflow (UN)
Counter in PLC: Count up (CTU) instruction
- A count up (CTU) instruction is a PLC programming instruction used to count the number of operations or products produced by a system.
- A CTU instruction counts up on every false to true transition of the logic preceding the instruction on a rung.
- The accumulated value of a CTU instruction increases by one for every false to true transition.
- A CTU instruction will allow a counter to continue to count past the preset value. An identically addressed RES instruction is required to reset a CTU instruction.
Counter in PLC : Countdown(CTD) instruction
- When used together, CTD and CTU instructions have the same address, similar to OTL and OTU instructions.
- CTU and CTD instructions share the same status bits, preset values, and accumulated values. However, each counting instruction has its own logic.
- A CTD instruction counts down on every false to true transition of the logic preceding the instruction on a rung.
- The accumulated value of a CTD instruction decreases by one for every false to true transition of the logic preceding a CTD instruction on a rung. Conversely
- A CTU instruction causes the accumulated value of a CTD instruction to increase. A single identically addressed RES instruction is required to reset CTD and CTU instructions.here below image show CTD instruction and related bit