Delay Timer

Sprayman

Member
Join Date
Jan 2020
Location
Chicago
Posts
50
Hi there,

Quick question, I think I am thinking about this too much.

I want to activate a timer for lets say 10 minutes when a contact produces a high signal. After the timer starts I don't want to the timer to be reset until it is finished (I.E. If the signal goes low after 3 minutes.) , and then I want to reset the timer. Is there a simple way to do this?

Thanks!
 
I think the simplest way to do this would be with the timer off despite the hatred around here for the instruction. Put an examine if open command before your timer with your timers timing bit as the reference.
 
Last edited:
Create a latch of the contact with the unlatch being the timer finished signal. Use the latch to enable the timer. What do you want to do if the contact is still on or has come back on when the timer is finished? If you want to wait for another off/on transition of the contact to trigger the latch then use a one-shot of the contact to trigger the latch. Use a normally closed of the timer contact in line with the latch contact to enable the timer just to ensure it turns off.
 
Last edited:
Thanks for the quick reply!

Sorry, i am a bit new to PLC's. I am using ISPsoft for DVP PLC's.

I am mainly using Ladder Diagrams. I cant seem to find examine if open.

Also I have been seeing alot of mentions of different timers. (TON, TOFF etc.)

I dont seem to have those either or more likely I just dont know where to find them/how to use them.

As Michael Scott would say, "Explain it to me like I'm 5"
 
LATCHES ARE GREAT!!!!

So I finally understand what the S and R's mean. That worked exactly how I wanted it to and you also brought up a great point!

