Please Help Using One Shots

Bryan, First you need a good written statement of the problem.

1. When Inputs 1 and 2 are on, then Output 1 will be on and remain on EVEN after EITHER Input 1 OR Input 2 is turned off. The only way to turn Output 1 off (after it is on) is to turn Input 3 on. If Inputs 1, 2, AND 3 are ALL on, then Output 1 will be on.

2. Add a reverse switch to your program so that, when it is TRUE, the program will work as follows: When Inputs 1 AND 2 are turned on then Output 1 will be off (and remain off until Input 3 is made). Output 1 will remain on after Input 3 is turned off (as long as Inputs 1 AND 2 are on).

Then you need one rung similar to this:
Latch_Homework4.jpg


Here is a different method using the Latch & Unlatch. Unzip the attached LogixPro file and try it out. It meets all of the requirements, but is more complicated.

There are 1000 ways to solve this problem. These are only two of them.
 
Last edited:
Peter Nachtwey said:
Good, but since it is unlikely you will ever meet either of us it is just best you understand.

I know you and Terry are close to each other proxmity wise BUT I plan to be in Chicago when Terry is, how bout you?
 
Gee, it just occurred to me... I wonder how many actually go through the pains of completely reading through my long-winded posts... hmmm... I just wondered... Am I really blowing just so much hot wind?

As specified (probably by a very poor trainer, or book, or a very poor interpretation on the part of the student)... the solution to the problem is somewhat untenable, unless you work with "implied" information. That is NOT to be expected, or accepted, in the real-world.

Poor "specs" can lead to poor implications... that is, results based on implied questions or responses based on implied logical situations. On the whole... that is a HORRID situation to work under! It is DOOMED to failure... at least, in the eyes of some (the Contractor?).

To the issue, as described...

If 1-ON & 2-ON... OUT-ON. This is an absolute constraint.

Once OUT is ON... it will remain ON as long as either 1 or 2 are ON... until the OFF-Condition occurs.

In order to turn OUT OFF... 3 MUST go ON... WHILE OUT IS ON... and while one, or the other, of 1 or 2, but not both, is OFF.

However, there is another absolute constraint... if 1-ON & 2-ON & 3-ON then, OUT-ON.

So... in order to turn OUT OFF... it MUST be the case that either 1 or 2, but not both, MUST be OFF.

