Modify a fifo stack

rfowler24

Member
Join Date
Aug 2008
Location
In front of my laptop
Posts
9
Greetings,
This will be my inaugural post in this forum so here goes. I've searched through the forums and found bits and pieces of information but need help integrating them.

I have an application where I need to load several pumps into a run queue as they become available. (HOA switch to auto with no fatals active)

As demand calls for more capacity, I want to bring on "lag" pumps in the order that they were added to the queue.

This seems simple enough to do with a fifo stack. But there is one problem I don't know how to deal with. In the event that a pump trips (or the "lag" demand satisfies) how do I remove the appropriate word for that pump from the stack and have the pumps behind increment up. In the case of the lag demand being satisfied, I want to add that pump back to the bottom of the stack. (When there is another "lag" demand I want the next pump to start so I can minimize starts/hr per pump).

I don't know if there is a way to unload the fifo stack at any location other than the defined stack "0".

I've entertained the thought of the copy instructions and see how it could be done but the programming would be tedious and difficult to follow for others unfamiliar with our systems and programming. The fifo instruction seems like such an elegant solution if I can only find out how to unload from an alternate position.

I appreciate any help you can give me with this.

Randy
(I have no witty anecdotes yet)
 
Rather than using a FIFO, maybe you could use timers, one for each pump that is available. When you need to bring another pump online, pick the one with the greatest .ACC in its "ready timer".

If you want a pump to retain its position in the queue if it should fault, and then be made ready again, you could use RTO timers.

Just a thought.
 
Thanks for the replies.

In general, if any running pump shuts off, I want it to go to the "back of the line" when it is again available. Pump run times are tracked within one of my data files. I have some math logic which detects when a pumps hours deviate by more than a set value from the mean. (Low time pumps get "head of the line" priveledges when the lead pumps Minimum Run Timer times out.) At the beginning of the run, the lead pump is determined arbitrarily by which switch goes to auto first. If a high time pump is the initial lead, after it's minimum run timer times out, it goes to the back of the line and the next pump in the queue takes over the lead function. The order in the queue isn't necessarily consistent. It is determined by switch manipulation and logic manipulations.

Other unrelated parts of this program are rather complex and rely on an organized data file that can be interrogated for pump number and position in the queue so that portions of a pid output can be written to each specific pumps speed reference

Now that I look at it, I may be able to use your timer idea though for other parts of this program.

Thanks again
 
I guess I'll have to read up on pointers and array's. I've never (knowingly) used them. Does any one know of a good resource for the basics specifically for AB? (I've used DL05's and 06's for years on very simple systems but nothing with any real complexity)
 
Greetings rfowler24 ...



