Need help with basic ladder logic.

Ron Beaufort said:
and since you’re trying to learn, let’s cover this little lesson too ...



you said:





let’s change that to say:



this is a "Normally Open" ("NO" is fine too) button ... it is CLOSED (don’t say “normally closed”) as long as you hold it down - and OPEN (don’t say “normally open”) once you release it ...



it might not sound like a big difference but the way you said it originally sounds like Yoda-Talk ... sort of like “train this one I cannot - patience he has none” ...





we all know what you meant - but it still sounds kind of odd the way you said it ...



Yes, you are right.
 
ok, here is what I have. This actually works. It turns the light on and off with one pushbuton. Any problems you see with this? Improvements?

--|x1|------[set y0]
--|y0|------(t1 k20)
--|t1|--|x1|--{[rst y0]

x1=push buton
y0=led
 
ok, I found a problem my self. If you hold the push buton to turn ON and hold longer than the timer I have it will turn OFF. Well, a good start.
 
XIO,

Good, now you are starting to "listen" to us. You tried something and it sort of worked. You posted what you had and now we will respond.

Ron Beaufort said:
big hint ...



the trick is to be able to answer the following question: if it was OFF and I just turned it ON, how can I tell the PLC that I “just-now-right-during-this-particular-scan” turned it ON - and not during some previous scan?



big picture: the PLC won’t remember what “just happened” even a fraction of a milli-microsecond ago - unless your program tells it to ...
Can you figure out what Ron is telling you? It looks like you are using Automation Direct. So we will try to use terms common to AD.

How about

When X0 is on and Y0 is off turn on Y0
When X0 is on and Y0 is on turn off Y0

Can you translate this into ladder?
 
milldrone said:
XIO,




Can you figure out what Ron is telling you? It looks like you are using Automation Direct. So we will try to use terms common to AD.

How about

When X0 is on and Y0 is off turn on Y0
When X0 is on and Y0 is on turn off Y0

Can you translate this into ladder?

Yes, I can translate this one into ladder. I am not sure what Automation Direct is. This logic sounds like it would work and is very simple. Nice.
 
Look at the top of this page and you will see "Online Tutorial" which will provide you with the basic info to determine what each symbol does.
 
Change Of Heart And Mind

leitmotif said:
1. Read book
2. Make a proposed design
3. Share proposed design here
4. You will get feedback on good bad points

OR
Submit $200 retainer and I will do your work for you.

WITHDRAWING MONEY DEMAND

OK now that you are starting to toddle and falling we have PROGRESS.

When I was attempting to learn PLC with a Siemens I hooked up the power, wrote a program, and tried it out. It did not work. Then I disconnected the only input I had and THEN got an output. This scared me so I put the Siemens away and decided to find a qualified instructor.
The moral to this story is if you are trying to learn at home be awful careful. Use SMALL incandescant lites for a load on the outputs.

So I went to school where the course concentrated on Allen Bradley. You can configure an input as either normally open or normally closed ie the contact has that slash thru it. I think this has you as confused as I was. Here is what I did to figure this all out. I will not use any program specific terminology so you do not get screwed up on names.

Take a normally open momentary switch (like those used on a 3 wire starter for the start switch).
Hook it to the FIRST input.
Configure it as a NO and have that operate output 1
ALSO
Configure it as a NC and have that operate output 2

Take a Normally Close (ie a motor start stop switch)
Hook to the second input
Configure it as a NO and have that operate output 3
ALSO
Configure it as a NC and have that operate output 4.

HOMEWORK ASSIGNMENT
Predict BEFORE you actually hook up any wires
1 what outputs 1 and 2 will do after energize PLC
2 what outputs 3 and 4 will do after energize PLC
3 predict what outputs 1 and 2 will do when you push the NO switch (first input).
4. predict what outputs 3 and 4 will do when you push the NC switch (second input).

Now hook the whole thing up and see if they work as you predict.

Dan Bentler
 
XIO, I feel your pain. I too am learning to write programs after years of using them to troubleshoot equipment. I decided that knowing the how to WRITE the logic would ultamately add more value to my work. It's very difficult to do on your own even with Logics Pro and one of the higher end reference books suggested by the LearningPit.com. Forums like this one are an invaluable source for me. Searching through threads for answers to "why does this timer not work right?" or bit shift, etc. has definately helped. Keep working and moving forward and eventually you make a breakthrough on something and the light goes on in your head. It's a great feeling.
Keep working and good luck to you.
 
XIO,

There is aleast 6 ways of doing this that I'm aware of (I'm sure there are more). Some of the solutions tend to be platform specific. My guess as to the platform you are using was wrong, so I will need to use a generic solution. The solutions with timers tend to have a flaw that makes them less than desireable.

