adccommunitymod (AutomationDirect) asked a question.

Click PLC timing

Created Date: March 05,2013

Created By: spiwrx

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

I have a single input I need to monitor the time it is "on " (closed) and save that duration (minutes) to pass it to something like the "Drum " to repeat whatever that duration is to 3 consecutive outputs. e.g. X001 (on for 0-3min) Y001 (on for 3min) when Y001 opens Y002 closes for 3min Likewise for Y003 I'm only stumped as how to "measure " the input duration on X001, save and reuse that duration for all three outputs.


  • adccommunitymod (AutomationDirect)

    Created Date: March 06,2013

    Created by: Do-more PE

    Something like this perhaps.

    This rung needs to be first so that you capture the accumulated time before the timer resets.

    STRND X1 - This is a negative differential contact. It should be set to only come on during the falling edge of X1.

    COPY TA1 - DS1

    This is the rung that does the timing.

    STR X1

    TMR T1 - 9999999 ms

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: March 06,2013

    Created by: AlbertL

    Here's one approach to the first part of your program: measuring the number of minutes a contact is closed. It may not be exactly what you need in terms of how it measures the time (i.e. counting seconds and rounding off to the nearest minute), and the fact that it allows the contact to open and close more than once, but it may give you some ideas to work with.

  • adccommunitymod (AutomationDirect)

    Created Date: March 06,2013

    Created by: spiwrx

    counting seconds and rounding off to the nearest minute), and the fact that it allows the contact to open and close more than once

    You 're example will work well for my application as well. I was just wondering why on the second rung the SC7 is on a rising edge(one scan). I'm assuming that's starting the clock (seconds)? I'm having trouble finding documentation on that.

    If I follow you:

    Rung 1 Zero's the counters (seconds & minutes)

    Rung 2 counts in seconds (while X003 is closed)

    Rung 3 rounds that info when X003 opens and stores to DS2

    I then wanted to use the result (DS2) as a duration in a drum in a 3 step drum, though I think I need to get more creative as it only allows a fixed time to be the duration in the drum. (initial thoughts are event base with off-delay timer transition?)

    I'm trying to:

    - Measure an input (minutes)

    - turn on valve 1 for that duration (DS2)

    - turn on valve 2 after valve 1 has expired for the same duration

    - turn on valve 3 after 2 for the same duration

    - turn on a pump for 3x DS2

    The duration DS2 will change occasionally but at an undetermined schedule and amount. (would never be less than a minute or more than 15)

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: March 07,2013

    Created by: AlbertL

    You 're example will work well for my application as well. I was just wondering why on the second rung the SC7 is on a rising edge(one scan). I'm assuming that's starting the clock (seconds)? I'm having trouble finding documentation on that.

    I'm using SC7 as a clock pulse to increment the counter (DS1) once per second, to count the number of seconds that X003 is closed. The logic for that rung can be stated as "while X003 is closed, increment DS1 once per second ".

    SC7 is a System Control Relay which repeatedly turns ON for 0.5 seconds, then OFF for 0.5 seconds, so it has an OFF-to-ON transition (a rising edge) once per second. The MATH instruction counts those transitions to measure the time. You can find a description of SC7 by searching the Click programming software's help file for "System Control Relays ".

    If you use a regular Normally Open contact in place of a Rising Edge contact, DS1 will be incremented on every scan during each 0.5 second period that SC7 is closed, which is of course not what you want.

    If I follow you:

    Rung 1 Zero's the counters (seconds & minutes)

    Rung 2 counts in seconds (while X003 is closed)

    Rung 3 rounds that info when X003 opens and stores to DS2

    Yes, that's correct.

    I then wanted to use the result (DS2) as a duration in a drum in a 3 step drum, though I think I need to get more creative as it only allows a fixed time to be the duration in the drum. (initial thoughts are event base with off-delay timer transition?)

    I'm trying to:

    - Measure an input (minutes)

    - turn on valve 1 for that duration (DS2)

    - turn on valve 2 after valve 1 has expired for the same duration

    - turn on valve 3 after 2 for the same duration

    - turn on a pump for 3x DS2

    The duration DS2 will change occasionally but at an undetermined schedule and amount. (would never be less than a minute or more than 15)

    The event-based drum sounds like it should work. Or, since you only have a few steps, you could use multiple timers, with each timer initiating the one after it. You'll probably want to add some logic to handle the situation where X003 is closed while the Valve 1 - Valve 2 - Valve 3 - Pump steps are in progress.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: March 07,2013

    Created by: spiwrx

    Got it. Thanks for explaining that. Should be a breeze to implement the rest..

  • adccommunitymod (AutomationDirect)

    Created Date: March 19,2013

    Created by: spiwrx

    Thanks again, ended up just using the seconds counter with some off delays triggered by rising edge contact. Tried the drum but a better understanding of the rising and falling edge contacts made it very simple with the off delay instead. I would have never found the seconds counter without your help. Thank you!!

  • adccommunitymod (AutomationDirect)

    Created Date: March 20,2013

    Created by: AlbertL

    Glad it's working for you!

  • adccommunitymod (AutomationDirect)

    Created Date: March 05,2013

    Created by: spiwrx

    I have a single input I need to monitor the time it is "on " (closed) and save that duration (minutes) to pass it to something like the "Drum " to repeat whatever that duration is to 3 consecutive outputs.

    e.g.

    X001 (on for 0-3min)

    Y001 (on for 3min)

    when Y001 opens

    Y002 closes for 3min

    Likewise for Y003

    I'm only stumped as how to "measure " the input duration on X001, save and reuse that duration for all three outputs.

    Expand Post