Announcement

Collapse
No announcement yet.

Simple Up down counter help

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


  • Simple Up down counter help

    Hi,

    I am new to PLC programming and was assigned a simple task for learning how to use Directsoft programming. I am currently using DirectSOFT 5 and a Direct Logic 06. My sample project consists of connecting a forward button to x1 and a reverse button to x2. When the forward button is pushed an internal counter has to count up by one and when the reverse button is pushed the counter has to count down by 1 so in order to do this I set up a UDC with using my X1 as up and x2 as down. I need help with reseting the counter as I need the counter to reset if I hold the forward button for 5 seconds. How do I set this command up? Also how would I set up another process where if i held the reverse button for x amount of time it triggered another output? A picture of the ladder view would be very helpful to help me understand!




    Thanks,
    Jalen


  • #2
    Did you try what I suggested before the thread was moved?
    thePLCguy

    Bernie

    Comment



    • #3
      Originally posted by bcarlton View Post
      Did you try what I suggested before the thread was moved?
      Hi Bernie,

      I reposted the forum here since you said it was posted in the wrong place. I will attach your original response to this as I am still confused.

      I was able to get it to work from your previous post.

      I have another question although. How can I get the PLC to turn on y2 once my counter has reached a count of 5? And lastly how can I program my PLC to alternate every second between two inputs such as y6 and y7 from holding both my forward button (x1) and reverse button (x2) at the same time?

      Thanks

      Comment



      • #4
        Please post your modified UDC code along with rungs which show what you are currently doing to address your additional two questions. Will help you from there.
        Last edited by bcarlton; 11-06-2018, 11:37 AM.
        thePLCguy

        Bernie

        Comment



        • #5
          Originally posted by bcarlton View Post
          Please post your modified UDC code along with rungs which show what you are currently doing to address your additional two questions. Will help you from there.
          Here is what my code looks like as I was able to solve the first question however I need help with p
          rogramming my PLC to alternate every second between two inputs such as y6 and y7 from holding both my forward button (x1) and reverse button (x2) at the same time. I attached an image of my layout that I have.
          Attached Files

          Comment



          • #6
            As written rung 7 would turn on Y2 once a count of 10 is reached, not 5 as you stated previously.

            Your rung 6 will turn on Y3 after holding reverse (X2) on for 5 seconds (timer 1 in rung 5) - you hadn't mentioned this.

            thePLCguy

            Bernie

            Comment



            • #7
              Originally posted by bcarlton View Post
              As written rung 7 would turn on Y2 once a count of 10 is reached, not 5 as you stated previously.

              Your rung 6 will turn on Y3 after holding reverse (X2) on for 5 seconds (timer 1 in rung 5) - you hadn't mentioned this.
              For my program I had changed the count to 10 instead of 5 and also figured out how to make my Y3 turn on from holding the reverse (X2) for 5 seconds so i didn't add it to the forum post. I still don't know how to trigger two outputs at the same time from holding two inputs. Would I put the two inputs connected to each different output?

              Comment



              • #8
                You can put both inputs at the beginning of the line either in series or parallel.
                The put the outputs both at the end of the line.
                After you put in a contact or coil, highlight the contact or coil, hold down the CTRL button and press down arrow to add in additional contacts or coils.
                Attached Files

                Comment



                • #9
                  Originally posted by RogerR View Post
                  You can put both inputs at the beginning of the line either in series or parallel.
                  The put the outputs both at the end of the line.
                  After you put in a contact or coil, highlight the contact or coil, hold down the CTRL button and press down arrow to add in additional contacts or coils.
                  I see thanks Roger I was able to do what you did in your screenshot, however if I would like to do the same thing except have my outputs alternate each second how would I do so? So basically in the case that you sent me it would have Y103 and Y104 alternate in between each other every second that c103(input 1) and c104(input 2) are held together.

                  Comment



                  • #10
                    To get the outputs to alternate in one second increments, look at the timer examples in:
                    https://support.automationdirect.com/examples.html
                    File - EP-MISC-012 Off-Delay Timer

                    Write your logic so that one output starts, times out, and drops out.
                    When it drops out, start the second output and do the same to alternate between the two.

                    Comment



                    • #11
                      Originally posted by RogerR View Post
                      To get the outputs to alternate in one second increments, look at the timer examples in:
                      https://support.automationdirect.com/examples.html
                      File - EP-MISC-012 Off-Delay Timer

                      Write your logic so that one output starts, times out, and drops out.
                      When it drops out, start the second output and do the same to alternate between the two.
                      Thats close but using that method requires my input to turn off in order to activate the off delay timer or on delay timer. However in my case, my inputs will be on the whole time thus I cannot use the off delay timer or on delay timer. The closest I got to obtaining my results was trying to use the accumulator timer example to trigger my outputs but I can only trigger them on after a one second delay. With setting up the reset function I don't know what to input in that slot that will allow my timer to reset every 1 second. Will this method help solve my problem or am I totally off?
                      Attached Files

                      Comment



                      • #12
                        To get around that condition, use the inputs to turn on a C bit and not directly the inputs to the timers.
                        Use C bits to turn on and off the timers.

                        Comment

                        Working...
                        X