Page 79

Petruzella_ProgrammableLogicControllers__5e

False 368 Part 4 Programming Counters Part Objectives After completing this part, you will be able to: •• Understand ControlLogix counter tags and their members •• Utilize status bits from counters in logic •• Develop ladder logic programs using ControlLogix counters Counters Counters are similar to timers, except that a counter accumulates (counts) the changes in state of an external trigger signal whereas timers increment using an internal clock. PLC counters are generally triggered by a change in an input field device that causes a false-to-true transition of the counter ladder rung. It does not matter how long the rung stays true or false—it is only the transition that counts. There are two basic counter types: count-up (CTU) and count-down (CTD). The ControlLogix CTU instruction and counter selection toolbar are shown in Figure 15-67. When you want to use a counter, you must create a tag of type COUNTER (it is a predefined data type) and enter the preset and the accumulated value. When entering the instruction, this tag must be defined before the preset and accumulated values can be entered. A RES reset instruction that has the same tag name as the counter must be used to reset the accumulated value of the counter to zero. All counters are retentive in that the accumulated value of any counter is retained, even during a power failure, until reset. The on/off status of the counter done, overflow, and underflow bits are retentive as well. Control- Logix counter parameters and status bits are shown in the edit tags window of Figure 15-68 and can be summarized as follows: • Preset (PRE) Value—Specifies the value the counter must reach before the done (DN) bit turns on (1). • Accumulated (ACC) Value—Is the number of false-to-true transitions of the counter rung. ACC is reset to zero when a reset (RES) instruction (of the same counter address) is executed. • CU (Count-Up Enable Bit)—The count-up enable CU DN TON TOF RTO CTU CTD RES Add-On Alarms Bit Timer/Counter CTU Count Up Counter Package_Counter Preset Accum 24 0 Package_Counter Favorites True Input side of rung RES Tag name Figure 15-67  CTU count-up counter instruction. bit indicates the CTU instruction is enabled.


Petruzella_ProgrammableLogicControllers__5e
To see the actual publication please follow the link above