Common way people write programs.

I only have one little tipp, make it easy. My ambition is that anyone (with the right knowlage ofcours) should be able to sit down and understand the program right away since every minute of trouble shooting costs money.

+1 excellent tip. And that means not trying to get fancy by making the code as lean as absolutely possible. Use intermediate tags/addresses to break down large rungs to more readable simple rungs; the additional descriptors will tell a reader of the original designer's intent.
 
I work as a freelance programmer, so I make programs for a lot of companies.

I always make a structured program with descriptions for inputs and outputs along with rung + program part descriptions.

At the finish I will make walk thru of the program with the staff (maintenance) there have to take over the program, so I know that they understand the program and the way it is structured.
 
One trick I learned over the years (started programming in '81) was to use a AFI (Always False Instruction). Some PLC's (such as AB) have a device for this, and some (such as Mitsubishi) don't. I always used M0 in the Mitsubishi (as an example). If I had to change a rung, I made a copy (good old cut-n-paste) and put the AFI as the first instruction in the old rung thereby disabling it. I ten modified the secnd rung and let 'er go.
Always document your changes. I could never remember all of them. Too many different prpjects over the years. If everything worked well, you can always search for the AFI device and then delete the old rungs.
Lot of good sound advice in the other comments.
 
Longshanks
Mitsubishi have always had an "Always On" and an "Always Off" bit. These were M9036 and M9037 for the A Series but I do not know what the equivalents for the Q series are. The advantage of using these is that there state cannot be accidentally changed by an operator or maintenance guy.
 
One trick I learned over the years (started programming in '81) was to use a AFI (Always False Instruction). Some PLC's (such as AB) have a device for this, and some (such as Mitsubishi) don't. I always used M0 in the Mitsubishi (as an example). If I had to change a rung, I made a copy (good old cut-n-paste) and put the AFI as the first instruction in the old rung thereby disabling it. I ten modified the secnd rung and let 'er go.
Always document your changes. I could never remember all of them. Too many different prpjects over the years. If everything worked well, you can always search for the AFI device and then delete the old rungs.
Lot of good sound advice in the other comments.

This was a brilliant tip, i will surely use this one in my future programs :)
 
I also use always off and on bits quite often.

I usually have two rungs at the top of program. At first rung I made always off bit and on the second rung always on bit. You can't change their state accidently, if you make these rungs on program


always off = A
always on = B


---|A|-------------|A/|------------------(A)



---|A/|----------------------------------(B)




Lare
 
One trick I learned over the years (started programming in '81) was to use a AFI (Always False Instruction). Some PLC's (such as AB) have a device for this, and some (such as Mitsubishi) don't. I always used M0 in the Mitsubishi (as an example). If I had to change a rung, I made a copy (good old cut-n-paste) and put the AFI as the first instruction in the old rung thereby disabling it. I ten modified the secnd rung and let 'er go.
Always document your changes. I could never remember all of them. Too many different prpjects over the years. If everything worked well, you can always search for the AFI device and then delete the old rungs.
Lot of good sound advice in the other comments.


Just make sure that when you do this, you do not introduce a dual coil situation. Consider this example: Your old rung had an OTE (or OUT for AD guys) as the action that your rung was doing. Now make a copy of the rung. Make your changes to the top rung and deactivate the bottom rung with a never on instruction. If you save this to the processor, the output will never come on (in AD and AB SLC and Micrologix anyway) because the PLC will always evaluate the second rung as false and turn off the output. It does not matter if the first rung calls for the output because the second rung will always shut it right back off.

Brian
 
the changes I have been making is mostly timing issues where they want the product to move through the machine a certain way at a certain time. They are now happy with my program in which it does not look bad at all. Again thank you all for your help.
Sincerely:
Maintenance Man

When I worked in a 3 shift environment it was common for a shift supervisor to want the product to "move through the machine a certain way". Sometimes this was just a timer setting, sometimes it required a whole different subroutine to make it happen. Regardless they wanted it "their way" So what I did was setup personalized parameters that could be altered. The normal way to do this was by pressing the start button in a different way. A short press on the start button was the default (the way I found the equipment when I was hired). A long button press might be for John, 6 short presses might be for Tom. Any press on the stop button reverted it back to default. Sometimes I had to get creative and use some manual push button combinations that had no function when the machine was in auto. There was no spare I/O.

Each shift supervisor thought he was getting one over on the other shift supervisors. They even did things to help me with my job that they might not have done otherwise. That is until I committed the ultimate sin in their eyes: I told one of the shift supers that they could just use one of the other super's "personality mods" (he wanted the same thing as one of the other guys). Before that, each shift supervisor thought that they were the only ones getting individual attention from me for their "needs"!

 
Last edited:

Similar Topics

Good Afternoon , I'm sure there are many Ishida Muti-Head Weigh Systems . We have a Ishida CCW-M-214W Multi-Head system . We are...
Replies
1
Views
576
Hi, I am connecting an Autonics make stepper driver type, MD5-ND14 to a Kinco PLC (K205 series) this has a sourcing output which cannot be...
Replies
2
Views
1,128
I speculate that PLCs translate the language from programmers (e.g Ladder Logic, SFCs, Structured Text) into a common intermediate language...
Replies
15
Views
4,267
Good Afternoon , I have a Powerflex 70 Drive . It faulted out with a #12 HW OverCurrent Fault . With your experience , what is the...
Replies
5
Views
7,889
So I ran into something today that surprised and confused me. While troubleshooting a DC circuit I normally put one lead on a ground and probe...
Replies
6
Views
1,657
Back
Top Bottom