My first program: comments & suggestions needed.

PhilipD

Member
Join Date
Nov 2009
Location
Humboldt, TN
Posts
117
Hi all,

First a little background information. I have worked as a maintenance mechanic for the last 15 years. In that time I have only worked in factories that make corrugated (cardboard) boxes. My education in this has been on the job training, a few classes in electrical, pneumatic, hydraulic and so on. I don't consider myself to be an electrician but I do feel pretty good about my skills in that area. I started with a new company last June and the electrical standards there are pretty low. I opened the box to one machine and my jaw just about hit the floor. It was a rat's nest of wires (none of them numbered), most yellow and many cut and spliced back together with another wire or two and held with wire nuts. The main disconnect rod has shorted against the terminal screw on several occasions. The third leg wire going from the disconnect to the fuses is burnt and the fuse is dark from heat. A red wire was used as a neutral wire on a relay and the neutral from an air valve solenoid is wired to one of the contacts on that same relay.

It's a nightmare! I am building a new panel (with many used parts) to replace this thing. My boss, who has only been there a few months more than me, wants to put a PLC in to control everything. I saw this as an opportunity for me so I have spent the last few months learning what I can about PLCs and programming. To this end I decided to use a MicroLogix 1000 1761-L32AWA. I have written a program for this PLC but I am asking you to review my program and offer any comments and suggestions.

Thank you,
 
I agree, excellent start and documentation. I also prefer simple rung programming over a complex one.
Here's just a little hint, nothing wrong with how you did it. Right click on the left corner of a branch to extend the branch down instead of adding a new branch (nested) under it.
Does the drive motor need to be running before starting the ink motor? If so, you might want to add some interlocks in the ink motor rungs. If the ink motor needs to run whether or not the drive runs then dont add make any changes to the ink roll rungs.
 
Last edited:
PhilipD,

Is this your second program, I seem to recall you posting something similar about a month or so ago?
Is this the same machine with the telemac? PLC, that you were looking at replacing?

Either way, looks good. I haven't analysed your logic, but does look easy enough to follow!
One tip, try and avoid the upside down 'ice-cream' hats for parallel conditions, can tend to get ugly pretty fast, IMO anyway... To negate this, right click on the 1st branch, and extend down, just looks so much better.... (y)

edit:
I see jrwb4gbm also highlighted the same thing...
 
Hi.
Another thing I like to do is to pick an unused bit to use as a placeholder. Then i make a rung at the top of the routine with this bit as the output. On a control logix just use the NOP bit.

For the comment of this rung I document the routine purpose. ie what I am trying to achieve.
ie in your case it may be something like

ROUTINE PURPOSE:
This routine controls the 3 motors assosciated with the ABC printer.
The motors are designated as
M1 (Rolls printer 2.4kw)
M2 (XXXXXXX)
M3 (XXXXXXXXXX)
Control of the motors is via a set stop/start buttons located next to the printing press and another set next to the supervisors station.


The next guy will thank you for it and in years time when you have 1000,s of programs under your belt you will be thankfull when you eventually have to re-visit the job.

Regards Alan Case
 
jrwb4gbm

Thank you so much for the tip on how to get the branch rungs to align. I tried several times to drag it into the correct position but they just wouldn't act right. Your tip was just what I needed.

The ink roll is independent (sorta) of the main drive. If ink is being pumped in then the roll needs to be turning to distribute the ink. If no ink, then the roll is off even if the main motor is running. This is because some boxes have printing on them and some do not.
 
PhilipD,

Is this your second program, I seem to recall you posting something similar about a month or so ago?
Is this the same machine with the telemac? PLC, that you were looking at replacing?

No, this is my first "real" program. I have posted one or two LogixPro exercises though. I did have a thread about another machine using Modicon PLC and I was inquiring about replacing them with a MicroLogix.

Thanks taking the time to comment.
 
Alan,

Thanks for the advice. This is some advice I plan to heed. I am a big believer in documentation and I can see where something like this can help jog the memory when I am old and gray. Or next week, whichever comes first.
 
Philip,

You are well on your way my friend! Good PLC programming comes from a desire within the individual to figure it out. Self-motivation is paramount: you cannot teach it! You also ask questions and are receptive to criticism from peers. With that said, I will get started!

- Paul

Rungs 1-2-3: I would wire the motor tripped inputs as on when not tripped. Then if the contact fails or the wire breaks, you will know. In other words it should be like a stop button: failsafe.

Rung 4: I would structure the rung a little differently, more like a relay-logic coil. However your method does the same thing. (When it comes to writing a program people can argue about how things should be done but as long as the program accomplishes the mission...) In any event, excellent documentation - no question it is easy to follow.

Rung 6: excellent rung comment. Three-position selectors can bite you on the butt if you don't know two inputs are from a 3-pos. switch. This has caused confusion for me before. I like that you point it out. When I was learning I was told by a Zen master PLC programmer: If you can say it, you can program it. This has never left me. You will always encounter people in a plant that say "Make it do xyz". My answer is always: "let's decide what you want it to do - tell me, and I will write it down so I don't forget." Then we get busy and at the end, I have it defined on paper and then the logic just flows. What you have done with your rung comment is say it. Excellent!

Rung 6: the motor tripped is the interlock for the output and breaks the seal-in. Very good - they have to restart it.

Rung 6: The ink roll has a stop input. On rungs 1-2-3 you did stop inputs to coils. I wasn't going to say it earlier but those coils on rungs 1-2-3 are redundant to the inputs. Especially if on rung 6 you are going to use the input instead of a coil.

Rung 8: another excellent rung comment where you have "said it" so now you can program it. What makes it go up? Ah, the default is up. See there - I have not seen your machine but your documentation is so good I could figure it out.

Just a few comments because I thought you'd appreciate them. It certainly appears as though your program is sound and would run "as is".

(y)
 
Very good for your first try. Its easy for me to see that you are someone that has taken the time to study this craft. Kudos.

The only change I can see besides the ones already mentioned is one of preference. Instead of B3:0.0 being START_PUSHED perhaps think in terms of RUN_ENABLED. A very minor thing but as programs get larger and more complex you may appreciate the terminology a little more.

I have to say though overall nice job.(y)
 
Excellent first program! I think that it will work pretty much "out of the box", and you've done a very good job of keeping things simple, and clearly documented. Good work!
 

Similar Topics

Dear all I have it working (please do not comment about the “box” Looking for your thoughts and comments and areas of “knowledge...
Replies
18
Views
5,566
Is there a way to merge comment from two PLC programs in to one for GX Works 2? I read from a PLC and got the code back with no comments, I then...
Replies
7
Views
6,080
Is there a way to do a mass copy of comments and tag names from one program to another? They are 100% identical, one goes online (uploaded from...
Replies
1
Views
3,149
Good Afternoon , I know this question was asked back in June. I am doing the process described by OperagHost below , but I don't understand...
Replies
2
Views
5,059
Have a machine that came in from Italy and the plc program in it was written in Italian. I went through a few months ago and translated a lot of...
Replies
4
Views
3,723
Back
Top Bottom