Ladder logic Program-How to start and hold an LED?

Discussion in 'The Projects Forum' started by DeathYu, Feb 3, 2012.

  1. DeathYu

    Thread Starter New Member

    Jun 1, 2010
    4
    0
    This is my ladder logic
    Code ( (Unknown Language)):
    1.  
    2. |--Input Switch_1 ---Normally closed T3----Timer_T1(1second)--|
    3. |--Normally open T1---Timer_T2(2second)--|
    4. |--Normally open T2-- Timer_T3(3second)--|
    5. |--Normally open T1--Normally closed T2---Output_1--|
    6. |--Normally open T2--Normally close T3---Output_2--|
    7.  
    Circuit operation of my circuit
    When Input switch_1 is turned on , after 1 second , Output_1 is turned on.Then Output_2 is turned on at 2second and Output_1 is off. Then at 3 seconds , output_2 is turned off. Lastly , the circuit operation repeats itself. 1-->2-->1-->2-->1-->2

    What I need to do.
    For example , when input Switch_2 is turned on at output_2 is turned on , it will hold at output_2(meaning pause at that point) and when the input switch_2 is turned off , the circuit operation continue itself again. meaning 1-->2-->1-->2-->1-->2

    If you don't get what I mean , it is something like this 1-->2(Hold at this point)-->1-->2-->1-->2.
    When the input switch_2 is turned off ,the it goes from 2-->1-->2-->1-->2

    Please help
     
    Last edited by a moderator: Feb 7, 2012
  2. BSomer

    Member

    Dec 28, 2011
    433
    106
    Let me see if I have this right...
    You have a switch(1) that enables a timer that counts in seconds.
    At second #2, LED 1 turns on.
    At second #3, LED 1 turns off and LED 2 turns on.
    It then continues this cycle, 1 - 2 - 1 - 2...
    Then you want to interrupt the cycle with a second switch that holds it at the second LED.

    Is this correct? If so you may be able to use a sequencer in your logic program that gets clock cycles from the timer. Does there need to be some way to reset the system?

    I can probably come up with something. Are you using any particular type of PLC or program to write this?
     
  3. DeathYu

    Thread Starter New Member

    Jun 1, 2010
    4
    0
    I am using rslogix 5000 for the above code. Actually it should be at second #1 , LED 1 turns on. At second #2 , LED 1 turns off and LED 2 turns on. At second #3 , it turn off the LED 2 and reset the timer so the whole thing becomes a loop 1-2-1-2
     
  4. BSomer

    Member

    Dec 28, 2011
    433
    106
    Sorry for the late response, been a little busy with other things. Like I was saying before though, using a sequencer could be one possible solution to your problem.

    Code ( (Unknown Language)):
    1.  
    2. |---||------|/|----------|TON   |--(EN)-------|
    3. |   SW1   R6:0/EN        |T4:0  |--(DN)       |
    4. |                                             |
    5. |---||-------|/|---------|SQO         |       |
    6. |  T4:0/DN    SW2        |Dest:   O3:0|       |
    7. |                        |Control R6:0|--(EN)-|
    8. |                                             |
    9. |---||-------------------------(OTE)----------|
    10. |  SW2                         LED2           |
    11.  
    This is just a start of something that you can use. You will need to change your N7 (interger) Data File to the data needed for your application. Something like N7:1 = 0, N7:2 = 01h, N7:3 = 02h. You can put these numbers in as hexidecimal, binary, or decimal.
    The R6:0 is the control word which contains the status, length, and position. The length is the number of words in the sequencer file, this does not include position 0. So in your case it would be 2. The position is the starting point of the sequencer, i.e. 0. This is considered the "home" position, where it goes when nothing is running.

    As to the second switch, it would be used twice in the program. First to disable the SQO. Second is to turn on the LED#2.

    If you have a users manual or similar for your specific program read the section about the sequencer. If you are still having problems I might be able to help a little more. It has been a while since I have done any of this but I did find some of my notes from school.

    Hope you find this somewhat helpful.

    Brian
     
    Last edited by a moderator: Feb 7, 2012
  5. panic mode

    Senior Member

    Oct 10, 2011
    1,320
    304
    there are many ways to do this but using sequencer is probably the most common. here is alternative using counter (but uses same principle).
     
  6. BSomer

    Member

    Dec 28, 2011
    433
    106

    Very true. While I was in school we had our labwork to do and almost every student came up with a different way to do each lab. The thing to keep in mind is "if it works, it is right" which is to say that there isn't only one correct way to do things. There can be many different solutions to a problem. I suggest trying both of the methods here. Learn how they are supposed to work. Then try to come up with your own.
     
Loading...