Totalizer

Roger Pate

Member
Join Date
Aug 2002
Posts
7
I need help creating a ladder logic flow totalizer, I have a supply
and return flow. I want to subtract the return from the supply and totalize the usage. I'm using SLC/505
 
Whether you are totalizing the net flow or the influent and effluent seperately, the procedure is the same.

Your analog inputs will be units of quantity per unit of time (gallons per minute, liters per second, hogsheads per fortnight). In your ladder logic you set up a signal that samples the flow once per convenient unit of time. Multiply the flow rate at the instant you sample by the time increment between samples and apply the appropriate unit conversion factors to arrive at the volume for the sample increment. Add that volume to the cumulative total flow.

If the flow rate can change rapidly, you need to sample more frequently to minimize error. There are additional things you can do to minimize errors such as taking the average flow rate between successive samples and multiplying that by the time between samples. The degree of complexity in the calculation should match the level of precision required in the measurement.
 
This is a little bit of a Terminology Conflict.

Flow Totalizer is... like... Total Flow. Duh... Do ya think?

I get the impression that some of the flow does not return.

Usage Totalizer (as in Consumed) is Total Supply Flow minus Total Return Flow.

Regardless of the type of PLC, it appears that you are simply asking for someone to build the code for you. This concept is incredibly basic! Total Supply (up to this point) - Total Return (up to this point) = Total Consumed (up to this point).

You simply need to maintain an accounting of the amount supplied, and the amount returned. Then subtract the returned value from the supplied value to get the consumed value. You can update the "Consumed" value at any rate you want.

Of course, you do have to find a way to handle roll-overs in your totalizers.

If you are simply asking for someone to give you the code... well... you gotta know that we really don't do anyone's homework. See the NEW HERE at the top of the site.

Even if you are really trying to deal with a real problem (i.e., you are not a student), this is more of a teach/learn environment than a "We'll do you work for you" environment.

Show us what you have tried.
 
I have taken the supply flow and subtracted the return flow and I have
the usage. I have taken the usage flow and added it to the total, but
I am constantly doing this math. Should I just do this math once per
10secs,20secs etc...... My totalizer is working but the total comes out to be 2 times the amount it should. Would this be because I constantly do the math?
 
Watch your units!!

What are you measuring?

When you mentioned that you wanted to totalize the flow, I assumed you meant you had a signal coming into the PLC that represented a flow rate (gallons per minute, liters per second, hogsheads per fortnight, or something similar).

Do you instead have a signal that represents volume (gallons, liters)?
 
You should certainly do the "update" only now and then. That is, after, Supply update, then Return update, then do your math (or vice-versa).

Are you in fact, maintaining "totals" and working with the totals? Or are you working with looking at instant "Flows" as in "Flow Rates"?

Total Supply (up to this point) - Total Return (up to this point) = Total Consumed (up to this point).
 
Yes, I have two flow meters one for supply and one for return.
I scale these signals o-1000 gal per min. This is water flow.
 
I am taking the two flows to find out the usage, at this time I am posting this data on scada as current usage flow, todays usage flow,
and yesterdays usage. I am moving data and clearing data at midnight, I have not been sampling at different interval, I have been doing this math constantly. Would this be the reason my totalizer seems to double?
 
OK, you've got a signal that represents gallons per minute and you want to totalize it. Let's say that you want to update the cumulative flow every second. You take the number representing flow rate (Gallons per minute), multiply it by 1 second. Divide the result by 60 (seconds per minute). The result is the number of gallons accumulated in the last second. Add it to the running total.

If you wanted to sample every ten seconds instead of every second, take the GPM value, multiply it by 10, divide by 60, and add the result to the running total.

If you sample every 100 milliseconds, take the GPM value, multiply it by .100, divide by 60, and add the result to the running total.

The important thing is that you only do the arithmetic once per sample period.
 
Hey guys Thank You for your help, I will make a couple of changes in the morning and will give you a report tommorrow. This is my first time on this site, maybe i can be of some help to you guys.
 
Steve, I like your responses.


Terry,

Man, a little paranoid of students and their homework are we?

Just a tit for tat: I wrote plc programs for 5 straight years, and didn't learn about flow totals until my 6th year when I changed jobs to a different industry.
 
Roger:

There are two classic approaches for totalizing flow in a SLC. Both use the principle of Total = Prevous Total + (Rate x Time) (which is what most of the above posts were about)

1) Put the summing logic in an STI program, and use the STI update time as your Time value.

2) Do the summing every scan, and use S:35 (Last Scan Time) as your Time value.

The later is my perference, as it updates the flow as fast as the PLC can get the flow rate reading (short of IIN instructions, of course).

Hint: Be mindful of units. Rates are often in xx/minute. Scan time is in msec. STI time can be in msec or 10 msec, depending on S:2/10.
 
Hey fellows, I pulsed the logic that I had wrote and my numbers
came in perfect. I had wrote my logic correct, the 10sec pulse
was the fix for this issue. By the way, when we help someone with
PLC issues we grow also. And with homework; I don't expect anyone
to do it for me, I just was asking for some help. I have been working
with PLC,SLC for many years and unlike most, I have not leaned it all.
 
ganutenator,

Regardless of whether I thought Roger was a student or not, I asked to see what he did. Seeing how he developed his particular solution would have made it easy to point to the problem.

Try not to "read-in" what is not there, nor "read-out" what is there.
 

Similar Topics

Hi, So we have a flowmeter installed but doesnt have a feature to send a pulse to plc for it to compute the total volume. I want to somehow...
Replies
3
Views
570
How is it going y'all? So We have had a pesky problem with an EH 300 flow meter. We are using EIP to reset the totalizer, and for some reason the...
Replies
3
Views
773
Good morning, I have a flow meter that has an output pulse configured to 378.541 liters per pulse. My question is, do I just count the pulse per...
Replies
19
Views
1,787
Good morning, I have a flow meter that that has an output with is a pulse. The pulse is configured to 378.541 liters per pulse. My question is...
Replies
6
Views
696
Hello You guys helped me with a similar issue some time back on storing totalized values to different tags each month. I have a similar issue...
Replies
19
Views
1,471
Back
Top Bottom