ControlLogix5000: Program Structure

Colt Hero

Member
Join Date
Apr 2015
Location
USA - Southeast (but from Northeast)
Posts
109
OK, (some of) you guys know by now that I'm not a PLC programmer, so I'm not really familiar with how a well-structured PLC program is typically put together. I *do* know, however, that no matter what platform, programmers develop their own style over time and kind of refine things for improved efficiency and clarity. So I was hoping to hear some of your ideas so I can avoid the ugly stuff that might otherwise happen

Today's question is about general "Program Structure".

Is it good practice to just put all 'like items' into their own routines then link them to the rest of the program via "bits"?

So - all Devices (motors, valves, etc) in a "Devices" Routine. All I/O in an "I/O" routine. All Alarms in an "Alarms" routine, etc.. All Buttons/Keys in a "ButtonsKeys" routine. All PIDs in a "PIDs" routine?

The upside of this would be that it would look very intuitive to someone looking at it for the first time trying to find stuff. But then I'd need a bunch of bits to link these things to the rest of the program, right? Is that acceptable?

And how about I/O? I'll use AOIs to bounds check and "clip" as necessary, but what should I do for under/over range errors when they occur? I don't think we need to put up alarms, but maybe *count* the errors and put this on a Maintenance Debug display somewhere?
 
OK, (some of) you guys know by now that I'm not a PLC programmer, so I'm not really familiar with how a well-structured PLC program is typically put together. I *do* know, however, that no matter what platform, programmers develop their own style over time and kind of refine things for improved efficiency and clarity. So I was hoping to hear some of your ideas so I can avoid the ugly stuff that might otherwise happen

Today's question is about general "Program Structure".

Is it good practice to just put all 'like items' into their own routines then link them to the rest of the program via "bits"?

So - all Devices (motors, valves, etc) in a "Devices" Routine. All I/O in an "I/O" routine. All Alarms in an "Alarms" routine, etc.. All Buttons/Keys in a "ButtonsKeys" routine. All PIDs in a "PIDs" routine?

The upside of this would be that it would look very intuitive to someone looking at it for the first time trying to find stuff. But then I'd need a bunch of bits to link these things to the rest of the program, right? Is that acceptable?

And how about I/O? I'll use AOIs to bounds check and "clip" as necessary, but what should I do for under/over range errors when they occur? I don't think we need to put up alarms, but maybe *count* the errors and put this on a Maintenance Debug display somewhere?


Routine structure depends on the customer for me. I was working at a coal plant recently where every "unit" (essentially every motor) had its own routine, say a conveyor may be Unit 1000, so there would be a routine called "U1000" with all of the associated I/O inside. Other programs I've worked on might have different processes in a routine, such as oil level detection in one routine, alarms/trips in another, etc. I did quite like the program at the coal plant, as it made it easy to troubleshoot each piece of equipment. You could go into each routine and see that it lost its permissive to run because a downstream pump tripped, or there might be a permissive only allowing it to run if the belt scale of the plant feed conveyor was measuring over a certain tons-per-hour rate.


Again, it really depends on the processes that will be present in the program, but certain situations may lend themselves to one way or another as far as structuring your routines goes.
 
Some larger clients have defined what their program structures will be. Most have not. I have worked with folks that like everything from one area all together. Others like you mentioned. Motors in one routine, analogs in another, etc... It all depends on the programmer, the application and what the client desires.

But at least have a structure. I have worked on old PLC5 systems where everything in in Ladder 2, thousands of rungs with no clue as to where anything is located.

PS
I do recommend you have periodic task for PID loops, more than one if you need fast and slow loop update times.
 

Similar Topics

Good day everyone. if you have a logic for 3 pumps (lead/lag/off), would you please email it to me? I really appreciate it!
Replies
7
Views
179
Looking to see if anyone has setup a ControlLogix Via Ethernet to a Omega Temperature controller CNi16D33-EIT-AL. Omega sent me an i-Server users...
Replies
0
Views
964
Can a ControlLogix PLC communicate over Ethernet using TCP/IP? I need to interface to an existing (proprietary) system, sending TCP/IP 'frames'...
Replies
12
Views
4,128
Sorry for these very basic questions, but I'm not a PLC programmer (per se): It appears that timers always seem to appear at the very end of a...
Replies
28
Views
10,396
If I define an INT or DINT for, say ... a BitFlag word ... is there any way to name each bit in that flagword with a unique name? It would seem...
Replies
17
Views
3,911
Back
Top Bottom