planning stage of the program

A few years ago, I had went to a weeklong Rock Well PLC troubleshooting class, in which the instructor had told us, that one should plan a program to get it working, then plan for the what ifs. How do you all feel about this approach?


From my experience, things that are done as an afterthought usually end up coming across as an after thought, if you know what I mean.

In the thinking and planning stage, by all means you start with what should happen, but you should be considering the what if's before actual code is written (at least in my opinion).
 
A few years ago, I had went to a weeklong Rock Well PLC troubleshooting class, in which the instructor had told us, that one should plan a program to get it working, then plan for the what ifs. How do you all feel about this approach?

Ahh! What Ifs = FMEA = Failure Mode and Effects Analysis in Six Sigma verbiage. Think of everything that can happen, what is its likelihood of occurring, will you even be able to sense it, and what is the outcome if it does happen. Probably one of the most important items you can do in the planning process as you want to make sure everything fails safe and and there are no possibility of a catastrophe. The items you come up that are highly rated are also things you need to check during verification so that you know the program can handle all all of these without depending on an observant operator needing to hit an Estop. (Is an "observant operator" an oxymoron? ;) )

Google "FMEA" if you want to learn how to apply this methodology.
 
With FMEA, at some point enough is enough. FMEA methods will help you find everything and get it prioritzed which is very useful. You want to be able to sense and fault and take action for all the important things, no doubt, but it easy to get carried away with alarms, and wise to filter and sometimes prioritze them. Example: If an e-stop condition removes power from a whole array of sensors which will generate nuiscance faults, filter those out with RLL.
 
To help me become a better programmer, I would like to know if any one could be a mentor ? I just want to be able to plan programs to get better at my job. Thank you all for your help.
 
A programmer mentoring plan would be awesome! As a new programmer you just end up with so many situations where bouncing a few things off of someone to nudge you in the right direction would be so beneficial.

I also thought having a section with little mini tutorials for us new guys would be awesome too. Just a quick explanation of a concept followed by a programming assignment that could all be cataloged away somewhere would be great for lots of us.
 
Last edited:
"I want to take what I put on paper and have it work in the program the first time with minimal changes."

I almost lost a mouthful of Pepsi right there.

"I would like to plan my next vacation so nothing goes wrong."



OK seriously, while all the previous quotes sound similar to me, there is some value to planning.

Accept that most of the time you spend planning is wasted when the basis of your plan is significantly changed.

I have been asked to get started on the program before the hardware is finalized several times. That was fun.

I read and re-read the spec multiple times and ask the designer for details and more information until I think I know exactly what is supposed to happen in each area of the machine. Week one sees very little if any code.

Then I think it over and organize a simple structure of the over-all project. I usually do this in my head, some people use EXCEL or a charting software to make a flow chart of the process. All this might help you think about the flow, but most of it will be wrong as you start programming. Again, do these steps with the realization that none of this is intended to be perfect, it is a general plan.

Then Define all the I/O, some people do this in EXCEL or WORD, I do it in the hardware config where I only do it once.

Then I go back to the spec.

I blow it up and pull it apart into sections on 11X17 and pin it to the wall.
I write some general flow control code and set up a skeleton frame work.

Then go through and define some datatables to hold data in a reasonable structure that works for each section.

Now study some specific issues in each section. Identify things that might be used in several sections. Think big and write small re-usable modules of code. I like making LEGO code. I could write something specific to each section, but with a few variables and some parameters, I can write a section once and re-use it.

Make yourself a library to stop the copy paste of code.

After I write the LEGO modules to solve some of the tricky parts, it gets easier to plug the modular blocks into the skeleton. I will spend a week on one function if I can re-use it more than twice. After two or three re-uses, the investment pays off big.

About this time the boss shows up with a new spec. You know you are on the right path when you just smile and re-arrange your blocks.

I have written ONE small example program that I wrote out in 20 minutes or so and it worked the first time with no edits.

I would not expect this to happen frequently with a program of any real complexity.

Over all a flow chart is a good visual aid. Add a lot of white space so notes can be added to it as you go.

The added benefit to something like a flow chart is that non programmers can look at it and follow along. And some people ask for a flow chart as part of the documentation. Then you can just clean it up and give them a copy of yours.

But while all the ideas on this thread are great advise, you have to find a system that suits your mental process and the tools you have on-hand.

You might want to spend a few minutes after each project to re-think your approach and give yourself some feedback on what worked and what didn't.

Anything that was difficult, should be smoothed out so it is easier next time.
 

Similar Topics

We plan on having a stationary panel with a PLC , 3 Powerflex 527 drives , with the incremental encoder from the motor to the encoder option card...
Replies
4
Views
3,466
Hello to all, There are few investments on the way soon. I need to do planning of cost effective but reliable solution. I need to have redundancy...
Replies
7
Views
7,306
I begin a topic with the objective of collecting, and discussing the diverse ways programs are written or structured. If you have any comments or...
Replies
2
Views
4,241
This may sound absurd, but i would like to know the basics of how to start a project and go thru regular steps to complete it. When my Manager...
Replies
2
Views
5,496
Hi everyone! These days, I'm using integer-driven sequencing to run my state logic. My current program is an update on a Micrologix 1200, with...
Replies
13
Views
9,783
Back
Top Bottom