Sign in to follow this  
Followers 0
Guest inothome

AB Ladder Logic for a pump station.

6 posts in this topic

Hi, I am new to this and I wrote a small program to control two pumps. I need some input as to how it looks, good, bad or what should be changed. This is the first code I have written, so bear with me. I have no formal training, just 'reverse engineering' other code and plenty of reading. What it is controlling is a wetwell level, the PID is controlled by a Honeywell unit, so basically all this is doing is determining how many pumps and at what levels to turn them on and off and how many pumps to have runnning.Both pumps run in parallel based on the output of the Honeywell PID controller(when two pumps are called for). All permissives are handled locally at each motor's PLC, so they are not vital in the code here, just for alarming only. I have an Automation Direct touch screen that is used for the operator interface. All set points are able to be set from the touch screen. Anymore info needed post you question. Thanks for your comments(go easy please). EN MSP_1_BASE.RSS Edited by inothome

Share this post


Link to post
Share on other sites
I wish my first ladder program had been this good. I've attached a version with a few minor mainly cosmetic changes, mostly relating to the use of extended branches. There are three advantages to using extended branches: 1. They are more compact and read easier in the ladder window. 2. They scan slightly faster. 3. There is no nesting limit. Without knowing more about the application it is hard to suggest more changes, and although if writing it from scratch I would have used a different programming style, what you have here for this relatively small application looks perfectly serviceable. MSP_1_BASE_PW.RSS

Share this post


Link to post
Share on other sites
IF there is no limitation to nesting in the program is there a functionality limit in nesting that you like to follow?I am writing a program that has 6 nested loops, is that reasonable?

Share this post


Link to post
Share on other sites
There seems to be some confusion between "Nested" and "Extended" or "Parallel" branches. I have attached a print out from the help file from RSLogix 500. A maximum of 4 "Nested" branches per rung. A maximum of 75 "Parallel" branches per rung. I hope this helps Branching_Instructions.pdf

Share this post


Link to post
Share on other sites
I am using parallel branches, I should have no problems. Thanks

Share this post


Link to post
Share on other sites
Old thread with a new question. Branching is controlled by actual instructions that are compiled into your PLC program. Parallel branching is controlled by a single instruction for each branch, NXB, plus a single BND instruction to terminate all of the branches. Nested branching however requires a NXB + a new BST and BND pair for each branch plus a terminating BND. All of these extra instrucitons require processor overhead and unnecessary stack manipulation.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0