This is my method.
For any given homework assignment or task at work, you must consider these instructions as the customers specifications.
1. read the specifications several times.
2. write down your understanding of what you read in a step by step fashion.
3. review what you wrote down and see if it makes since, modify if necessary.
4. step through your notes again this time, you are the one following the instructions.
In other words, you are the plc. Write down on paper the events you are doing.
For example, turn on hydraulic motor 1, write down hydraulic motor 1 on.
If a sensor is needed, write that down.
5. continue through the instructions. When you turn off the motor, mark a line thru it.
6. go through your instructions with all the sensors, motor aux. contacts, outputs
Documented. Modify if necessary.
7. repeat step 6 until no changes are made.
8. Try to group your data words into some organized fashion.
The more programs you write, the more organized you become
9. write the plc program using your notes.
10. install the program and leave in program mode if possible so you can to debug your i/o
11. Question for you, when is a machine and plc the most dangerous and why?
When it’s first powered on – when power is first applied to a machine, you don’t know
How things are wired. When you energize the plc outputs, you don’t know how things
are wired. When the plc is put into run mode the first time, it will do what you told it to do,
NOT what you wanted it to do.
12. debug the program.
13. DOCUMENT EVERYTHING!!!
you may remember things today, but in 5 years and hundreds of programs later, you won't
remember, so DOCUMENT EVERYTHING.
14. MAINTENANCE is your best friend or your worst enemy.
if you work with them and find out what they can do, write the program where they can
trouble shoot the program. they will be able to fix the problem and everyone will be happy.
BUT
if you write the program to where you are the only one who understands what is going on,
maintenance can't fix the issue, the machine is down, production is down, management hears about
it, your boss hears about it, then you hear about it - rewrite the program or else.
you get calls all hours of the day and night.
this still holds true, a machine can cost a billion dollars, but it's not worth 10 cents if
maintenance cannot trouble shoot the issue and fix the issue.
everyone has their own style of programming and you must develop your own way as well.
this is the best advice I can give anyone.
of others has more / better suggestions, feel free to post.
Also, program (1) always off bit and (1) always on bit to help debug your logic. One of each only. when you are happy with the code, look for those bits and see if they are in your logic. modify the program accordingly.
james