Announcement

Collapse
No announcement yet.

K0 Timer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts


  • K0 Timer

    I'm fairly new to directsoft and looking over code that someone else wrote. I noticed they used a timer with K0. My understanding is that this would activate as soon as the logic before it on the rung does so it would be no different than a coil. Is this correct?

    I'm just trying to figure out why they would have used this instead of a coil. I'm guessing maybe when they first wrote the code they wanted a delay but then later edited it and it was faster to just change the timer to K0 than make a new coil.

    I attached a picture of the code, the timer is on line 69 and it activates a coil on line 70.

    Thanks!
    Attached Files


  • #2
    I've done similar things as I write the program and didn't need the timer or forgot about it when I commissioned the machine. The only difference is that I usually use a v-memory location for the timer preset instead of a constant (K value) so I can make live changes without uploading the program each time.

    You are correct in that it acts just like a coil. It may take one scan longer than a coil (I'd have to look it up to see for sure), but this seldom makes any difference.

    Comment



    • #3
      Sometimes you are not using a TMR as an event generator, but as a monitor of time, e.g. How long has it been since I turned on Y5 (you would use Y5 as the input to the TMR).

      Sometimes you need MULTIPLE timed events, and you use a single TMR, but then use RELATIONAL CONTACTS on the Timer's accumulator (e.g. V0 for T0, V1 for T1, or just use the alias TA0, TA1). Note: try to NOT use EQUAL TO contacts with FAST TIMER ACCUMULATORs, cuz if your scan time is LONGER than 10ms, your V0 may JUMP from 99 to 101 and skip the value 100. Recommend that you use >= contact with a PD coil

      TA0 >= K100
      PD C100

      TA0 >= K200
      PD C101

      TA0 >= V2000
      PD C102

      If T0 is a SLOW timer (tenths of a second), then...
      C100 would turn ON for 1 PLC scan when you crossed the 10.0 second mark
      C101 would turn ON for 1 PLC scan when you crossed the 20.0 second mark
      C102 would turn ON for 1 PLC scan when you crossed the number of "tenths of a second" in V2000 (BCD)
      There are 10 kinds of people in this world, those who know binary, and those who do not.

      Comment



      • #4
        Originally posted by franji1 View Post
        Sometimes you are not using a TMR as an event generator, but as a monitor of time, e.g. How long has it been since I turned on Y5 (you would use Y5 as the input to the TMR).
        Interesting. I've noticed the timer accumulator continuing to run after the timer reaches its preset, but I never thought to use them that way. I always dismissed a timer after it timed out.

        Comment

        Working...
        X