1
\$\begingroup\$

According to this post , all timers can be created from just the On-Delay Timer (TON).

At the end of the post, after showing how to create an Off-Delay Timer, an On+Off-Delay Timer, and a Flasher Timing Function, the author states that Pulse Timers, Pulse After Off timers, and Accumulating Timers can also be created from only On-Delay Timers but this isn't shown.

How can this be done?

You can use any basic components, and it doesn't have to be in a single rung but that would be cool.

If you can do it without any timers at all that is also obviously acceptable, and would be interesting.

\$\endgroup\$
1
  • \$\begingroup\$ I would show my current working, but I only started learning Ladder-Logic recently and have absoltely no idea how to do it, but I'm guessing a counter would come in handy, and it would take at least 2 timers. \$\endgroup\$
    – Ryan White
    Commented Feb 5, 2019 at 15:23

2 Answers 2

1
\$\begingroup\$

A retentive timer can be built with an On Timer and supporting logic.

A typical TON implementation automatically clears the accumulating value when its input goes false. A retentive timer saves the value instead, so we'll need a way to capture the elapsed time outside the TON.

Create a variable to act as memory for the TON. When the timer needs to start, copy the memory into the Accumulator. Copy the Accumulator back to memory when the timer should pause. That just leaves resetting, which can be accomplished by clearing the memory or moving zero into the memory variable.

This example is for an Allen Bradley PLC, but the concept should work anywhere.

One thing to note: the rungs with MOV commands are placed before the TON to ensure that the .ACC value is saved or updated before the TON starts changing it.

retentive timer using TON

\$\endgroup\$
0
\$\begingroup\$

Most PLCs have a simple TON (Timer ON delay) instruction that resets to zero if the input is turned off. This is no use for a cumulative timer. Instead a cumulative timer is offered such as Allen-Bradley's RTO (Retentive Timer On).

enter image description here

Figure 1. Source: Logix 5000 Controllers General Instructions Reference Manual page 114.

  • When limit_switch_7 is set, light_2 is on for 180 milliseconds (timer_3 is timing).
  • When timer_3.acc reaches 180, light_2 goes off and light_3 goes on.
  • Light_3 remains until timer_3 is reset.
  • If limit_switch_7 is cleared while timer_3 is timing, light_2 goes off.
  • When limit_switch_7 is set, the RES instruction resets timer_3 (clears status bits and .ACC value).

ACC / Accum = accumulator, the current value.


Note that it might be tempting to try to create your own cumulative timer but it's trickier than it might seem. For the timer to be accurate (and this goes for TON and TOFs as well) I suspect that the PLC may have to keep sub-millisecond accumulator values to prevent scan-time rounding errors accumulating.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.