The ladder solutions (that I've seen) that use the concept of the plc scan cycle as part of their solution require only two rungs (some may use more).
Ron Beaufort said:
big hint ...



the trick is to be able to answer the following question: if it was OFF and I just turned it ON, how can I tell the PLC that I “just-now-right-during-this-particular-scan” turned it ON - and not during some previous scan?



big picture: the PLC won’t remember what “just happened” even a fraction of a milli-microsecond ago - unless your program tells it to ...

Counters can also be used and are an elegant solution if you need more than two states (but also can be used for two state output). Consider a three way light bulb. There are four states of operation, 1.off, 2.low wattage element, 3.high wattage element, 4.both elements on.

To use a counter you need to

1. advance the counter
2. reset the counter after you have reached the last step
3. use the current count to create a specific state.
 
XIO said:
This button is one of those that is NC as long as you hold it down and NO once you release.
This terminology is a carryover from the olden days before PLCs and refers to the state of the device as it sits on the shelf.

There are lots of possibilites but a common case is for an industrial switch to have one NC (normally closed) and one NO (normally open) contact. The key here is the word 'normally'. The NC contact will have continuity, ie. it's "on" and will pass an electrical current, as it comes out of the box without you pressing it. This is its 'normal' state. The NO contact is "off" until pressed. The NC does not become NO by you pressing it. Same goes for the NO.

This also applies to relays, whose contacts are named the same way. A relay's NO contacts will be "off" when the relay is deenergized because the relay is 'normally' off until its coil is activated.
 
XIO said:
Yes, I can translate this one into ladder. I am not sure what Automation Direct is. This logic sounds like it would work and is very simple. Nice.

I was surprise to find out that this just did not work. I don't think I would work without a timer or something for the plc to distinguish between the x0 input. Because here we have to outputs for one input (x0), so that last step dominates.
 
XIO,

Here is your Alternator (or Toggle, Flip-Flop, or You-name-it). There are numerous other ways to do the same thing. This should work on your Mitsubishi, but some other methods may not.

Alternator.jpg
 
XIO said:
I was surprise to find out that this just did not work. I don't think I would work without a timer or something for the plc to distinguish between the x0 input. Because here we have to outputs for one input (x0), so that last step dominates.

That is where you are confusing yourself, you do not have 1 input with 2 outputs, you have 1 input controlling 1 outputs "state" i.e. whether on or off.

The thing you have to realize is that when you press a pushbutton the plc may scan numerous times until you release the button. If you do not condition (give the program the proper instruction) the output will be at the last "state" of the scan dependent on when the pusbutton was released.

I have several examples on my site (signature) but I have a feeling you are bulldogging this and have not read any tutorials like the one provided on this site. The tutorials may not offer everything but will give you a better understanding of basic instructions and how a plc perfoms them.
 

Similar Topics

Hello there, I'm practically new to the PLC world, I'm quite familiar with Siemens TIA Portal but I'm currently tasked to program Schneider PLCs...
Replies
5
Views
1,880
Using studio5000 v21 I had a challenge in a course. When you press a light pushbutton on it turns the light on. When you release the pb it stays...
Replies
7
Views
2,920
Hi, I am using visilogic to control a system that i have designed. I have designed a automated color sorting mechanism using a color sensor. I...
Replies
2
Views
1,453
using S7-200 PLC for this case... Heres my problem... I have 2 NORMALLY OPEN Push Buttons PB1 is I0.0 PB2 is I0.1 PB1 and PB 2 are connected in...
Replies
5
Views
1,525
I have a slc 5/04 (1747-L541C). I have a 1746-BAS 5/02 in the rack. I have 2 automation direct EZtouch screens. I have no problem programming...
Replies
1
Views
1,587
Back
Top Bottom