Really desperate again I need alot more help

vixen4u

Member
Join Date
Jun 2006
Location
Pennsylvania
Posts
34
Hello as some of you may remember I was a new student to PLCs and the teacher was not doing a good job of teaching the class. So update on situation. We have passed week 4 and we still do not know what the heck we are doing. The teacher taught 2 chapters in 5 minutes yes I said 5 minutes. He said we can learn this just by doing the exercises and reading the book. Sounds like cybertazs teacher. Ok now I had to choose a project to do for this last quarter and I chose to do a simon says game (sounds not so bad) no one has ever done this in my school ever. My problem is I have no clue on where to start my teacher is having hard time helping me especially because he has never seen the program for something like this I even had to explain to him what a simon game was. We are using Allen-Bradley SLC500 with 12 inputs and 8 outputs that is all we know about the PLC we are going to be working on. Oh we only have 7 weeks left and no one has been able to start there projects at all, we are all in the dark. I was so excited about this project because I would be the first with this project. I know it is not an easy one that is what the teacher wants a medium project that I have to build. building it is the easy part. I just need to know where to start I have read the book and look online for hints and tips and clues, but nothing is making any sense. I read cybertaz I cant even make sense out of his and we are using to different PLC. I am so scared with this class this project will decide if I graduate or not. I have been breaking my back trying to figure all this out. we cant even program a traffic light on the exercises we have. :( I just need really guidance I do not have the option of changing classes or getting another teacher we have what we have. We can not complain to a dean it does not good we have to try to make this work. I just dont know what to do first. I dont know what to program first.

Thank you all
 
I even had to explain to him what a simon game was

Hello vixen;
There is the key to your design; you have to explain what you plan to do, in successive stages.

First, write down what the game should do (look like). In general terms, simple but clear. Rlues, limitations, exceptions.

Then write one instance of the game, one example of what the sequence of events should look like.
For example (since I have no idea what you mean by a simons says game on a computerized environment, I am making this up as it goes along):
[I close switch 1 and switch 7;
after 5 seconds outputs 1 and 7 light up for 2 seconds;
I open swithch 1 and switch 7, causing outputs 1 and 7 to flash for 2 seconds; game can continue...
BUT if I close any other switch then all outputs flash for 10 seconds and the sequence is reset]

Then write down another... just to make sure all the rules aree evident in future code.

Once you have a grasp of the basic sequence, try transfering one sequence ic ladder code;
Modify the code to take into account all possible rules (tough part).

Once you have somethiong going along these lines, you can alweays come back to us for coding help.

Hope this helps,
Daniel Chartier
 
Simon Says will be a bit more complex than a traffic light. Online version here.
1) Define inputs. Red, Blue, Yellow, Green, Go, Reset.
2) Define outputs. Red, Blue, Yellow, Green, Correct, Wrong.
3) Write a flowchart of the logic. Generate random number. Output sequence. Test inputs. Display Correct/Wrong. Next sequence.

To generate the random number, get a byte from the clock. We need a number 0-3. Byte will be 0-15. Do a test to divide it down.
A) If Byte>11, divide by 4.
B) If Byte>7, divide by 3.
C) If Byte>3, divide by 2.

Load numbers into shift register by shifting them in 1 at a time. Read out shift register to display the number, then use this same sequence to test for proper answer.
 
If you are still set on making a Simon Says game, then for the purposes of this exercise I would suggest a modified version of the game. Don't bother with trying to make a random light sequence. Go for a fixed sequence and limit the sequence in length to perhaps only five or six levels. Granted its not a very challenging game like that, but the program itself will be challenging enough for a beginning student.
 
From how it sounds regarding your level of teaching and the apparent vagueness (is that a word?) of the instructor I would wholeheartedly agree with Alaric. A simon says game is a tall order for someone who's just beginning with PLC's.. even forgetting the 'random number' generation part which, as a topic, has had several books written about it itself.

A hard coded set of sequences would be the best. In fact, if done like that, it is basically a slightly more complex version of the traffic lights program...

Good luck..
 
Ok I will see what I can figure out. It is hard we have not even covered shift registers and sequencers yet. When we get to that chapter in class I will be asking alot of questions about them and trying to figure them out. I am reading the chapter now I have had no luck teaching myself PLC might be because of the other 2 class we have that has been taking all of our time. Do let anyone tell you that economics online is a good idea (its not). I will come back and let you know my progress if any I was able to make with this project.


thanks for help
 
vixen4u said:
It is hard we have not even covered shift registers

If you are not getting what you need out of the class (obviously not or else you would not be coming here) then try learning on your own http://www.plcs.net/contents.shtml this has a lot of the basics and there are some other good learning tools out there...

There are two reasons for hiring your education 1st being degree (papers) 2nd being knowledge...get the degree from the school that you are going to..get the knowledge from here and/or other sources..

I am somewhat set in my career...I will probably not to and further my "papers", but my education will never stop...

My point being...Don't get to hung up on the details of your classes, get what you can get and move on (but take it all)..you seem like a smart person, there are many places that you will learn from..

Good luck
 
I currently own the book that is sold on this site by phil Melore. The problem we are facing is that there really is not teaching. I mean I can read the book till I am blue in the face without any really contact with the PLC we are all lost. I know what I want my project to do and I have played with in on the simulator. I know how to get lights on and off using switches. I can make a garage door open and close on simulation. Those are all easy. The teacher did not want use to pick a project that was easy. I know I need a timer, counter.

Player pushes on
after on is pressed a random color will lightand then waits for player.
The player must then repeat by pressing the coresponding color.
If player is correct the sequence will increment 1 and then first color will light again and a new color will light following that.
The player then must repeat the pattern correctly.
If the player does not repeat the color correctly game is reset.
To reset game press reset
To turn off press off.

