Logic Gates

Discussion in 'Homework Help' started by Fluke289, Jan 31, 2016.

  1. Fluke289

    Thread Starter New Member

    Aug 8, 2013
    21
    3
    I have to make a ladder logic program that has (AB + C) on a PLC. I have the program written, but it’s been awhile since I’ve had to read things in terms of (AB + C). I want to double check to make sure that means: A and B or C. I attached a picture of the logic symbols.
     
  2. hp1729

    Well-Known Member

    Nov 23, 2015
    1,964
    219
    Ah, homework noted this time.

    Your logic gates look good. Ladder logic? Think of switches. How would you have to configure switches to get an AND function?
    Simplest form the ladder has two "rails". Power and ground. In between the two are a simple circuit. Switches and loads (lights, motors, relays, etc). So if you had one light to turn on and two switch paths with the reasoning "A and B" and (logical OR) "C", what would it look like?
     
  3. Fluke289

    Thread Starter New Member

    Aug 8, 2013
    21
    3
    I have the program written, I’m just double checking my work.

    In ladder logic I have A and B in series and C is in parallel with A and B.

    If I hold down buttons A and B at the same time my light turns on. If I hold only the C button down, the light goes on.
     
  4. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,812
    834
    What if you hold all buttons down. Does it act as expected? Or if you hold A and C down, are the results what you expected?

    There are eight possible combinations to test. Does your program work for all eight combinations?

    You have three buttons, that can be on or off. Or 0 or 1. The combinations can represented by 000 through 111 in binary or decimal 0 through 7. (E.g., 110b represents A and B held down. What is the result?) This is the basis of a truth table. Look it up.
     
  5. hp1729

    Well-Known Member

    Nov 23, 2015
    1,964
    219
    Good!
     
  6. Fluke289

    Thread Starter New Member

    Aug 8, 2013
    21
    3
    You guys are brutal. Here’s a truth table and a video of the relays in operation. I built my own little “relay trainer” out of spare parts I had around the house.

    You can watch the video here:

     
    absf likes this.
  7. hp1729

    Well-Known Member

    Nov 23, 2015
    1,964
    219
    Did you find the ladder logic tutorial here in the forum?
     
  8. joeyd999

    AAC Fanatic!

    Jun 6, 2011
    2,692
    2,756
    Wow. I'm not sure I would have put so much effort into proving AB+C, but good work! When your done, your wife will love that as a conversation piece in the middle of the dining room table. Trust me.
     
  9. Fluke289

    Thread Starter New Member

    Aug 8, 2013
    21
    3
    My wife saw it and she wants me to build a 4-bit adder using only relays. When I’m finished she wants to display it in her Curio cabinet.
     
    Brownout and absf like this.
  10. Fluke289

    Thread Starter New Member

    Aug 8, 2013
    21
    3
    I’ve looked at just a few tutorials here, but haven’t gone in-depth with them. The class I’m in is a very basic class. I took a PLC class a year ago with some Rockwell Automation equipment, but this class uses actual relays that you need to wire. What I find lacking in the class is that there is probably a better way to wire up all of the relays than what I’m doing, but they kind of just gloss over it.

    For example, for an AND gate, I saw a guy put two buttons in a series, but online it seems people will use two relays to accomplish an AND gate. In class they say, “Well, there’s more than one way to do it”, which is true, but in industry which way would be best practice? Using two buttons in series for an AND gate is definitely cheaper than buying relays to do it.
     
  11. hp1729

    Well-Known Member

    Nov 23, 2015
    1,964
    219
    Yes, two switches make a good AND gate. Half your problem is done. you have A AND B. Now all you have to add is OR C that lights a light.
     
Loading...