Processing different enabled tanks during cycle.. programming help

Snap25

Lifetime Supporting Member
Join Date
Dec 2014
Location
Michigan
Posts
237
I have 3 tanks that i want to be able to enable and disable while the system is continuously running and alternate through each tank that is enabled at the beginning of a new cycle..

Whats the best practice to get this done? Does anyone have anything like this in a program I can take a gander at to learn from?

Thanks
 
Wow that is a pretty open ended question. Can you tell us more about your process? What happens when you "enable" a tank? What happens when you "disable" a tank? Do you open or close a valve? I think we would need to know a lot more before anyone could be able to offer any real help.

Also if you can tell us what kind of PLC you are using. How will you disable/enable a tank? Do you have a HMI that a operator will use to select the tanks? If so what brand and model of HMI. All the details will help.
 
Wow that is a pretty open ended question. Can you tell us more about your process? What happens when you "enable" a tank? What happens when you "disable" a tank? Do you open or close a valve? I think we would need to know a lot more before anyone could be able to offer any real help.

Also if you can tell us what kind of PLC you are using. How will you disable/enable a tank? Do you have a HMI that a operator will use to select the tanks? If so what brand and model of HMI.the details will help.

Its a project I'm doing in my basement. I'm simulating a continuous filtration unit that will draw from 3 different tanks and return the filtered liquid back to the same tank it was drawing from. I will either use wonderware or just build a basic control panel with a few selector switches for auto/man , on/off and toggle switches to enable the tanks I want to run.

When i enable the tanks I'm basically saying that its okay to open up the feed and return valve for that desired tank. BUT.. here is my problem im trying to figure out.. Just because I enable it doesn't mean I want the valves to open right away..

Say I have the 3 tanks enabled and I turn it to auto mode. I want it to start with tank one.. open the feed valve, return valve, and pump. Run the cycle then switched to the next enabled tank. Now it switches to tank 2 and does the same thing and so on... I think I'm explaining this right?

I don't need help with the whole program just need some guidance on cycling through different enabled tanks to filter..
 
Ok I think I understand. Sounds like a simple process. Here is some ideas:

The feed and return valves should have open & closed limit switches. Those switches should be inputs to your PLC

When you start the sequence all the valves should show closed.
You then issue commands to open the valves for tank 1.
When both valves show open via limit switches you can start the pump. I assume the pump will run for a certain amount of time.
After that amount of time, shut off the pump and command the valves closed.
Once the valves show closed move on to tank 2 and restart the sequence.

You can add alarms for valves that don't show open or closed after a certain amount of time after they are commanded to open or close. You can add alarms for filter that gets plugged via a DP switch. There is a lot of stuff you can do here. If you use Wonderware it will give you more ability to show your alarms.

Hope this helps get you going.
 
Ok I think I understand. Sounds like a simple process. Here is some ideas:

The feed and return valves should have open & closed limit switches. Those switches should be inputs to your PLC

When you start the sequence all the valves should show closed.
You then issue commands to open the valves for tank 1.
When both valves show open via limit switches you can start the pump. I assume the pump will run for a certain amount of time.
After that amount of time, shut off the pump and command the valves closed.
Once the valves show closed move on to tank 2 and restart the sequence.

You can add alarms for valves that don't show open or closed after a certain amount of time after they are commanded to open or close. You can add alarms for filter that gets plugged via a DP switch. There is a lot of stuff you can do here. If you use Wonderware it will give you more ability to show your alarms.

Hope this helps get you going.

That sounds easy enough, but that involves me spending more $ that I would rather not because my wife would kill me!

There has to be a way to alternate between different "enabled" tanks in the program? Filters for x amount of time then scans for the next enabled tank.. if there is only one tank enabled it will just restart the cycle with that tank..

I feel like I'm close and I get excited then it doesn't work! I will eventually figure it out one way or another.
 
Do you have a sequence that works with all 3 tanks already? If so try thinking of the enable as a bypass instead. If the tank is on bypass (or disabled) use that information to skip the cycle for that tank and move to the next one. If only one tank is not on bypass then it will just repeat that tank over and over. Another fun exercise would be to have a continuous mode or single cycle mode.
 
Scameron81 is correct. That is a good way of thinking about it.

Do you have a pump for each tank? I was thinking there was only one pump. If you have a pump per tank then you don't really need the valve limit switches.

If you have a pump per tank, here is how I would sequence it.

Pseudo Code:
IF tank1 enabled start pump
else move to tank2
Run pump for X amount of time
Stop pump
Wait X amount of time
IF tank2 enabled start pump
else move to tank3
Run pump for X amount of time
Stop pump
Wait X amount of time
If tank3 enabled start pump
else move to tank1
Run pump for X amount of time
Stop pump
Wait X amount of time
 