Like I said I know how to get the lights to light if I press a button that is the easy part. I am trying to understand shift registers and well trying to crame alot in my head really really fast. I need this to graduate is what is the hard part. In my head I can see what the game does but the problem is getting it out of my head and figuring out how to get this into ladder logic.

I know by the end of this class I will be bald. This is what I get for trying to do something different. For 4 years this branch has been open and every last quarter the projects always done is a traffic light or silo. I needed something with so many inputs and so many outputs. I must be crazy I have played with the plc simulator we have and following the book for example to understand how it works.

thank you all for help I am still reading and still burning my brains cells over this.
 
Vickie,
I must be crazy I have played with the plc simulator we have
Which PLC simulator do you have available? If it is LogixPro, then I can help you with that.

The fist step is to create an outline, or summary of how you want your program to work, keeping in mind that you have only 8 Outputs. So, you have 4 colors, then assign Color 1 to Output 0, Color 2 to Output 2, and so on. If you have different colors of pilot lights in your school lab, then use those. You can also wrap some different colored paper over lamps to make it easier to see what colors are lit.

It appears that with the project that you have outlined, you will need to create a "random number generator" to select the next color. That should probably be the next part that you tackle. If you get that working, the rest will be mostly "one step follows another" type of programming. Many methods for creating a random number in a PLC have been posted here on this site.

Do not use any of your Outputs for the random number generator. That should all be done using internal contacts and of course other internal math functions. Keith's method above is much simpler, merely using the built-in clock bits in Status Word S:4 (that are not really random, but close enough for what you are doing). Here is the first rung that will create a pseudo random number from 0 to 15:

Simon.jpg


 
Last edited:
dchartier said:
... in successive stages...
Then write one instance of the game...

Once you have something going along these lines, you can always come back to us for coding help.

Hope this helps,
Daniel Chartier
You're trying to figure out the entire program all at once. Take Daniel's advice. Write a tiny version of the program and test it.
Forget about the random number and shift register for now. Do a single light first.
1 output, 3 inputs. Inputs are Go, Blue, and Red (or whatever the colors are).
Go starts the program, flashes the light, waits for input. First input results in Win, second input results in Loose.

Now you have a "working" program. Grow it from there, learning one new function at a time. Shift register, random number, growing sequence from 1 to six lights. Nobody said you have to do it exactly like the Simon game. Forget growing 1 to 6 lights. Do a fixed version with 4 lights. That keeps your shift register a fixed size, which is more realistic for the real world.

Nobody writes an entire program in one shot. We do it in stages, and test them before moving on to the next step.

Edit - Lancie was writing while I was. There's your random number and first rung! Take it from there (divide is next)
 
Last edited:
Here might be a simpler idea, 0-to-3 PSEUDO random number in one rung:
Simon3.jpg
 
Last edited:
we have a logixpro simulator I have played with it alot. I know how to use a switch to turn on the lights that is easy. I had planned on using a a input for each switch and a output for each light so it would be 4 inputs and 4 outputs.

I will be working on this later today will let you all know how I make out.
 
Yes, you will need AT LEAST 4 inputs and 4 outputs. You probably will also need at least a couple of additional "control" inputs, as Keith described earlier, to START the Game, and to RESET the Game.

In your LogixPro simulator, type in the above program and watch it randomly select a color each time you press the button. The MVM (Move with Mask)command and the S:4 clock word are not random, of course, but the randomness is caused by the fact that you will not press the button at the exact same point in the time cycle. I tested it for 50 times, and it come up with from 10 to 15 selections for each color. That should be close enough for a random color selector.
 
Last edited:
I suggest the following game rules and Input/Output List. I used Red for Error, because that is a fairly well-accepted design rule and follows generally accepted practices.


Rules for Simon Says, PLC Version
The Player pushes the “On” pushbutton. After “On” is pressed, a random color will light, and then the PLC waits (for the player to make the next move). The player must then repeat by pressing the corresponding color. If player presses the correct pushbutton, then the sequence will increment to the next step, and the first color will light again. A new color will light following that, (until all four colors are used).


The player then must repeat the pattern correctly. If the player does not repeat the color correctly, the game is reset. To reset the game, press the Reset pushbutton. To turn off, press the Reset pushbutton. Also the light colors generally follow the wiring color codes.



I/O List

Input Desc. Connected to PLC Input

On (Start Game) I:1/0
Yellow Pushbutton I:1/1
Green Pushbutton I:1/2
Blue Pushbutton I:1/3
White Pushbutton I:1/4
Reset Pushbutton I:1/5

Output Desc. Connected to PLC Output

Error (Blinking Red) Light O:2/0
Yellow Light O:2/1
Green Light O:2/2
Blue Light O:2/3
White Light O:2/4
 
Last edited:

Similar Topics

Local Rockwell distributor was in today. He says that the MicroLogix 1400 will likely be unavailable to purchase sometime around the end of this...
Replies
58
Views
16,740
Good Morning , I've taken on a job that is truly over my head with a engineering group. The standards of Rockwell programming is much more...
Replies
15
Views
7,098
I’ve been looking at buying a quantity of signal converters to take a type J or k thermocouple or RTD and convert it to a 4-20mA signal. In...
Replies
10
Views
3,013
Doing some consulting work using factorytalk view studio and RSLogix5000. We set up alarms for the system a while ago and they work fine, as do...
Replies
5
Views
3,663
I spent the entire day trying and failing to setup my 1783-NATR. It appeared, time and again, to be correct and happy but no matter what I did...
Replies
11
Views
5,067
Back
Top Bottom