Linac Tech (Customer) asked a question.

Restart a TON delay counter

How do I make a 10 second TON timer start counting again at 0 if the trigger button is pressed before the timer reaches the preset time. The code for my application works exactly as I need but I haven't quite figured out this part. This happens in the first 3 rungs of the attached program.

Thanks


  • Durallymax (Customer)

    Add an NC contact for X1 on rung 2. This will reset the timer anytime the button is pressed. It will not allow the timer to time if the button is held. If you need to avoid this you will need an additional rung before with a rising edge NO for X1 and a new coil output that you'll use as the NC on rung 2. This will prevent the timer from timing on the first scan after the button is pressed and will begin timing on the subsequent scan with a reset of the timer anytime the button is pressed again after being released.

    Expand Post
    Selected as Best
  • Tinker (Customer)

    If I remember correctly one can write to timer current value registers (TD1 in you case) copying a zero to it should restart the count.

    eg. On rising edge of X1 COPY zero to TD1

    Or one might use a "retained' timer which has a Reset input. but that might be more complicated to code as it will have to be reset before a normal operation s well, though, maybe the rising edge of X1 could do that as well?

  • Durallymax (Customer)

    Add an NC contact for X1 on rung 2. This will reset the timer anytime the button is pressed. It will not allow the timer to time if the button is held. If you need to avoid this you will need an additional rung before with a rising edge NO for X1 and a new coil output that you'll use as the NC on rung 2. This will prevent the timer from timing on the first scan after the button is pressed and will begin timing on the subsequent scan with a reset of the timer anytime the button is pressed again after being released.

    Expand Post
    Selected as Best
    • Linac Tech (Customer)

      Thank you, this was the simplest option and works perfectly.

  • Todd Dice (Customer)

    On rung 2, after your N.O. C1 contact, insert a falling edge contact (Shift F3) X1. A falling edge is normally ON when the button is not pressed, but is a one-shot OFF when button in pressed. This will reset the timer just once no matter how long the operator holds down the pushbutton.

  • Winston (Customer)

    This may be of base but I have never used a click before and I didn't know a falling edge contact existed.

    Is there an equivalent contact in the domore? I can't seem to find one.

    • Todd Dice (Customer)

      Trailing edge one-shot. Same shortcut; Shift F3

  • Winston (Customer)

    You stated (A falling edge is normally on when the assigned button is not pressed but is a one shot off when the button is pressed)

     

    When I simulate on the domore it is on just for one PLC scan when the button is released even though the status shows it being on when the button is not pressed and off when the button is pressed.

  • Todd Dice (Customer)

    You're right, my apologies.

     

    The only way to accomplish what you want is to have a one-shot rising input to a C-bit output in a prior rung and use that C-bit as a N.C. contact in the following rung.

     

    Sometimes I get the platforms confused since I use 3 (Click, Do-more and Productivity.). Productivity definitely has a normally closed instruction that works as a one-shot open.

    Expand Post