RSLOGIX 5000 Choosing from 4 tanks based off level to open a valve

CollinRudy

Member
Join Date
Apr 2018
Location
Avon, MN
Posts
2
Hello,

I am trying to choose from 4 different tank levels (REAL) and choose the greatest number (highest) and set that to open that tanks valve to issue out of the tank.

I've done this between two tanks many of times, but 4 different tank levels has me confused.
 
With only 4 tanks , just do as you did with 2 tanks, but add the additional 2 tanks in the comparison. So, compare 1 to 2,3,4, compare 2 to 1,3,4, compare 3 to 1,2,4, and compare 4 to 1,2,3. In the rare event that the tank levels could be equal vs greater, you may want to handle that more gracefully.
 
Update: this is basically what Jlandverlen is suggesting]


Brute force with a deterministic way to break ties*; probably the easiest to understand.

* consider carefully the distribution of GEQ vs. GRT.
highest_of_4_long.png
More concise yet functionally identical logic, with the GRTs of the brute force approach above replaced by XIOs; arguable a bit more opaque and/or requiring a bit more thinking to understand.
highest_of_4.png
The key thing to remember for both of these approaches is that PLC programs are all about time:

  • i.e. when does the PLC look at and/or assign the value of each bitbox.
  • left-to-right and top-to-bottom evaluation mean left before right in time, and top before bottom in time.
 
Last edited:
Also, once you open a value to feed from a Tank will you ignore this logic until the fill operation is complete or will you switch to another Tank if it becomes the Highest?
I would guess you will "lock-in" the Tank that the logic selects as the highest level and use it until the filling is completed. If you do not add the logic to lock-in the tank selection you can be flipping back and forth until the fill is completed.
 
Update: this is basically what Jlandverlen is suggesting]


Brute force with a deterministic way to break ties*; probably the easiest to understand.

* consider carefully the distribution of GEQ vs. GRT.More concise yet functionally identical logic, with the GRTs of the brute force approach above replaced by XIOs; arguable a bit more opaque and/or requiring a bit more thinking to understand.The key thing to remember for both of these approaches is that PLC programs are all about time:

  • i.e. when does the PLC look at and/or assign the value of each bitbox.
  • left-to-right and top-to-bottom evaluation mean left before right in time, and top before bottom in time.

My approach would be the same - but I would probably add a hysteresis timer for each one so that it would pump for X amount of time before switching to the other tank. That way I'm not hitting a bang-bang situation between 2-4 tanks when they get to be the same level.
 
My approach would be the same - but I would probably add a hysteresis timer for each one so that it would pump for X amount of time before switching to the other tank. That way I'm not hitting a bang-bang situation between 2-4 tanks when they get to be the same level.


Definitely thought of that, but out of scope for the original post.

Better to hear the story of the OP watching the logic cycle maniacally through all of the pumps when all levels get to equal and come back here in a panic :ROFLMAO:.

(But that will not happen: if they have done this for two tanks, they have already been through that scenario ;))
 
like this:

ESELECT.png
 

Similar Topics

Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
2
Views
156
I am completely stuck on building a ladder program that requires a start button to be pressed 3 times to turn on motor 1. Then motor 2 starts...
Replies
20
Views
577
First off, I'm a hobbyist-level programmer, and this program isn't controlling anything anything that could even remotely be considered "life...
Replies
18
Views
517
Hello all, I have a question in regards to RSlogix 5000. I am having issues with the program force closing when I try to make online edits. We...
Replies
0
Views
119
Back
Top Bottom