adccommunitymod (AutomationDirect) asked a question.

Simple Up down counter help

Created Date: October 30,2018

Created By: chojjj

**** 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.****

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


  • adccommunitymod (AutomationDirect)

    Created Date: October 30,2018

    Created by: chojjj

    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

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: October 30,2018

    Created by: bcarlton

    Did you try what I suggested before the thread was moved?

  • adccommunitymod (AutomationDirect)

    Created Date: November 05,2018

    Created by: chojjj

    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

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: November 05,2018

    Created by: bcarlton

    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.

  • adccommunitymod (AutomationDirect)

    Created Date: November 07,2018

    Created by: chojjj

    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.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: November 07,2018

    Created by: bcarlton

    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.

  • adccommunitymod (AutomationDirect)

    Created Date: November 08,2018

    Created by: chojjj

    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?

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: November 08,2018

    Created by: RogerR

    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.

  • adccommunitymod (AutomationDirect)

    Created Date: November 08,2018

    Created by: chojjj

    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.

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: November 08,2018

    Created by: RogerR

    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.

    Expand Post
10 of 12