Modicon 984LL programming - packing a network to the max

TConnolly

Lifetime Supporting Member
Join Date
Apr 2005
Location
Salt Lake City
Posts
6,152
I've been working on cleaning up a Modicon 984LL program off and on for quite some time. It is not a program that I wrote but one which I have inherited to maintain.

The original programmer was quite "efficient" at packing every network as much as he possibly could, IMO, to the extreme detriment of program readability.

Here is one network that I was looking at a few minutes ago. You can see that there are three rungs of logic embedded in this network. The first employs some creative branching to get enough logical ORs fit in and the second steps into free space nested below the first rungs output, and the third is upside down (for lack of a better description) to fit it into the remaining free space of the network. Some networks in this program employ several vertical and horizontal shorts to stair step into a blank space in the network just to nest in a little more logic. Sometimes free space will be employed from a network that is far from related logic in the program, resulting is a badly spaghetti-fied program.

So I'm wondering, do many other Modicon programmers pack the networks like this, is it a common practice?

A080310-A.jpg
 
Last edited:
I've been working on cleaning up a Modicon 984LL program off and on for quite some time. It is not a program that I wrote but one which I have inherited to maintain.

The original programmer was quite "efficient" at packing every network as much as he possibly could, IMO, to the extreme detriment of program readability.

Here is one network that I was looking at a few minutes ago. You can see that there are three rungs of logic embedded in this network. The first employs some creative branching to get enough logical ORs fit in and the second steps into free space nested below the first rungs output, and the third is upside down (for lack of a better description) to fit it into the remaining free space of the network. Some networks in this program employ several vertical and horizontal shorts to stair step into a blank space in the network just to nest in a little more logic.

So I'm wondering, do many other Modicon programmers pack the networks like this, is it a common practice?

In the old 484 days, with very limited resources, they tended to pack them pretty tight. However, the Network you show is a little over the top. I did one like that once, just to prove it could be done. Then I divided it into three Networks so it was more readable, and easier to troubleshoot.

In my experience, it is not common practice.

Stu.....
 
Thanks Stu, that is kind of what I expected.

If you think that one is over the top there are others in that program. In all 132 networks are packed solid. Steps and notches to accommodate the packing are everywhere.

I'm not sure what the network limitation of a 984-685 is. Only about half of the available program memory is used. I'm gradually getting this cleaned up to make it more readable.

Bubba and Cletus hate it - they have a lot of difficulty following it.

A080310-B.jpg
 
I went back to the Modicon Ladder Logic Block Library User Guide. That says there is no limit to the number of networks in a segment. Also, start of network, beginning of column and horizontal shorts each take one word of memory while vertical shorts use no memory. Based on that, some of that tortured logic actually uses more memory! For example, the timer to coil 00345 in the first network has seven horizontal shorts, but would need just four columns in its own network for a saving of two words.

There were only two times that I maxed out the program in a Modicon PLC, a Micro 612 and Momentum with only 2K memory. I will admit to several projects that have two Compact 984 processors in one panel when the I/O exceeded the slot or work limit.
 
Mike,

As an experiment I took just the first four networks in the program and expanded them to seven and untangled the gordian knots, keeping everything to the left and placing coils at the solve column (where allowed by scan considerations) instead of adding shorts to move them right. Sure enough, my word usage dropped from 8963 to 8908.

When I showed the newly revamped networks to Cletus he exclaimed "Ah-ha, that's what that rung does!" Pretty much all of the maintenance techs consider the program to be unreadable.

My condolences to you for having to work with the Compact 984. 🍺
 
Last edited:
I turned off the display descriptions option for the screen shot otherwise the whole network won't fit on a screen. The program is documented and I've added a lot more to it since I took over the program. The readability problems aren't documentation problems, its the nonsensical packing of the networks and all the stair steps and offsets and resulting spaghetti code. For example, if you take a look at the bottom network on the last screen shot. It contains what would be four rungs of logic, although thats not completely apparent. It is especially non-apparent to someone who is not used to working with Modicon PLCs which is why our maintenance staff has so much trouble with it since we are mostly AB. On one of those output 00708 that is driven by a timer. Output 00708 and the rung driving it are not related to any of the logic anywhere near it. All of the related logic for that function is about 30 networks (about 100 rungs) away, but the original programmer had a piece of free network space here so he stair stepped and packed it in rather than leave some empty space in a network.
 
Last edited:
Heck, I am impressed you managed to get the entire Networks displayed. They are quite a piece of work. You have your work cut out for you to straighten that Program out. ;)

Stu....
 

Similar Topics

Hi, i have developed Analog Scaling using PCFL -FIN Block i don't have hardware , i want comments on Ladder pls help i need to deliver this...
Replies
3
Views
2,138
Everything was working fine, but suddenly CPU went into error mode, and the ERR and TER LEDs lit up. Now I can't download or connect with the PLC...
Replies
0
Views
45
Hello All, Was hoping I could get a little help with Modicon ladder logic. This is the first time I have seen Modicon logic and currently trying...
Replies
6
Views
271
I have a 170AAO92100 card that I am interested in using as a 10 volt output. Is there setup that I have to do in order to change output or simply...
Replies
0
Views
86
Hi, Seeking consultation on an implementation matter, and have a question about Modicon Compact 984 communication through RS485: Three Modicon...
Replies
4
Views
219
Back
Top Bottom