Announcement

Collapse
No announcement yet.

Do-more timer

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


  • Do-more timer

    I'm trying to sequence some outputs using comparative contacts by looking at the accumulator value of a timer. It's not working. Greater-than and less-than contacts are not working as expected. I've attached a screenshot.

    Click image for larger version

Name:	timer.png
Views:	147
Size:	973.2 KB
ID:	125898
    I want Y3 to turn on for 1sec between 0 and 1sec, and Y6 to turn on for 1sec between 3 and 4sec. I've done this many times in DirectSoft, but I can't get it to work in Do-more Designer. What silly, simple thing am I missing here? Do comparative contacts work with timer accumulator values?

    DMD 2.6
    PLC: BX-DM1E-18ED13-D


    Thanks,

    Ryan Poethke
    Attached Files


  • #2
    It looks like it should work to me. Ther only two things I can think of would be if you are using those Y outs somewhere else and it is keeping them from turning on, or a strange interaction with the timer start and latch. If your timer is not working, then it *may* be because the edge contact is turning the line on for one scan, which turns the output on, but perhaps the output is not on during the next scan since the edge contact doesnt hold it on, and this the timer never latches? But thats assuming the timer isnt starting is the problem you are having.

    Comment



    • #3
      Accumulator is ms

      Comment



      • #4
        Originally posted by MikeN View Post
        It looks like it should work to me. Ther only two things I can think of would be if you are using those Y outs somewhere else and it is keeping them from turning on, or a strange interaction with the timer start and latch. If your timer is not working, then it *may* be because the edge contact is turning the line on for one scan, which turns the output on, but perhaps the output is not on during the next scan since the edge contact doesnt hold it on, and this the timer never latches? But thats assuming the timer isnt starting is the problem you are having.
        Nope. The timer starts and runs just fine. It's the comparative contacts that aren't behaving as expected. The less-than contacts ( < ) turn off as soon as the timer starts to run.


        Ryan Poethke

        Comment



        • #5
          Originally posted by M123 View Post
          Accumulator is ms
          Yes. The .Acc member is an integer constant representing the number of milliseconds.

          Just change your constant compare values from floating point seconds to integer milliseconds (e.g. change 3.000 to 3000). That should get it working.
          There are 10 kinds of people in this world, those who know binary, and those who do not.

          Comment



          • #6
            That is definitely confusing. Hopefully we can make it more obvious that the status is intelligently formatting the .Acc value to be hours:minutes:seconds.milliseconds, but programmatically, the .Acc value is an integer in milliseconds.
            There are 10 kinds of people in this world, those who know binary, and those who do not.

            Comment



            • #7
              Originally posted by M123 View Post
              Accumulator is ms
              That was it. I got fooled since you set the timer in seconds now, and don't have to do the mental math. I knew it was something silly.


              Thanks,

              Ryan Poethke

              Comment



              • #8
                Originally posted by franji1 View Post
                That is definitely confusing. Hopefully we can make it more obvious that the status is intelligently formatting the .Acc value to be hours:minutes:seconds.milliseconds, but programmatically, the .Acc value is an integer in milliseconds.
                It would be cool if the comparative contacts "knew" they were looking at a timer's accumulator, and be able to be addressed as hours:minutes:seconds.milliseconds. If you weren't comparing a timer's accumulator, the contact would behave as it always has. Perhaps a "Timer Compare" set of instructions, so that people don't get confused regarding behavior?


                Thanks,

                Ryan Poethke

                Comment

                Working...
                X