I have timers preceding this operation that I will use this new operation to reset them and in doing so reset the whole system to start from the beginning (as if it was just turned on and hadn't jumped through any of these hoops)

Thank you so much!!!
 
Glad you are making progress. It's hard to verbally explain a ladder sequence without using some terms specific to a particular platform. One of the interesting things to learn in PLCs is the number of different ways to describe the same thing. And making mistakes then determining the problem seems to drive learning so much faster.
 
The downside of the set / reset latch instructions is that you need to have more than one place in your code where an output is set/reset. The best case for latches is two adjacent rungs.

IN1 OUT
][-----(S)
IN2 OUT
][-----(R)



It can be frustrating to troubleshoot when the set and the reset aren't near each other, or when there are loads of places in the code where you might set a bit.

Routine 1 Routine 2
IN1 OUT ALARM OUT
][-----(S) ][------(S)
IN2 Unrelated1 ALLOK OUT
][-----( ) ][------(R)
IN3 Unrelated2
][-----( )
IN4 OUT
][-----(R)



What's nicer is to only use OTEs, and use a specific format for latching a bit on and turning it off. So the equivalent of the above may look like:


Routine 1 Routine 2
IN1 SET1 ALARM SET2
][-----( ) ][------(S)
IN2 Unrelated1 ALLOK RESET2
][-----( ) ][------( )
IN3 Unrelated2
][-----( )
IN4 RESET1
][-----(R)
SET1 RESET1 RESET2 OUT
+][--+-]/[----]/[-----( )
|SET2|
+-][-+
| OUT|
+-][-+

 
I've never used Delta PLC's.



But,



If you don't want to use latches you could pulse a counter and use the counter accumulator as the timer and reset that when required.

As Delta has 32 bit counters you could get long time periods, you would not be restricted to 16 bit timers
Steve
 
Last edited:
Alrighty latches successfully worked!

I created a simple version of what I did. Hopefully this might help someone else.

The goal of this is to hold a few functions/checks in place while a time is going. Then at the end, start reseting the timers and other functions.

https://ibb.co/6Wc21pB
 
Last edited:
Is there a simple way to do this?


I am new to this ladder game, but I think of this as pretty simple:

Code:
     INPUT     T4:0/DN
--a---] [---b----]/[---c---|TON                 |--(EN)--
  |         |              |Timer           T4:0|
  | T4:0/EN |              |Time Base        1.0|--(DN)--
  +---] [---+              |Preset           600|
                           |Accum              0|

That rung has essentially everything in the OP's specification:
  • The XIC/NO/-][- of the INPUT starts the timer on a scan when
    • the INPUT is True/1, and
    • the timer is not already running
  • The XIC/NO of T4:0/EN (timer is ENabled) seals the rung at {b} on scans subsequent to the scan on which the timer starts, as long as the timer is ENabled.
    • Seal here means that {b} is maintained True/1 even if the INPUT goes False/0.
    • So the T4:0/EN bit seals itself (until the timer completes).
    • A bit sealing itself is similar to a latch.
    • A seal bit is also called a physician bit ("Physician, seal thyself";)).
  • The XIO/NC/-]/[- of T4:0/DN (timer DoNe) turns off the rung at {c} when the timer completes (Accum reaches Preset) and T4:0/DN goes True/1
    • This also resets the timer,
    • Resetting the timer sets Accum to zero, and resets T4:0/EN, T4:TT, and T4:0/DN to False/0,
    • T4:0/EN going False/0 breaks the seal on the next scan
  • The T4:0/EN is also the output bit i.e. that remains True/1 for the duration of the timer
    • We could instead use T4:0/TT (Timer Timing) as the output
      • If we also used T4:0/TT in the XIC/NO seal branch,
      • Then we would not need the XIC/NC on T4:0/DN

Note that, if the INPUT is True/1 when (i.e. on the scan after) the timer completes, then the timer will immediately start up again. To deal with this, the following rungs add a one-shot per Bernie's suggestion; even if the input is still True/1 when the timer completes, it will not immediately restart the timer*.

Code:
     INPUT
------] [------------------|OSR                 |--------
                           |Storage bit  B3:0/14|
                           |Output bit   B3:0/13|

   B3:0/13     T4:0/DN
--a---] [---b----]/[---c---|TON                 |--(EN)--
  |         |              |Timer           T4:0|
  | T4:0/EN |              |Time Base       0.01|--(DN)--
  +---] [---+              |Preset           500|
                           |Accum              0|

* Unless INPUT goes from False/0 to True/1 on that next scan

Caveats
  • A timer is not deterministic, so the duration is not absolutely guaranteed.
  • This arrangement feels brittle to me, because it depends on the current published behavior of timers, specifically Rockwell MicroLogix, timers. So it is like using the internals of a class in C++, which is bad practice. That said, the timer behavior and bits (/EN; /TT; /DN) are unlikely to change, i.e. in C++ terms, they are part of the published interface and are therefore fair game.
 
Last edited:
Alrighty latches successfully worked! ...

FYI: I have it on good authority* that using latches on outputs is one of two bad practices in PLC programming**.

I think the issue is what happens after power failures: if outputs are latched, then the state of the outputs is not known when the power come back.


* My brother
** The other is using the internal storage bit assigned to a one-shot for anything other than that one-shot.
 
Last edited:
FYI: I have it on good authority* that using latches on outputs is one of two bad practices in PLC programming**.

It's nothing of the sort. Used wisely they are a great tool, but it's up to you to manage them well.

As already mentioned a latch and unlatch on adjacent rungs is easy to trouble shot.

If you want to unlatch everything on a power up, simply use the S:FS bit to do that for you.
 
From what I understood of that it looks like a great way to do it! I'm hoping that latches aren't that bad of practice because they are doing what I need them to! Just tested on the physical machine and it worked great!
 

Similar Topics

Build error occurs with TON ladder logic command. Time Input expected on block. Using Integer Tag under Control Local, and then hard number 19...
Replies
2
Views
744
Hello guys, I am currently looking through some examples of how timers work, but this ladder logic diagram gets me really confused. Once I:1/0 is...
Replies
2
Views
1,838
Hey guys So this is one of those things that siemens really does better then AB. Im trying to find a work around for it. I want to use a...
Replies
13
Views
3,070
any hint how i can make a pext or pulse timer using on delay timer in ladder logic. on delay timer is said to be a universal timer, all other...
Replies
4
Views
2,337
Hi! I was wondering when input 2 detects I thought it should straight away unlatch . And with the latch timer, it still does it without delaying...
Replies
2
Views
2,134
Back
Top Bottom