RSLogix 5000 ladder logic advice/tips/help

DarrenG

Member
Join Date
Dec 2016
Location
London
Posts
74
Hi folks,

I have a piece of code from my first project that I'm looking to improve a bit so am looking for some advice on how to do so. There's just one rung at the moment which is pretty simple; the level in the tank reaches 60%, 2 valves open provided the safety valve is open, one of the two pumps is latched on until the level reaches 80% then the valves close and the pump stops.

The reason I'm trying to improve it is because the valves and pump close and stop at the same time. This is only a 1" line so not much pressure or flow in the pipe but still. The first picture attached is the way it is currently and the second and third pictures are the proposed improvements. I try and avoid latch and unlatch bits if I can but I think it works here.

I haven't asked for advice on ladder logic before (I think anyway) so it would be interesting to see how other people would go about, what if any best practices you have to adhere to, can you see any issues with the improved version etc. I'm having one of those days where I'm just second guessing myself.

Thanks,

Darren
 
Which should come first? Stop the pump then close the valve? Or close the valve then stop the pump?

Whichever, I think when it is time to stop, I would stop the first one and start a one second timer, then stop the second when the timer times out.
Poet.
 
Oops sorry lads, one sec let me try re-post them. Don't know what happened there!
@Mad_Poet The pump is supposed to stop first otherwise you're pumping against a closed valve.

Right I'm having issues getting these pictures to work, tried .png and .jpg, don't know what's going on... bear with me.
 
Last edited:
OK, my resolution was too high, the max width has to be under 1440p and mine was coming out at 1527. These pictures should work now, sorry lads.

Tank transfer before.JPG Tank transfer after part 1.JPG Tank transfer after part 2.JPG
 
Now that you mention it I don't know why I don't have the .dn bit after the timer in series. I think I just did it that way once and have done it ever since but that makes things way easier for the starting/opening of the pumps/valves. I presume the attached picture is what you mean, how then would you go about shutting the valves and stopping the pump with a delay in between them?

The reason for the debounce on the 80% came from the way I was originally intending on ending the sequence. I had the pumps unlatching in parallel with a 3 second on-delay timer which would then in turn unlatch the valves. My worry was that the level might reach 80%, fluctuate back below 80 again before the 3 second timer had accumulated and lead to a possible situation where the valves would stay open.

in series.JPG
 
If you keep the Latch/Unlatch logic. You need to keep in mind the Route Between Tanks OK bit is in series in the original logic and therefore needs to be paralleled in the Unlatch logic. If this bit is not true then all stop.

Also the Selection bits do matter to start the pumps. But they are not needed to stop/unlatch the pumps. If the bit is off it will not hurt to unlatch it.
 
Debounce Timers are good practice and worth having. I just meant having too many timers in a sequence can sometimes make it hard to follow what's going on.

I've attached an example of one type of methodology.

You could also Latch the valve open and then Unlatch it after the pump has stopped for X seconds.
or you could use a TOF timer.
Just try to keep it consistent with the rest of the program.

Example.JPG
 
My feedback:
1 - I don't like inputs/outputs/inputs/outputs in series on a single rung. I find it easier to read inputs/outputs//parallel branch//inputs/outputs. Too many instructions lead to rung wrapping, making it even harder, especially us chaps on 15" 1080p screens, I feel bad for those having to run 720!! - Related to the image in post #8

2 - I_Hate_Long_Tagnames_With_Underscores. Use UDTs and use a naming convention like lowerCamelCase or CamelCase. Long_Tagnames_with_Underscores_lead_to_Inconsistencies (did you see where mixed of upper and lower caps)? I see this all the time!!

3. Eliminate the redundancy in your tags. V0220_Block.Valve_Open_OK, "V0220" already tells me it's a valve. "Block.Valve" doesn't add any value. "_Open_OK", isn't clear. Is this a an external enable condition that must be met? Or is that telling me no fault conditions exist?

4. V0211_Auto_Open should be part of a UDT. You are using one per point #3, why are you not including ".Auto_Open"? UDTs mean you'll be consistent and don't have to manually create to many tags. V0211.Auto_Open (Or V2011.AutoOpen)

5. "A_Start_PM0001", what does that mean? You should have another UDT. PM0001.Selected and PM0001.Start since you're referring to the same object.

6. LT0501.Output, I like how it is to the point, but "Output" on a level transmitter is a bit mis-leading as transmitter is an input to the PLC. I assume .Output is the value after some scaling, perhaps better to label it as LT0501.ScaledValue? Or LT0501.PV?
 
Last edited:
Been a bit busy the last few days sorry folks but thanks for the replies!

@cwal61 that's a valid point thanks!

@destination unknown Thanks for that example, it looks a lot tidier than the way I had it done so I think I'll do something similar to that.

@Paull's5.0

#1 I agree that rung wrapping is hard to read, in the original picture that I posted I had the sequence on just one rung and at the time I thought it was the easiest way of programming it without using latch/unlatch bits. I was only 6 months into the role at that stage though so that's why I'm looking to learn more and improve now đź“š

#2 Valid point, I referred to other existing projects that we had within the company for guidance when doing this project and that's just the way it was done in a few of them so that's where that came from.

#3 Again this is using a pre-made valve block that is used on other projects so I just re-used that. I see what you mean though, when I first started I was scratching my head a bit trying to figure out how some of the blocks worked but I've just gotten used to them at this stage. That Open_OK bit is feedback that the valve has opened and hasn't stalled mid-way.

#4 Yup what I could have used in this case is V0211_Block.Auto_Open or instead of calling the valve block V0211_Block call it just V0211 and use V0211.Auto_Open, again it's just the way it was done elsewhere so kept it the same.

#5 This is from a standard analogue block that's used within the company( as with the valve blocks), we've moved to using PlantPAX blocks predominantly now though so that from now on will be LT0501.Val which is a bit clearer.

I appreciate the feedback folks, always good to learn something new so thanks for your input :) 🍻
 

Similar Topics

How can I achieve the same functionality in Studio 5000? Image 001.png for the old RSLogix500 program Image 002.png for conversion to Studio...
Replies
6
Views
2,512
I don't think I'm going crazy.. Lately when I have multiple routines open in the ladder editor and I open another one my tabs at the bottom only...
Replies
7
Views
2,425
Hello PLCS.net! Here again to ask about how to do some weird quirky thing with RSLogix 5000. I see my team trending a lot of tags, but it becomes...
Replies
0
Views
1,541
Hello, Have aoi written in Ladder to pass in and out string variables. String VAriables that interact with PLC program are declared as InOut...
Replies
5
Views
4,259
Hello, I am in need of a solution to a problem I've failed to come up with a solution to that doesn't take entirely too long for my needs. I...
Replies
40
Views
15,703
Back
Top Bottom