Starting with all Inputs OFF, and assuming that Inputs go ON one-at-a-time... a normal ON-OFF sequence would have to follow one of the following possible sequences (X-ON, X-OFF, X-ON doesn't count)...

Case-1:
1-ON, then 2-ON... => OUT-ON (1 & 2 = Latch OUT-ON)
-OR-
Case-2:
2-ON, then 1-ON... => OUT-ON (1 & 2 = Latch OUT-ON)
-OR-
Case-3:
3-ON, then 1-ON, then 2-ON... => OUT-ON (1 & 2 & 3 = OUT-ON and 1 & 2 = Latch OUT-ON)
-OR-
Case-4:
3-ON, then 2-ON, then 1-ON... => OUT-ON (1 & 2 & 3 = OUT-ON and 1 & 2 = Latch OUT-ON)
-OR-
Case-5:
1-ON, then 3-ON, then 2-ON... => OUT-ON (1 & 2 & 3 = OUT-ON and 1 & 2 = Latch OUT-ON)
-OR-
Case-6:
2-ON, then 3-ON, then 1-ON... => OUT-ON (1 & 2 & 3 = OUT-ON and 1 & 2 = Latch OUT-ON)

Now... how can OUT be turned OFF???

The "spec" says... if 3 goes ON while OUT is ON, then OUT will go OFF.

However, there are absolute constraints that will keep OUT ON!

In order for OUT to go OFF... it MUST be the case that none of those constraints be present, and further, that 3 goes ON while OUT is ON.

That is... all "causes" to go ON, or be ON, must be removed before the "cause" to go OFF occurs.

So... in light of this... a better "spec" would have said...

1. If 1 & 2 is ON, then OUT will go ON, and remain ON as long as either 1 or 2 is ON.

2. If 1 & 2 & 3 is ON, then OUT will be ON.

3. If OUT is ON, and either 1, or 2, but NOT both, is ON... and then 3 goes ON... OUT goes OFF.

If this is indeed the "spec"...

Then... there are actually two ways to turn OUT OFF...
One way is for 3 to go ON WHILE either 1 or 2 is OFF, but NOT both, AND OUT is ON.
The other is for both 1 & 2 to be OFF.



K-MAP... You have to follow the Inputs. HOWEVER... be aware, many of the various paths are NOT valid! Consider the Map in terms of the constraints.

3 OUT
1 2 0 0 0 1 1 1 1 0
+-------+-------+-------+-------+
0 0 | OFF | Turn | Turn | OFF |
|(Wait) | OFF | OFF |(Wait) |
+-------+-------+-------+-------+
0 1 | OFF | ON | Turn | OFF |
|(Wait) |(Wait) | OFF |(Wait) |
+-------+-------+-------+-------+
1 1 | Latch | ON | ON | Turn |
| ON |(Wait) |(Wait) | ON |
+-------+-------+-------+-------+
1 0 | OFF | ON | Turn | OFF |
|(Wait) |(Wait) | OFF |(Wait) |
+-------+-------+-------+-------+



Typical path is...

0000 to 0100, or 1000... wait...
Then 0100 to 1100, or 1000 to 1100... latch OUT... 1101.

Then, if 1101 to 0101, or if 1101 to 1001, then... Hold OUT, 0101 or 1001.

Then, if 0111 or 1011, then, turn OFF OUT, and maintain 0110 or 1010, and wait.

Notice that 1111 to 0111, and 1111 to 1011, is NOT valid

I'll have to carry on a bit later...

Except I will say this...

The BANE of ALL Engineering effort is a poorly defined problem!

The hardest part of being a player here at PLCs.net (I got it right that time, Phil!) is the extreme effort that we players have to put in to Reverse-Engineer the question.

One of the very first things I learned in Engineering is... When facing a problem... What is the REAL question?

Defining problems completely, and accurately, is damned near an art in itself!

I said "damned near"... I'll take that back...

90% of REAL Engineering IS INDEED properly defining the question!!!

Solutions are question-based... The hard part is to properly define the question!

If you don't really, and I mean REALLY, know what you are seeking... how in the hell can you possibly expect to find the right answer???
 
  1. when inputs 1 and 2 are on then output 1 will be on and remain on after either input 1 or 2 are turned off. the only way to turn output 1 off after it is on is to turn input 3 on, if inputs 1, 2, and 3 are on then output 1 will be on. (this part I got)
  2. add a reverse switch to your program so that when it is true the program will work as follows.
In order to turn OUT OFF... 3 MUST go ON... WHILE OUT IS ON... and while one, or the other, of 1 or 2, but not both, is OFF.
Terry, you are having trouble translating the English specifications into your K-map.

The specifications do NOT say, that once Output 1 is on, that BOTH Input 1 and Input 2 cannot be off. Only 1 of them must be off. Once Output 1 is ON, the only constraint is that it cannot be turned off except by use of Input 3. Also it must stay ON if ALL 3 Inputs are on.

In other words, if both Inputs 1 & 2 are ON, then Input 3 can be on or off and it will have no effect on the Output. If Output 1 is ON, then BOTH Input 1 and 2 can be turned off, and still Input 3 must turn off Output 1. Whether BOTH Input 1 & 2 are off is a "don't care" condition as to how it affects the way Output 3 turns off, except if all 3 are ON.

It is typical of most engineers that the biggest problem they face is to translate word descriptions into mathematical concepts. It is an area full of pitfalls. Many are called, but few succeed.
 
Last edited:
wow

ok guys I guessed i poorly translated this or either who knows

the part thats says ( and this is quoted straight from the assignment paper) when switch 1 and 2 are turned on then light 1 will be turned on and remain on after either switch 1 or 2 are turned off. the only way to turn light 1 off is to turn on switch 3.
if switch 3 is on and switch 1 and 2 are on then light 1 will be on.

That part of the problem I have solved. the trick is the next part (to me that is)

when switch 1 and 2 are turned on light 1 will be off ( so do you assume that light 1 was on from startup?) and remain off until switch 3 is turned on. light 1 will remain on after switch 3 is turned off as long as switch 1 and 2 are still on.

as oif right now I have the porblem solved (assuming that light one was NOT on at startup)
I really do appreciate all your help, I look forward to learning enough to be able to participate more in this forum.
 
Bryan,

1. When Inputs 1 and 2 are on, then Output 1 will be on and remain on EVEN after EITHER Input 1 OR Input 2 is turned off. The only way to turn Output 1 off (after it is on) is to turn Input 3 on. If Inputs 1, 2, AND 3 are ALL on, then Output 1 will be on.

2. Add a REVERSE switch to your program so that, when it is TRUE, the program will work as follows: When Inputs 1 AND 2 are turned on then Output 1 will be off (and remain off until Input 3 is made). Output 1 will remain on after Input 3 is turned off (as long as Inputs 1 AND 2 are on).

Because the instructions said in Part 2, that the new switch Input 3 was a REVERSE switch, we have to ASSUME that the functions of the Inputs in Part 1 are REVERSED by the logic of Part 2. In other words, the functions of Inputs 1 & 2 are swapped with those of Input 3.

That means when the REVERSE switch is ON, if Output 1 is off, then Input 3 turns on Output 1. Similar to Inputs 1 & 2 in Part 1, once ON, Output 1 must stay ON even after Input 3 is off. The only way to turn off Output 1 in Part 2 is to turn off both Inputs 1 and Input 2 (as we turned off Input 3 in Part 1.

Do you realize now that all the ladder logic that you have posted in this thread had the same bad error: using the same output more than once, in different rungs. Normally an output in RSLogix should be used in the program only one time. If it appears more than once, then the last instance is the one that is effective, and the others are useless. The only exceptions are generally for Latch/Unlatch and Set/Reset of the same output (normally 1 time for each instruction)
 
Last edited:
Lancie, Yeah Our programmer at work today pointed out that I had violated a very important rule of programming by using the same output in more than 1 rung, thanks tho for pointing that out.But i still have not figured out a way to make this thing work as stated in the assignment ( assuming that the output is on when the reverse switch is on.
I can make it all work as specified as long as the output isnt on with just the reverse switch made.

Really appreciate Your time and effort here
 
Lancie, just reread what you stated in previous message, as long as input 3 has to be on for output 1 to be on then I think i have it licked....lol


I'll let you know what the out come is tommorrow after class
 
Granted... the REAL question might be simpler then expressed... but none the less, we can only work with what we have... REALLY have...

Lancie...

You are reading more into the description than is actually there.

This is a direct quote...

1. when inputs 1 and 2 are on then output 1 will be on and remain on after either input 1 or 2 are turned off. the only way to turn output 1 off after it is on is to turn input 3 on, if inputs 1, 2, and 3 are on then output 1 will be on. (this part I got)

#1) When Inputs 1 and 2 are ON... Output will go ON...

#2) ...and remain ON... ...after either Input-1 or Input-2 are turned OFF.

#3) The ONLY way to turn the Output OFF, after it is ON... is to turn ON Input-3.

#4) If Input-1 & Input-2 & Input-3 are ON... the Output will be ON

Re: #1 "When Inputs 1 and 2 are ON... Output will go ON..."
This is a straight forward, absolute, response.

Re #2 "...and remain ON... ...after either Input-1 or Input-2 are turned OFF."
This one is less straight forward.
It appears that... After turning the Output ON... if EITHER one OR the other is turned OFF... then the Output will stay ON. FINE! If 1-ON & 2-OFF & Output-ON... keep Output-ON, -OR- If 1-OFF & 2-ON & Output-ON... keep Output-ON. Aahhh... but what does this imply if BOTH of those Inputs are turned OFF? No help from #1. Maybe #3 or #4 can help...

Is the purpose of this "rule" to ensure that, once turned ON, at least one of the two inputs, 1 or 2, are necessary to keep the Output ON? Certainly, according to Rule #1 the Output will be ON if 1-ON and 2-ON. If you look ahead a bit... you'll see that Rule #4 supports the same idea.

Because Rule #4 is as it is... it absolutely MUST be the case that at least one of the two inputs, 1 or 2, is OFF when 3 is turned ON so as to turn OFF the Output... otherwise, Rule #4 keeps the Output ON! At the most, the Output will be OFF for only one-scan (depending on the order of the code).

So, again... if the Output is ON... what happens when BOTH input-1 and input-2 are OFF?

There is no indication how this condition is to be handled.


Re #3 "The ONLY way to turn the Output OFF, after it is ON... is to turn ON Input-3."
This indicates that, if Output is ON, then turning ON Input-3 is sufficient to turn OFF the Output. In fact... it is the ONLY way to turn it OFF!

Is it the case that the Output will remain OFF as long as Input-3 is ON? Maybe #4 can help. By the way, this "rule" doesn't help solve the problem in #2.

Re #4 "If Input-1 & Input-2 & Input-3 are ON... the Output will be ON"
Just as #1, this is a straight forward, absolute, response.
So... this helps, at least somewhat, to clarify the issue in #3. It is clear that the simple fact of having Input-3 ON does not necessarily prevent the Output from being ON.

So... how does this Input-3 thing work?

If 1-ON & 2-ON... Output ON <= No Problem
If Output-ON & 1-ON & 2-OFF... Output-ON <= No Problem
If Output-ON & 1-OFF & 2-ON... Output-ON <= No Problem
If Output-ON & 1-OFF & 2-OFF... ????? <= this condition is NOT described!
If 1-ON & 2-ON & 3-ON... Output ON <= No Problem

So... what are the issues?

If 1-ON & 2-ON... then, Output ON... if 1-OFF & 2-OFF... what happens?

Since Rule #3 said... "The ONLY way to turn the Output OFF, after it is ON... is to turn ON Input-3."[/b]
Doesn't that very, very, strongly imply (state?) that the simple act of turning ON Input-3, while the Output is ON, is "cause" enough to turn OFF the Output? At that point, it should be expected that the Output will stay OFF only as long as there is no "cause" to be ON...?

And so... 1-ON & 2-ON... Output-ON... then 3-ON... Output-OFF... but then, 1-ON & 2-ON & 3-ON = Output-ON.

In order to have a stable system... at least ONE of the Inputs (1 or 2) MUST be OFF when Input-3 goes ON!

It is unanswered questions, just like these, that lead to the misunderstandings that prevent a NASA spacecraft from orbiting, or landing properly on a distant planet, and instead... sends that NASA spacecraft crashing into the surface. ...snort!

By the way, the code for the first part alone is... 2 rungs.

The REV part also includes 2 rungs... for a total of 4-rungs.

It can be even less than 4-rungs.
 
Bryan,

I find it hard to help you. I sometimes forget that students do not know enough about programming to know when the correct solution is staring them in the face!

If you use the one-rung code that I posted, you will see that it meets all your conditions, for both the REVERSED and unREVERSED conditions, using one rung. I suppose you did not believe that it could be done with one rung. Try it, you will like it.
 
Last edited:
Terry,

You are so far off in left field that I do not know how to answer! What are you smoking?
 
Lancie , Sorry if you feel that Im being hard headed,the fact is I did try the one rung solution you posted and it did not meet the requirementstrue the instructor was not very clear on his instructions, but after talking to him today

when it says " when inputs 1 and 2 are turned on, output 1 will be off (implies that out put 1 is on until inputs 1 and 2 are turned on.

so when inputs 1 and 2 are on output 1 will be turned off, until input 3 is turned on, which will latch output 1 and will remain on if input 3 is turned off, as long as inputs 1 and 2 are still on.

I apologize for knowing so much less than You other guys, but a person must start somewhere huh.
 
Bryan

What you are saying then is that the description can be intrepreted any way your instructor wants. It could mean "go catch a cat and twist it's tail". In this case I can't help you much.

With a clear description, I can make it do whatever is necesssary. I could make a good argument that my one-rung soulution meets all the original stated specifications, but it does not meet any extra implied, unstated goals. If Inputs 1 & 2 are already on when you START, then what turned them on? Some great OZ hidden behind the curtain? Come on, get real! If there are unseeen undefinded events happening BEFORE the problem starts, and not mentioned, then you are tilting at windmills!

Please tell your instructor that he has to completely define the problem to get a perfect solution. English word descriptions are the very worst way to do that, because words mean whatever somebody thinks they do.

Remember when President Bill Clinton said on national news, "I did not have *** with that woman"? Later he said it all depends on what you mean by "***". Diddling with a cigar does not count as *** according to Bill's definition.

Your instructor is diddling with you. Are you going to lay back and take it?
 
Last edited:
I ouldnt agree with you more about poor defining if what is wanted, However he is the instructor and Who Am I to tell him how to teach.

I do however have a very good understanding of what he wants now.

I'll post what is actually wanted with what I have as a solution so far.

Sorry to have caused so much confusion, but this site is called PLCS.NET Your personal tutor site.
 

Similar Topics

After replacing the 70 with the 525, the PLC can read from the drive and recognizes it as online, but no commands are being listened to. PLC is...
Replies
1
Views
565
Q(1) Design a controlling system using DVP-40ES Delta PLC for a threestory Elevator Prototype as shown in the figure below. Show in details the...
Replies
4
Views
2,167
hi all! im having trouble with using masked equal. im on logixpro simulator at the moment. i have a screenshot for reference. please tell me why...
Replies
2
Views
2,621
please help me . I have to make this ladder diagram and I can’t figure it out :(
Replies
12
Views
351
Back
Top Bottom