# Logic Gates

#### Fluke289

Joined Aug 8, 2013
21
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.

#### Attachments

• 2.2 KB Views: 5

#### hp1729

Joined Nov 23, 2015
2,304
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.
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?

#### Fluke289

Joined Aug 8, 2013
21
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.

#### djsfantasi

Joined Apr 11, 2010
9,081
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.

#### hp1729

Joined Nov 23, 2015
2,304
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.
Good!

#### Fluke289

Joined Aug 8, 2013
21
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:

#### hp1729

Joined Nov 23, 2015
2,304
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:

Did you find the ladder logic tutorial here in the forum?

#### joeyd999

Joined Jun 6, 2011
4,974
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:

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.

#### Fluke289

Joined Aug 8, 2013
21
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.
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.

#### Fluke289

Joined Aug 8, 2013
21
Did you find the ladder logic tutorial here in the forum?
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.

#### hp1729

Joined Nov 23, 2015
2,304
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.
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.