Counters. Counter Applications Counters count events such as the number of: Parts passing a certain...

18
August 9, 2010 Morning Report

Transcript of Counters. Counter Applications Counters count events such as the number of: Parts passing a certain...

Page 1: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

CountersCounters

Page 2: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter Applications

Counters count events such as the number of: Parts passing a certain point on a conveyor systemGood 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)

Page 3: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter Instructions are used to perform Counter Instructions are used to perform the following:the following:

Count upCount up Count down andCount down and Add & subtract from one total Add & subtract from one total

count as necessarycount as necessary

Page 4: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

SLC 500 timersSLC 500 timers

Page 5: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Up CounterUp Counter

An output instruction that counts up for each An output instruction that counts up for each false-to-true transition of conditions preceding it false-to-true transition of conditions preceding it in the rung, which produces an output when the in the rung, which produces an output when the accumulated value reaches the preset value.accumulated value reaches the preset value.

The counter address, preset, and accumulated The counter address, preset, and accumulated values can be entered directly into the values can be entered directly into the instruction:instruction:

Page 6: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Structure of the Counter Structure of the Counter Element:Element:

The counter element The counter element is a block of data that is a block of data that adds or subtracts from adds or subtracts from a total as necessary. a total as necessary. The counter element The counter element is comprised of words is comprised of words and bits that keep and bits that keep track of the counter track of the counter data. data.

Page 7: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter addressing exampleCounter addressing example

C5C5:0 means that it references an internal Counter file:0 means that it references an internal Counter fileC5:C5:00 means that it uses the first counter in the table means that it uses the first counter in the table

C5C5:0/:0/DNDN means that it references the Done bit. means that it references the Done bit.

C5C5:0/:0/CUCU means that it references the Count Up Enable bit. means that it references the Count Up Enable bit.

C5C5:0/:0/CDCD means that it references the Count Down Enable bit. means that it references the Count Down Enable bit.

C5C5:0/:0/OVOV means that it references the Count Up Overflow bit. means that it references the Count Up Overflow bit.

C5C5:0/:0/UAUA means that it references the Count Down Underflow bit. means that it references the Count Down Underflow bit.

C5C5:0.:0.ACCACC means that it references the 16 bit Accumulated value. means that it references the 16 bit Accumulated value.

C5C5:0.:0.PREPRE means that it references the 16 bit Reset value. means that it references the 16 bit Reset value.

Page 8: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter words and bitsCounter words and bits

Preset Value (.PRE):Preset Value (.PRE): the value that the counter the value that the counter must reach to change the state of the done bit.must reach to change the state of the done bit.

Accumulated Value (.ACC):Accumulated Value (.ACC): the number of the number of false-to-true transitions that have occurred since false-to-true transitions that have occurred since the counter was last reset. Accumulated values the counter was last reset. Accumulated values are retained if there are no mode changes or are retained if there are no mode changes or power cycles.power cycles.

Count-Up Enable Bit (CU):Count-Up Enable Bit (CU): a bit set when a a bit set when a rung containing a count up instruction is true.rung containing a count up instruction is true.

Count-Down Enable Bit (CD):Count-Down Enable Bit (CD): a bit set when a a bit set when a rung containing a count down instruction is true.rung containing a count down instruction is true.

Page 9: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter words and bitsCounter words and bits

Done Bit (DN):Done Bit (DN): a bit that changes state when a bit that changes state when the accumulated value is equal to or greater than the accumulated value is equal to or greater than the preset value.the preset value.

Overflow Bit (OV):Overflow Bit (OV): a bit set when counter has a bit set when counter has counted up above the upper limit of +32,767.counted up above the upper limit of +32,767.

Underflow Bit (UN):Underflow Bit (UN): a bit set when counter has a bit set when counter has counted down below the lower limit of -32,7678.counted down below the lower limit of -32,7678.

Update Accumulated Value (UA):Update Accumulated Value (UA): a bit used a bit used with the High Speed Counter (HSC) instruction in with the High Speed Counter (HSC) instruction in fixed controllers only.fixed controllers only.

Page 10: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter Value RangeCounter Value Range

The count value of The count value of a counter must a counter must remain in the remain in the range of +32,767 range of +32,767 to -32,768 as to -32,768 as detailed:detailed:

Page 11: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter Value RangeCounter Value Range

If the count value is greater than +32,767, If the count value is greater than +32,767, the counter will continue counting and the the counter will continue counting and the counter status overflow bit (OV) is set.counter status overflow bit (OV) is set.

If the count value exceeds -32,768, the If the count value exceeds -32,768, the counter will continue counting and the counter will continue counting and the counter status underflow bit (UN) is set.counter status underflow bit (UN) is set.

Program a Reset (RES) instruction to reset Program a Reset (RES) instruction to reset the accumulated value of a counter to the accumulated value of a counter to zero.zero.

Page 12: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Count Down (CTD):Count Down (CTD): An output instruction An output instruction

that counts down for that counts down for each false-to-true each false-to-true transition of conditions transition of conditions preceding it in the preceding it in the rung and produces an rung and produces an output when the output when the accumulated value accumulated value reaches the preset reaches the preset value.value.

Page 13: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Reset (RES)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:

Page 14: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Counter Instruction Counter Instruction Addressing:Addressing:

To activate the To activate the selected counter, selected counter, the counter must the counter must be programmed in be programmed in an output position an output position and addressed as a and addressed as a whole at the whole at the element level.element level.

To address the To address the counter element, counter element, use the following use the following addressaddress format:format:

Page 15: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

Example of up & down counterExample of up & down counter

Page 16: Counters. Counter Applications Counters count events such as the number of: Parts passing a certain point on a conveyor system Good parts/bad parts manufactured.

ControlLogix Counters

Count Up (CTU) Count Down (CTD) Counter (and Timer) Reset (RES)