1 / 23

Counter

Counter. The CTU CTD instruction counts upward & Down wards over a range Each time the rung goes from false-to-true. We can make an Up-Down counter by using a separate up and down counter instructions using the same address/structure. Counter Data File.

haruko
Download Presentation

Counter

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Counter The CTU CTD instruction counts upward & Down wards over a range Each time the rung goes from false-to-true. We can make an Up-Down counter by using a separate up and down counter instructions using the same address/structure

  2. Counter Data File • 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

  3. 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. PLC5 Values between -32,768 and 32,767 CONTROLOGIX Values between 2,147,483,647to -2,147,483,648

  4. Address Structure •The Counter uses the typical element addressing scheme. •Examples: Contrologix PLC 5 • C5:0.ACC •  C11:33/DN •  C5:2/OV •  C12:4/UN • Counter.PRE • Counter.ACC • Counter.DN

  5. Counter Uses Count the number of items being produced or tested Maintain the level in a tank by counting the number of gallons in and drained Keeping track of very long duration time periods by combining a timer and counter Counting frequency, encoder, tachometer (pulses)

  6. 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

  7. Timer The TON instruction is a non-retentive timer that accumulates time when the instruction is enabled (rung-condition-in is true). The TOF instruction is a non-retentive timer that accumulates time when the when enable goes false (rung-condition-in is false). The RTO instruction is a retentive timer that accumulates time when the instruction is enabled.

  8. Timer Data File Elements EN – timer enabled TT – timer timing DN – done bit PRE – Preset value word ACC – Accumulated value word

  9. Word values Accumulator Value – Number of clock cycles that have occurred since the timer was enabled. Preset Value – Value which the timer must count up to until the PLC sets the done bit. Values between 0 and 32,767

  10. Time Base The timers have a time base by which they are clocked. Valid Time Bases are: 1 second 0.1 seconds

  11. Address Structure The Timer uses the typical element addressing scheme. Examples: T4:0.ACC T11:33/DN T4:2/TT T12:4/EN T15:56.1/0 = T15:56.PRE/0 T16:29.2/15 = T16:29.ACC/15

  12. Timer On Delay (TON) Enable – Set whenever the input rung is true Timer Timing – Set when enable is true and accumulated value is less than the preset value. Done – Set when the enable is true and the accumulated value is greater than or equal to the preset value.

  13. Timer Off Delay (TOF) Enable – Set whenever the input rung is true Timer Timing – Set when enable goes false and accumulated value is less than the preset value. Done – Set when the enable or timer timing bit is true

  14. Retentive Timer (RTO) Enable – Set whenever the input rung is true Timer Timing – Set when enable goes true and accumulated value is less than the preset value. Done – Set when the enable is true and the accumulated value is greater than or equal to the preset value. Does not reset accumulated value when enable is false.

  15. Timer Uses TON Create a short pulse at the beginning of a longer input condition (.TT bit) Delay the start of a function for defined period of time from the start of some other function (.DN bit) TOF Used to create longer output functions derived from short input functions using (.DN bit) Generate a short pulse at he end of a long input function by using (.TT bit)

  16. Timer Uses RTO Used to accumulate time for maintenance functions or for diagnostic programs Other Uses count time,Extend push button inputs,Delay inputs, De-bounce Inputs

  17. Timer Examples To Try •Alternate on and off of two outputs: Two alternately flashing lights. The time for the two lights could be different. •Multiple On Delay: Two different events start at different time intervals after an initial starting time reference point. •Multiple Off Delay: Two different functions remain on for two different time intervals after a process is turned off.

  18. Timer Examples To Try •Interval time within a cycle: We may require that an output come on 7.5 seconds after system start up, remain on for 4.5 seconds, and then go off and stay off. The interval would then be repeated only after the system is shut off and then turned back on. •On Delay: Output B comes on at a specific set time after output A is turned on. When A is turned off, B goes off.

  19. Timer Examples To Try •Off Delay: Both A and B have been turned on at the same time. Both are in operation. When A is turned off, B remains on for a specific set time period before going off. •Limited On Time: A and B go on at the same time. B goes off after specific set time period, but A remains on. •Repeat Cycling: An output pulses on and quickly off at a constant preset time interval. •One-Shot Operation: Output B goes on for a specified time after output A is turned on. Output B will run for its specified time interval even if A is turned off during the B timing interval.

More Related