plc leds

Discussion in 'Homework Help' started by circut, Aug 8, 2013.

  1. circut

    Thread Starter New Member

    Apr 23, 2013
    5
    0
    Hello ,
    Have been out of school (and work ) for a while. Was working on something I never got to finish from McGraw hill PlC workbook and have not figured out this simple? logic. Here is the question for designing a three led light system. Sure someone has seen it , I just did not find the answer and professor was frustrated at having to explain at the time. >
    1)three leds are to be all turned on (l1 , l2 , l3 ) by sw 1
    2) two leds off l1 and l2 , led l3 is left on. by sw 2
    3) one led l1 is turn back on , l2 is off and l3 on now. by sw 3
    4) all remaining leds are turned off. by sw4
    Probably so many ways to do it, just something I missed about it?
    thanks . finally got reset password.
     
  2. WBahn

    Moderator

    Mar 31, 2012
    17,757
    4,800
    The description sounds like a progression that has to happen in a specific sequence -- you push SW1, then SW2, then SW3, and then SW4.

    What should happen if you push SW2 first? It can't "leave" l3 on since it wasn't on when SW3 was pressed.
     
    screen1988 likes this.
  3. circut

    Thread Starter New Member

    Apr 23, 2013
    5
    0
    Hi , I am glad I got a response so fast. I looked at it that way , as a sequence and I think it is supposed to be. let me post the entire question so i am not misunderstood about what needs to get done. are you giving me a hint Mr WBahn? can do this one no problem. Here it is-
    {{{{{write a documented program that will perform the following tasks:
    {{{{{when swithc 1 is closed lights L1 L2 AND L3 come "on"
    {{{{{When switch 2 is closed lights l1 and l2 drop out ,,leaving l3 on
    {{{{{when switch 3 is closed (all three switches closed at this point ) L1 will come on {{{{{thus showing L1 and L3 on
    {{{{{When switch 4 is closed it turns off any of the lights that are on at the time.
    {{{{{use the io simulator and address' etc . (4 switches and three address')
    -So yes it has to happen sequential. pushing sw 2 is not the "sequence" of operation.
    Learnign and or not gates I think is the gist. A)1 And 2 And 3 And lights are on. then sw 2 turns off the 1 And 2 Or 3 is still on. Then sw 3 Ands it back into circuit ??? sw 4 Not turns it all off!
     
  4. circut

    Thread Starter New Member

    Apr 23, 2013
    5
    0
    I think I answered the question on my own. Just posting because it was simple and I want to let anyone else who gets stuck have a chance. The fact it is a sequential circuit has a lot to do with it , but mostly you CAN use an input address as output . That is the logic but you can not in the real world use a switch like that!
    i will build it in my plc simulator and post it to prove my theory shortly.
     
  5. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,553
    2,375
    Sounds a bit like bad practice?
    Using an input as output coil or result function is usually frowned upon, if you want to record an output function without using a physical output, a storage register bit is usually used?
    Max.
     
  6. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    Do they like these?

    {{{when switch 1 is closed lights L1 L2 AND L3 come "on"
    input sw1, if sw1=1 then L1=1,L2=1,L3=1
    Input the switch data from sw1(I/O), and send the datas to the address L1,L2,L3 to set the lights on.

    {{{When switch 2 is closed lights l1 and l2 drop out,leaving l3 on
    input sw2, if sw2=1 then L1=1,L2=1,L3=1
    ...

    {{{when switch 3 is closed (all three switches closed at this point ) L1 will come on {{{{{thus showing L1 and L3 on
    input sw3, if sw3=1 then L1=1,L2=0,L3=1
    ...

    {{{When switch 4 is closed it turns off any of the lights that are on at the time.
    input sw4, if sw4=1 then L1=0,L2=0,L3=0
    ...
     
  7. circut

    Thread Starter New Member

    Apr 23, 2013
    5
    0
    Sorry I am not keeping up on the issue here by finishing the circuit but I did find the disk to install the plc simulator. I understand MaxHeadRoom comment about input used as output but I was trying this soley from a ladder logic perspective. What about when you latch an output to keep it on, is than not the same thing as an input used to output? I know that is a perfectly legal situation. Thanks for the other solution, probably works fine as far as "programming " the ladder logic , does look like c code not plc ladder logic. I know the plc will accept c programming too. i am working on this thing -I do not know how but I will probably post a screenshot of the ladder logic / plc program .
     
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,553
    2,375
    It may be technically possible, but in PLC programming terms it is considered bad form, and usually unnecessary if internal storage registers are available.
    If you latch an output, it is normally a physical output or the internal storage register previously noted.
    If your WERE to use an input to register an output, it would have to be an unused one, as it would render the input useless as a physical input.
    Max.
     
Loading...