there are many members here who would probably be willing to write this for you - myself included ... (I'm tied up this weekend but could probably have it done by Tuesday - if nothing else pops up) ... the problem is that you haven't defined how you want the system to work in quite enough detail ...



suggestion:



instead of telling us in "text" what you want to happen, try giving us a "pseudo-code" example of an acceptable sequence ...



BRIEF example:



Monday morning bright and early - first day of operation ...



operator momentarily pushes start button for Pump A ...

Pump A begins running ...

Pump A ramps up to full speed ...

Pressure rises but is still too low ...

Pump B begins running ...

Pump B speed ramps up to half speed ...

Pressure rises to desired setpoint ...



Pump A satisfies "maximum run time" ...

Pump A stops running ...

Pressure drops ...

Pump B ramps up to full speed ...

Pressure rises but is still too low ...

etc.



naturally you'll want to insert examples of how you want the other functions that you mentioned to fit into this scheme ... suggestion: first do it for a "straight-line everything works" sequence ... then copy and paste it and work in some "operator curve ball" operations ... etc. ...



I'm willing to bet that once you nail down all this specification step, you'll be able to finish the whole project on your own ...



no offense, but some of the specifications that you've already posted seem (well, at least to me) to be sort of self-contradictory ... those "back of the line" and "head of the line" assignments might seem apparent to you, but personally I'm having a hard time figuring out EXACTLY what criteria you want to use to determine which pump comes on next ... (run time, last used, end of line, head of line, ?) ...



anyway ... I hope this helps ... and if you can give us a rock-solid specification, then one of us will be happy to write and post the code ...



and by the way - exactly how many pumps are we talking about? ...



so that portions of a pid output can be written to each specific pumps speed reference



have you tried that particular piece out yet? ... I don't remember ever having seen that "portions of a PID output" method used before ...
 
Ron,
As far as the portion of the pid, yes I have and with good results. When I have time, I'll try to put together a coherent explanation.

Unfortunately, I am something of the ADD poster child, which is reflected in my written thoughts. I'll pop some ritalin and see if I can clearly define what I'm trying to do a little later (My wife has indicated that the lawn needs mowing at this very minute)

Thanks for your responses
 
rfowler24 said:
Incidentally, I'm getting the impression that unloading a fifo stack at an intermediate position is a dead end. Is this assumption correct?

if you want to go that way why not wait until the pump is at the top of the stack ready to be used and if there is an active alarm on that unit add a hold condition and put it back to the bottom.
 
Perhaps I spoke to soon

The easiest thing to do to remove an item from a FIFO is to read each item from the Fifo Output and put it back at the FIFO Input until you have gone through all of them. The items that are faulted should not be put at back in the FIFO. This would require a FOR loop to search through the FIFO. It shouldn't be too bad because you don't usually have a lot of pumps. I would not have recommended this method without knowing the number of items in the FIFO is small.

Normally I would use a doubly linked list because this technique can be efficient with a FIFO of any size but a PLC person may not understand linked lists. They will understand going through the whole FIFO and putting back only the running pumps you want to keep.
 
Last edited:
let's go with four pumps - just to get the technique down ... you can always expand from there ...



as I understand it, we basically need to do a "SORTING" operation to determine which pump is first in line, second in line, etc. ... that's because the pumps don't just go in "regular rotation" fashion ... (that would be simpler - but where's the sport in THAT?) ...



so the question NOW becomes on what criteria (yes, I know that's plural) shall we base our sorting operation? ... probably "total elapsed running time" for each pump ... but that hasn't been confirmed yet ...



but you also mentioned something along the lines of "number of starts" ... so ... is that the SECOND most important criteria - or the FIRST mode important criteria for the sort? ... (the "tiebreaker" in case of identical running times) ...



basic idea: we absolutely MUST know the basis of how we'll order the operation of the pumps BEFORE we begin to write the program ...



now ... if a pump happens to be "first in line" and it's running happily along, do we want to stop it if a certain time elapses - and bring on the next pump? ... or do we wait until the first pump "normally" shuts down before we change things around? ...



finally (for now) ... if a pump is "taken out of service" (by a maintenance man's switch, etc.) do we cancel out its accumulated running time? - or do we leave the running time in place and take that time into account as we place the "repaired" pump back into the line up? ...



and REALLY finally for now ... what EVER we do (FIFO, array with pointers, etc.) we can NOT start storing things until we know in which order those things should be stored ... and THAT is what we're really waiting on here ... once we know HOW the pumps will be sorted, THEN we can worry about how we'll take care of storing the information ...



or at least that's the way I'd do it ...
 

Similar Topics

Hi, I have an application in which an operator is able to load one of four stations by pressing a load button and can cancel a load call by...
Replies
8
Views
2,611
Hi, The hardware is: Click Plc model # CO-O1DD1-O HMI model # S3ML-R magnetic-inductive flow meter model # FMM100-1001. I will set the flow meter...
Replies
4
Views
211
Daft question coming up...When I want to modify a value, what's the best/correct way to do this? At the moment, I am entering the value (e.g...
Replies
8
Views
494
Hi. I'm working with a SLC 5/05 but I have no experience with it. I've been tasked with trying to figure out if it is possible to directly modify...
Replies
6
Views
1,093
I am building a report screen with a SQL table display, and I want to be able to adjust the time range from which data are pulled (something I...
Replies
0
Views
900
Back
Top Bottom