Still Learning PLC But want to do it correctly

timk

Member
Join Date
Jul 2012
Location
Missouri
Posts
6
Hi all

I have become pretty good at making the plc do what I want it to. I am now looking for something that will help me write proper programs. It is one thing to make a machine work with a PLC but another to do make it run safely and reliable. I have found example after example of ladder showing how to make a motor run or a sensor work. But nothing telling how to make a complete system run. For instance, I have the following

It is a exit conveyor consisting of a lift using a rodless air cylinder with reed switches to monitor its position.
Once the lift is in its up position another rodless cylinder moves the box off the lift and onto a gravity conveyor. It also has reed switches.
Once the cylinder returns. the lift cylinder returns home ready for another box.

I also have 2 optical sensors 1 is used to detect a box on the lift to start the sequence. The other is positioned on the gravity conveyor to detect a almost full conveyor.

Is there some kind of standard way of tracking a sequence in a machine or do I just write code that works and comment it well. I just want to try to learn how write using industry standards if there are any.

Thanks for feedback
 
Industry standard? Hardly. Every user on this forum will approach the same problem a slightly different way ;)

"...write code that works and comment it well" is the absolute best approach you can take to start with. Then look at other people's code. Ask yourself why they did it differently, what pros/cons their method has over yours, etc. Is their method easier to follow? Easier to troubleshoot? Easier to manipulate?

If I were you, I'd get started as best you can on your system and when you make it work or get stuck, post your program on here and ask for comments. You'll likely get a lot of responses as to what you could do differently and why. Again, out of the first 4 responses you'll probably get 5 different opinions, but it'll make you think about it, and slowly over time your coding will get better and better :)

My 2c to get you started would be, start with a general "system start"/"system running" setup - examine all your start interlocks, and once they're all satisfied and your operator initiates a start with a button/HMI/etc, you activate your "system running" bit. Then use that in the controls for all of your other motors/pneumatics etc to ensure that everything starts and stops together.

Good luck!
 
Thanks I guess I was hoping for some kind of guidelines or rules for making a machine run. But I realize that all machines are different. I will study the traffic light program I am sure I can learn alot from it

Thanks again
 
The only hard "rule" I use when programing, is do not ever ever use a latching bit for motion. Such as using using a OTL bit to keep a motor running. I personally avoid latching bits when ever possible, but that is just my personal bias. Another guideline I try to follow is the KISS theory. Don't use 5 lines of code if 2 will get it done in a neat and orderly manner. And as stated above, detailed notations are a good habit to get in to.

Will.


Will.
 
timk,

the best advise I can give is this.
1. create a document briefly describing the machine operation.
2. expand on item 1 asking the question, how will the plc know when the operation is complete.
3. repeat the process and add outputs, analog.
4. step through the sequence from start to finish, if you have to ask any questions, then expand the document.

5. if you can ask any question, you need an answer to cover the situation. Bubba has lots of family.

6. ASK maintenance what they would like to see, what they are used to, work with them and show them your program.

REMEMBER ! maintenance is your best friend and worst enemy.
if you work with them and show them what your program does, they will do their best to fix a problem. IF you throw the machine at them and wipe your hands clean, the machine will never get fixed when there's a problem. YOU will be called at all hours of the night for the simplest of things.

When dealing with math, you have 3 conditions:
A < B, A = B, A > B. I got so fed up with one of the programmers I worked with I gave the boss an ultimatum, either Fred rewrote his programs and added a = b in his comparison statements, or I was going to leave. long story short, Fred rewrote 12 programs which no one could debug when the machine stopped in mid cycle.

regards,
james
 
Another tip:
Look at others plc programs.

Are they easy to understand what is happening - or will happen?

Are they well laid out?

Do they follow a logical order.

Are they neat small steps.

Do the comments make sense?

Find what you like in others programs and copy that style.
 

Similar Topics

What type of memory do todays PLC's use most offten?
Replies
10
Views
2,363
Why is the configuration IP different from the actual IP address still able to run normally?
Replies
6
Views
838
Just started working with some HART loops and I'm trying out Pactware.I'm using Krohne and it works just fine recognizing my modem. I downloaded...
Replies
9
Views
1,428
Square D had a group that wanted to develop PLC compatible power monitoring. They worked out of the Cedar Rapids circuit breaker plant - before...
Replies
0
Views
834
When a servomotor is stopped, are its three windings supplied equally with the same voltage value or close values? The servodrive is supposed to...
Replies
2
Views
1,406
Back
Top Bottom