Colt Hero
Member
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?
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?