Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sequential outputs using flip flop control

Status
Not open for further replies.

davidvinch

Electrical
Nov 13, 2003
19
0
0
US
Hello, I am trying to teach myself plc's using the PSIM from learningpit and I have hit a brick wall with an exercise.
I am to light output 1 by pressing a start button (this stays
lit after I remove my finger )
then when I press the same button again output 1 goes off and output 2 goes on and stays on
then when I press the button again 2 goes off and three goes on
then when I press it again 3 goes off and 1 goes on and thus repeats.
I solved this using a counter and was told to try again using a flip flop.
This has me buffaloed as I know how to do a flip flop that turns on and off a single output but I don't seem to grasp the method to make a sequential output. Three days of hair removal and could someone give me a hand?
Thanx in advance
Dave
 
Replies continue below

Recommended for you

I understand your frustration but if someone here tells you HOW to do it then you will have missed a great learning experience.

Try to think of an application where you could use this function in the real world. My first thought was of a traffic light that is controlled by a (very bored) human instead of timers. Think Set/Reset and possibly positive edge triggers.
 
Is somebody having you on?

Either I don't understand the problem, or it's impossible.

A single flip-flop only has two states; on or off. The problem you're tackling requires at least three states. You need at least two flip-flops.

If you're allowed to use two flip-flops, you might consider how they can be arranged to form a counter.
 
Well I am still working on this problem every day and I think that I am either too old or too stupid to figure it out. here is the problem pasted directly from the psim introducory relay logic lab from thelearningpit. Remember that in psim there are no one-shots and since the problem was presented in chapter one titled relay logic I have assumed it must be solved with relays. I solved it weeks ago using a counter.I built relay logic to act as a one-shot and can get it to do two lights but not three. I am intrigued by the idea of using the relay logic I built to simulate a counter but at this point I think frustration has taken my logic-ability

1. Create, enter and test a program which uses a single switch (I:102) to control the operation of 3 lights (O:100,O:101,O:102) using the following sequence of steps.

Step#
1. when switch I:102 is first pressed, the first light O:100 will turn on and remain on when the switch is released.
2. when switch I:102 is pressed for the second time, the first light O:100 will turn off and the second light O:101 will turn on and remain on when the switch is released.
3. when the switch is pressed for the third time, the second light O:101 will turn off and the third light O:102 will turn on and remain on when the switch is released.
4. when the switch is pressed for the 4th. time, the third light O:102 will turn off and the first light (O:100) will turn on and remain on when the switch is released.
5. The sequence now continues at Step #2 above.


.
 
Sounds like a fun test. Can you use Set/Reset coils in this logic solver?

If you can you could use them to do what you want to do.
(1) Push the button (call it PB1), set a coil (S1), set another coil (S2). S2 controls the light. Between the button and the set you put a set of NC contacts that are tied to the first coil (called S1) so the button doesn't work for the first rung until the last rung Resets S1.

(2)In the next rung you put a 2 sets of NO contacts (S1 and S2 in series) between the button and the next Set coil (S3). Also use RST S2 to turn the first light off when the button is pushed.

This is incomplete and very sketchy but think about it and I'll bet you will come up with something. You're never too old....

Try something like that. You'll need to use number of Set/RST coils to do it but it should work. I don't know how to do ladder in posts or I would post an example.

If you can't use set resets write your logic to latch / delatch the outputs. It's doable. I wrote a quick test for an S7-200 and it works fine.
 
Here's a simple version using set/reset coils. It would be a little more cumbersome to write latch/delatch rungs but that would work too.

Here's a bigger version of the photo I posted below:


Merged-vi.jpg
 
I haven't figured out how to edit posts so I guess I'll write one more reply.

If Set/Reset isn't possible email me directly and I'll help you with the problem.

mikell@cvtv.net
 
Status
Not open for further replies.
Back
Top