View Full Version : 1 input 3 outputs
guest
February 4th, 2004, 08:31 AM
Is there any way to make one input turn on 3 outputs one at a time?
Leave one on untill the next one is turned on.
Do this without using osr or counter or timer.
I am not in any class.
I am trying to learn plc programming though.
Thanks
Guest
g.robert
February 4th, 2004, 08:35 AM
Not sure of your intentions per your second sentence. But to make three outputs come on off of one input just put the three output coils in parallel with each other and the one input will trigger the three outputs.
JesperMP
February 4th, 2004, 08:43 AM
No, I think he wants to make a flip-flop, only with three states in stead of two (triple-flop ?).
Maybe he can modify one of the many flip-flop code examples that can be found on this site.
Use the search function and specify "flip flop" as the search string.
Steve Bailey
February 4th, 2004, 09:08 AM
Guest,
If you're not doing this as part of a class assignment, why the arbitrary restriction against using a counter or a one-shot?
If it's simply for the intellectual challenge, why ask somebody else to do it for you?
The answer to your question is yes.
panic mode
February 4th, 2004, 09:21 AM
There are so many ways to do it...
Search this forum for one-shot alternatives
and try to use bit shift for example.
Tom Jenkins
February 4th, 2004, 09:35 AM
Well, one obvious answer is a drum timer. However, what you stated you want to do is, to some extent, impossible or at least implausible. As I interpret your statement, you want to have the ouptuts turn on in sequence after a single input transition starts the process, so you have to have something that identifies when the first output's sequence is over and it is time to turn on the next output.
Or do you mean that each subsequent press of a momentary pushbutton will step the outputs through the sequence one at a time? In that case a drum timer can still work, as will bit shifts (bleach!) or adds and compares, or holding coils and flag bits, or lots of other techniques.
Properly phrasing the question is the hardest part of getting a good answer.
And, I must confess, I take your claim of not being a student with a grain of salt!
guest
February 4th, 2004, 09:42 AM
Question restated
no bit shift, no osr, no counter, no timer
1 input, 1st output on and still on
1 (same)input again, 1st output off and 2nd output on and still on
1 (same)input again, 2nd output off and 3rd output on and still on
Steve Bailey, are you calling me a Liar?
But, thanks for your answer.
Thanks
guest
Steve Bailey
February 4th, 2004, 09:59 AM
Guest,
Please don't turn this into an ad hominem discussion. Classroom instructors are fond of applying arbitrary restrictions on their students' solutions in order to force them to apply a specific technique to the problem.
If you're trying to program a real-world application, then your question is akin to asking "Is there any way I can build a house without using a hammer?" The answer is "yes", but it invites the follow-up question "Why?"
guest
February 4th, 2004, 10:17 AM
Steve,
The answer to why was in the first post.
Hint: The last sentence.
& I never asked anybody to do it for me.
Thank you JesperMD & panic mode for flip-flop info
Thanks
guest
panic mode
February 4th, 2004, 10:39 AM
So the bitshift is also off limits!?
Use lookup table...
rdrast
February 4th, 2004, 11:52 AM
Without a oneshot, how do you expect the 'circuit' not to fly through all 3 states in the 100msec the button is down?
And, by not making use of the structure elements provided (including one-shots, timers, and counters) you aren't learning much about plc's.
Bill Simpson
February 4th, 2004, 02:56 PM
***you aren't learning much about plc's.***
Beg to differ, but skipping the basics is not in the interest of aspiring programmers... One might learn enough to troubleshoot the odd PLC program, but he/she won't gain an intimate knowledge of Boolean operations if they don't, or can't work through little challenges such as this... This material is at the heart of all programming languages, and whether you apply it using assembly language instructions, VB logical instructions, or ladder logic instructions, etc.,,, the task is the same, and learning how to solve such puzzles is key to becoming a good programmer... Anyone can use a TON timer, or a Do-Every-Thing instruction, but can you make 3 lights flash in sequence in response to a switch closure using assembly language... If you take up the challenge that this instructor has set out for the students, you just might learn enough to tackle such a problem in any language, on any computer.... Remenber that the WhizBangDoEverthing instruction is only available on Acme PLCs and it's not truly an instruction but rather a built in routine...kinda like the "Move to Perch" instruction in GMF/Karel... Of course you could write your own if you knew the basics...
The most difficult programming instructions to learn are the basic ones, and most people simply skip over the basics if given a chance... Obviously our guest has an instructor who isn't about to allow that, and the challenge is clear...
Picture yourself connected to a PLC2 family processor which lacks an OSR instruction..
Limit yourself to the basic relay instructions (XIO, XIC,OTE,OTL,OTU), and now you will have to think!!!
Of course that may be just what the instructor had in mind...
BTW... telling the student to do a search for a solution that he/she can simply copy has it's flaws also....
PS: I'm not the instructor..
Guest
February 4th, 2004, 03:03 PM
If First Scan - Set FirstScan
If Input and Output 3 or FirstScan - Set Output 1, Reset Output 3, Reset FisrtScan
If Input and Output 1 - Set Output 2, Reset Output 1
If Input and Output 2 - Set Output 3, Reset Output 2
Tim
February 4th, 2004, 03:28 PM
Bill Simpson hit it right on the nose with his reply.
I used to give this little task to the maint. techs at the end of there training. It's amazing how many of them get stumped and swear it cant be done with just plain old internal relays and NOTHING else, NO SET or RESETING relays either. I really like this exercise because it makes you think and become part of the plc as Bill stated.
guest,
Take it one step at a time. You said first input on turn on first output and output stay on. I think you already have gotten this far.
Now, what is new to the plc when you turn the input back off? Input off, BUT ouput 1 on. Now use this to turn on a internal relay and hold it on, naming it "output 1 on ack". When you go turning the input on again what is different from the last time you turned it on? I haven't giving you all the answers, but think about it. If this is not a school project, you will still get a lot more out of it then somebody telling you the whole answer. PLUS, the whole meaning of the project is to make you THINK.
GOOD LUCK
TIM beerchug
Steve Bailey
February 4th, 2004, 03:41 PM
Not a bad start, but it doesn't work.
Let's assume that we're well past the first scan, but haven't turned on Input yet. Output 1 should be ON, Output 2 and Output 3 are both OFF.
When you turn on Input, line 3 turns ON Output 2 and turns OFF Output 1. So far, so good. But when the PLC gets to line 4, Output 2 is ON, so Output 3 gets turned ON and Output 2 gets turned right back OFF.
Reverse the order of lines 2, 3, and 4, and it almost works if Input is a one-shot.
Lancie1
February 4th, 2004, 05:21 PM
guest,
Of course you can do what you described. Steve, he did say to:
"...make one input turn on 3 outputs one at a time?
Leave one on until the next one is turned on.
Do this without using osr or counter or timer."
And his answer is very close:
"If First Scan - Set FirstScan
If Input and Output 3 or FirstScan - Set Output 1, Reset Output 3, Reset FisrtScan
If Input and Output 1 - Set Output 2, Reset Output 1
If Input and Output 2 - Set Output 3, Reset Output 2"
If I were doing it, I would forget the First Scan bit. Your original instructions say nothing about a first scan being a condition, but only that the Input is a condition. So here is my solution:
"If Input and Output 3 or INPUT AND NOT OUTPUT 1 AND NOT OUTPUT 2 AND NOT OUTPUT 3, then - Set Output 1, Reset Output 3
If Input and Output 1 - Set Output 2, Reset Output 1
If Input and Output 2 - Set Output 3, Reset Output 2"
The above will always start with Output 1, anytime that Input is ON, and progress to Output 3, and then recycle. However, as has been pointed out by rdrast and others, the circuit will run through the logic and switch one output on each PLC scan, so the outputs will switch so fast that you probably will only see an erratic blink (if you watch the LED output indicators) every now and then, even though the logic is working correctly. In other words, it works logically, but has little practical application in the real world. Humans unfortunately cannot see and think as fast as the PLC. I wish I had a dime for every ladder routine that I have erroneously written like this one! To make it into something useful, you need another variable, such as a timer or another input, to control HOW LONG that each output is ON.
Tim
February 4th, 2004, 06:23 PM
Originally posted by Lancie1
he did say to:
"...make one input turn on 3 outputs one at a time?
Leave one on until the next one is turned on.
Do this without using osr or counter or timer."
He, "Guest" did restate his question. His original was a little confusing, but if you look at his other reply he states what he's actually after.
guest, forget about those SET,.. RESET, relays. USE INTERNAL RELAYS!!!
beerchug
Tim
anotherguest
February 4th, 2004, 09:33 PM
input start over first time on
---[]---------------[/]-----------------------------------------()---
| |
|first time on |
|----[]--------|
first time on input first time off
---[]---------------[/]-----------------------------------------()---
| |
|first time off|
|----[]--------|
first time off input second time on
---[]----------------[]-----------------------------------------()---
| |
|second time on|
|----[]--------|
second time on input second time off
---[]---------------[/]-----------------------------------------()---
| |
|second time off|
|----[]---------|
second time off input third time on
---[]---------------[]-------------------------------------------()---
| |
|third time on |
|----[]--------|
third time on input third time off
---[]---------------[/]------------------------------------------()---
| |
|third time off|
|----[]--------|
third time off input start over
---[]---------------[]-------------------------------------------()---
first time on second time on output1
---[]--------------------[/]-------------------------------------()---
second time on third time on output2
---[]--------------------[/]-------------------------------------()---
third time on output3
---[]------------------------------------------------------------()---
panic mode
February 4th, 2004, 10:04 PM
:D :D :D :D
I'll admit, I already got itch to post some code but anotherguest was faster...
beerchug
msinclair
February 5th, 2004, 11:22 AM
Since a couple of solutions are already posted (including some work from "guest"), here's a quick way to do what you want in an AB PLC.
For our guest learner, it shows a roll-your-own one-shot, and the importance of sequencing your instructions properly.
Replace B3:0/0 with "Input"
Replace B3:0/13 with "Output 1"
Replace B3:0/14 with "Output 2"
Replace B3:0/15 with "Output 3"
B3:0/1 and B3:0/2 are used for the roll-your-own one-shot.
Marc
dandrade
February 6th, 2004, 05:12 AM
IS EASY Sometime two lines work main.
-----------| |-----------------------------[ADD D1 K1 D1] It acumalator
---------| NF |-------------------------------[MOV D1 Y1]
Operation mathematics=> + - * / , it determine sequence
It aplieed, for control motors, softstarte, sequence ativation, selections, ....
If necessary the limitation output use mask and reset move ZERO to
variable.
To more SMALL impossible!!!
Good thinks
anotherguest
February 6th, 2004, 10:58 AM
output 1 output2 test bit
---[/]---------[/]------------------------------------------(B0)------
input BSL
---[]----------------------------------------------| |--
|File #B3:1 |
|Control R6:0 |
|Bit Addr B0 |
|Length 3 |
-----------------
first bit second bit output 1
---[]------------[/]-----------------------------------------()-------
second bit third bit output 2
---[]------------[/]-----------------------------------------()-------
third bit output 3
---[]--------------------------------------------------------()-------
JVPSUK
February 6th, 2004, 12:18 PM
I aggree with Bill, guests problem could have been solved using only relay logic, if everyone accepts that statement then simple logic gates (and, nand, or, nor) can solve the problem. I will not give the guest his answer right away, he should ponder a bit, but if he thinks in terms of his single input triggering o/p 'A', use a self hold circuit for 'A' along with inverted input, now you have a new set of conditions the next time the input goes high - o/p 'B' goes high, o/p 'A' goes low, think along those lines "guest". A PLC is just what it says, a logic controller. Jim.
Platootod
February 7th, 2004, 09:40 AM
Dear guest student
My answer is not PLC control but with control relay.
(I Hope all plcs's guy here are not mind)
Step by step or impulse switch can solve your problem.
If you learn RelaY DIAGRAM (Step by step or impulse switch )CIRCUIT
you can solve this problem very easy. Eventhough you have more than
10 ,30,50 steps ..only one input to control many output without timers , counter .. but a lot of control relays you need ..( The answer is yes ..you can do it but
non sense to pay for that ..)
Do you want to see example ?
If you need , I will post some picture for guide you next time
Platootod
Mechatronics RIT.Nonthaburi Campus :D
Platootod
February 8th, 2004, 12:06 AM
Dear friends,
I post some example picture for you ,but this is not the answer
only a guide for this question
This circuit was simulate by the constructor software from
www.koldwater.com
When press Sw . S2 first time C1 will on
When press Sw . S2 second time C2 will on
When press Sw . S2 third time C3 will on
When press Sw . S2 forth time C4 will on (C4 not bomb ha ha)
I hope "guest " can apply to his question as well.
Platootod
Mechatronics Rit.Nonthaburi :D
Platootod
February 8th, 2004, 01:27 AM
Dear "guest"
You can observe the circuit and change the condition depend on your's process.
If you need more step and the contact of a1(control relay) not enought just add more a1 no.2 , a1 no.3 ...etc parrallel with a1 no.1
Sawasdee Krub
Platootod:D
Sleepy Wombat
February 8th, 2004, 04:33 PM
And here's another way......
.