Filters for x amount of time then scans for the next enabled tank..
That sounds like you might need to set up a sequence of events. A sequence can be done many different ways.

1. One of the most popular is simply to use a word value to contains the current sequence number. Each part or step in the program examines the sequence number. When its number comes up, it executes that step. At the end of the step, the sequence number is incremented to the next number in the sequence. You wouild only need about 3 numbers to step through all of your possibilites. Most of us increment by 10 or 5, so that steps can be added later, if needed. If a step is disabled, then when its number becomes active, you have logic that bypasses or nullifies all the rungs for that step, and then activates the next step.

2. Another way is to use a counter, and increment it for each step. Each step then examines the counter value to see if its turn is active.

3. An old way is to use internal PLC step relays. At the end of a step in the sequence, the next step relay is latched and the current step relay is unlatched.

4. Most PLCs have some type of Sequencer or Drum instruction that allows stepping though a set of well-defined, unchanging steps. Due to all the ifs, ands, and buts that occur in most real-world applications, sequencer instructions often cause more problems than they solve. Seqencers can hide or obscure the logic so that a stranger will have difficulty figuring out what the program is doing.
 
Last edited:
Thanks for the help guys its giving me some more ideas and no there is only one pump. I changed up the operation a little bit.. this is how its going to operate.

I have 3 Tanks that each have their own feed valves into the filtration unit with a single pump inline. Then each tank will have its own return valves. I will be a continuous filtration on tanks that are enabled.

I made up my mind I want to make the tank switches time based. I just cant wrap my head around how write the logic for this. 3 toggle switches to enable the tanks you want to filter and it will start filtering the first tank that is enabled then after it times out it will move to the next enabled tank and just keep looping around until i disable all tanks.
 
That sounds like you might need to set up a sequence of events. A sequence can be done many different ways.

1. One of the most popular is simply to use a word value to contains the current sequence number. Each part or step in the program examines the sequence number. When its number comes up, it executes that step. At the end of the step, the sequence number is incremented to the next number in the sequence. You wouild only need about 3 numbers to step through all of your possibilites. Most of us increment by 10 or 5, so that steps can be added later, if needed. If a step is disabled, then when its number becomes active, you have logic that bypasses or nullifies all the rungs for that step, and then activates the next step.

2. Another way is to use a counter, and increment it for each step. Each step then examines the counter value to see if its turn is active.

3. An old way is to use internal PLC step relays. At the end of a step in the sequence, the next step relay is latched and the current step relay is unlatched.

4. Most PLCs have some type of Sequencer or Drum instruction that allows stepping though a set of well-defined, unchanging steps. Due to all the ifs, ands, and buts that occur in most real-world applications, sequencer instructions often cause more problems than they solve. Seqencers can hide or obscure the logic so that a stranger will have difficulty figuring out what the program is doing.

I did not see this before I posted my last reply. Thank you.
 
I have 3 Tanks that each have their own feed valves into the filtration unit with a single pump inline. Then each tank will have its own return valves. I will be a continuous filtration on tanks that are enabled.
Then you will need Output addresses for each Tank Feed Valve and Return Valve (6 total.
You probably should have a "Filtration System On/Off" switch input (1 each).
I think you mentioned an Auto/Man switch. In Manual, what happens? Does all tanks get filtered?
You will need Input addresses for each "Tank Filtration Selected" switch (3 total).
You will need an Output to turn the Pump On/Off (1 each).

If you could assign addresses to those, I can help you write some MicroLogix logic.
 
Last edited:
What happens if a valve is not closed all the way or is stuck open? If that will cause a issue I would highly recomend position switches and run them into the PLC.

If you already have actuated valves then it shouldn't be that much more $$ to add position switches.

Just my opinion.
 
Snap,

For your MicroLogix garage project on a small budget, the attached RSLogix program should get you started.
 
Last edited:

Similar Topics

I need assistance in the form of some example programs pertaining to analog read and write. Thanks in advance. Sangli
Replies
1
Views
196
Hi I am being given several fault words (as a DINT) from a Drive that I am receiving into a Compactlogix L33ER controller. I have a small...
Replies
12
Views
1,140
in s7-1200 manual it said Whenever the operating mode changes from STOP to RUN, the CPU clears the process image inputs, initializes the process...
Replies
0
Views
1,055
Can someone explain the order of processing the actions of a step...is it top - bottom see attachment for reference. Does it process the blkmov...
Replies
1
Views
2,075
My company imposes programming standards and insists on using AOIs for AI, AO, DI, DO points. I like AOIs and use them as subroutines when I have...
Replies
10
Views
3,068
Back
Top Bottom