Download presentation
Presentation is loading. Please wait.
Published byMilo Campbell Modified over 9 years ago
1
Counters
2
Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured during a particular shift The number of times a machine cycles through it’s operation (for example, a machine may require preventative maintenance after 4,000 cycles)
3
Counter Instructions are used to perform the following: Count up Count up Count down and Count down and Add & subtract from one total count as necessary Add & subtract from one total count as necessary
4
SLC 500 timers
5
Up Counter An output instruction that counts up for each false- to-true transition of conditions preceding it in the rung, which produces an output when the accumulated value reaches the preset value. An output instruction that counts up for each false- to-true transition of conditions preceding it in the rung, which produces an output when the accumulated value reaches the preset value. The counter address, preset, and accumulated values can be entered directly into the instruction: The counter address, preset, and accumulated values can be entered directly into the instruction:
6
Structure of the Counter Element: The counter element is a block of data that adds or subtracts from a total as necessary. The counter element is comprised of words and bits that keep track of the counter data. The counter element is a block of data that adds or subtracts from a total as necessary. The counter element is comprised of words and bits that keep track of the counter data.
7
Counter addressing example C5:0 means that it references an internal Counter file C5:0 means that it uses the first counter in the table C5:0/DN means that it references the Done bit. C5:0/CU means that it references the Count Up Enable bit. C5:0/CD means that it references the Count Down Enable bit. C5:0/OV means that it references the Count Up Overflow bit. C5:0/UA means that it references the Count Down Underflow bit. C5:0.ACC means that it references the 16 bit Accumulated value. C5:0.PRE means that it references the 16 bit Reset value.
8
Counter words and bits Preset Value (.PRE): the value that the counter must reach to change the state of the done bit. Preset Value (.PRE): the value that the counter must reach to change the state of the done bit. Accumulated Value (.ACC): the number of false-to- true transitions that have occurred since the counter was last reset. Accumulated values are retained if there are no mode changes or power cycles. Accumulated Value (.ACC): the number of false-to- true transitions that have occurred since the counter was last reset. Accumulated values are retained if there are no mode changes or power cycles. Count-Up Enable Bit (CU): a bit set when a rung containing a count up instruction is true. Count-Up Enable Bit (CU): a bit set when a rung containing a count up instruction is true. Count-Down Enable Bit (CD): a bit set when a rung containing a count down instruction is true. Count-Down Enable Bit (CD): a bit set when a rung containing a count down instruction is true.
9
Counter words and bits Done Bit (DN): a bit that changes state when the accumulated value is equal to or greater than the preset value. Done Bit (DN): a bit that changes state when the accumulated value is equal to or greater than the preset value. Overflow Bit (OV): a bit set when counter has counted up above the upper limit of +32,767. Overflow Bit (OV): a bit set when counter has counted up above the upper limit of +32,767. Underflow Bit (UN): a bit set when counter has counted down below the lower limit of -32,7678. Underflow Bit (UN): a bit set when counter has counted down below the lower limit of -32,7678. Update Accumulated Value (UA): a bit used with the High Speed Counter (HSC) instruction in fixed controllers only. Update Accumulated Value (UA): a bit used with the High Speed Counter (HSC) instruction in fixed controllers only.
10
Counter Value Range The count value of a counter must remain in the range of +32,767 to -32,768 as detailed: The count value of a counter must remain in the range of +32,767 to -32,768 as detailed:
11
Counter Value Range If the count value is greater than +32,767, the counter will continue counting and the counter status overflow bit (OV) is set. If the count value is greater than +32,767, the counter will continue counting and the counter status overflow bit (OV) is set. If the count value exceeds -32,768, the counter will continue counting and the counter status underflow bit (UN) is set. If the count value exceeds -32,768, the counter will continue counting and the counter status underflow bit (UN) is set. Program a Reset (RES) instruction to reset the accumulated value of a counter to zero. Program a Reset (RES) instruction to reset the accumulated value of a counter to zero.
12
Count Down (CTD): An output instruction that counts down for each false-to-true transition of conditions preceding it in the rung and produces an output when the accumulated value reaches the preset value. An output instruction that counts down for each false-to-true transition of conditions preceding it in the rung and produces an output when the accumulated value reaches the preset value.
13
Reset (RES) The following is an example of a programmed RES instruction. Note the changes that occur in C5:1 when the rung goes true:
14
Counter Instruction Addressing: To activate the selected counter, the counter must be programmed in an output position and addressed as a whole at the element level. To activate the selected counter, the counter must be programmed in an output position and addressed as a whole at the element level. To address the counter element, use the following address format: To address the counter element, use the following address format:
15
Example of up & down counter
16
ControlLogix Counters Count Up (CTU) Count Down (CTD) Counter (and Timer) Reset (RES)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.