70 likes | 275 Views
ECT 464 . Lecture 8 Counters. Today’s Quote: If at first you don’t succeed, try reading the instructions. Hold on to instruction, do not let it go; guard it well, for it is your life. Proverbs 4:13. Counter Data File Elements. CU – count up enable CD – count down enable
E N D
ECT 464 Lecture 8 Counters
Today’s Quote: If at first you don’t succeed, try reading the instructions. Hold on to instruction, do not let it go; guard it well, for it is your life. Proverbs 4:13
Counter Data File Elements • CU – count up enable • CD – count down enable • DN – done bit • OV – overflow bit • UN – underflow bit • UA – update accumulated value (not used) • PRE – Preset value word • ACC – Accumulated value word
Word values • Accumulator Value – Number of false to true transitions that have occurred since the counter was last reset. • Preset Value – Value which the counter must count up to until the PLC sets the done bit. • Values between -32,768 and 32,767
Address Structure • The Counter uses the typical element addressing scheme. • Examples: • C5:0.ACC • C11:33/DN • C5:2/OV • C12:4/UN • C15:56.1/0 = C15:56.PRE/0 • C16:29.2/15 = C16:29.ACC/15
Counter Uses • Use with Timer to extend counting time • Keep track of operations (# of times drilled) • Keep of motor position (encoder) • Count parts (good and bad) • Count frequency • Use with fast incoming signals or pulses (tachometer) • Assembly line product control
Counter Examples • Straight counting in a process • Sum of two counts • Difference of two counts • Timed interval starts when count reaches preset value • Count of events after fixed interval • Rate is determined by dividing count by time interval