No announcement yet.

Count down timer on Click PLC

  • Filter
  • Time
  • Show
Clear All
new posts

  • Count down timer on Click PLC

    I have a liquid filling machine application for which I am using a Click PLC and a Cmore EA9 HMI.

    The fill heads use a count down timer to give us our desired fill weight.

    The problem I have is the maximum time I can put in the DS data register for timers is 32767 ms because it is a 16 bit register. If I want to go higher than that, I have to set the units to seconds. That is not good because we need finer time adjustments than whole seconds.

    I am wondering if there is any kind of work around to get more than 32.767 seconds on the timer.

  • #2
    You could cascade a timer an a counter.
    Have a timer time for (?) 10 mS and expire. Then have a counter count the expirations of the timer. Reset the timer and go again.

    Or the expiration could trigger a math box to count the expirations in a DD location.

    Then your code could do whatever you need to relate the counting of 10 mS intervals to the timing you require.


    • #3
      Thank you for the reply kewakl.

      It should be a fun challenge to work that one out. I don't have a lot of experience programming. It will be cool if I can pull it off though.


      • #4
        If 1/2 second resolution is good enough, make the timer 500mS.


        • #5
          Once one is using a counter (which use long integers so range won't be much of a problem, one could count more than three weeks at 1ms) there are system bits for various time intervals, SC5 is 100ms, might be a good option. There is also SC4 at 10ms, but as that is 5ms on and 5ms off I'd be a bit worried about scan time.
          I hesitate to mention this since you said; "It should be a fun challenge to work that one out. I don't have a lot of experience programming"
          But, the CLICK does have timed interrupts, one could increment a DD register, in a 10ms interrupt without any problem. I once did that at 1ms for a tachometer application, while it did seem to work, I think 1ms might be pushing ones luck a bit, and that was only incrementing a register in the interrupt program, to actually do anything at a millisecond resolution ones handler might be too long for that rate (in my tachometer I used a hardware interrupt triggered by a prox. sensor to make a copy of the time, which I then processed in the regular "main" program.)


          • #6
            100 ms timer


            The 100 ms clock pulse works.

            Now I just have to build it into the rest of my program.