Totalizer

rscott9399

Member
Join Date
Aug 2017
Location
in space
Posts
114
Working on a totalizer

Seem to be over flowing my int very badly and very quickly

Wanted to check my logic atleast verbally with you all.

Say i have flow in Gallons / hour

I can convert that to gallons per second easy enough.

GPM * 1/60 = gallons / second

Now if i examine this quanity at a 1 second pulse interval and simply keep a running total

running total = running total + amount seen at one second pulse

That should give me a total right?

Thanks in advance
 
A couple of things.
First, you said your flow sensor is in gallons per hour. Gallons per second is GPH/3600.
Second, is your one second pulse truly a one-shot pulse? Some PLCs have a built-in one second signal that is true for 1/2 second and false for 1/2 second. That type of signal is OK when you're using a counter instruction to accumulate pulses but not when you're adding to a running total.
Either of those things would make your totalizer accumulate faster than anticipated.
 
gallons/hour / 60 = gallons per minute (not gallons/second)

gallons/hour / 3600 = gallons per second


You're likely to lose resolution if you divide a small value by 3600.
 
thanks for the correction

yes 3600 not 60 sorry i goofed that up

Also, i understand what you mean in regards to the pulse. Is it truly a pulse or is it a 1 sec pulse with a 50% duty cycle. aka it would actually add for an entire .5 second period


The way i have it written it should be truly a pulse.
 
I think the issue might be that you are storing in an Integer. Since your flow rate is in GPH, then I assume it's not a really fast flow. For this example let's assume 600 GPH.
So each one second you are going to get .1667 gallons.
When you store this in a integer what happens, does it round up? You did not mention your plc platform.
 
What PLC are you using?

In general, I try to count pulses in a long integer or use a high speed counter if necessary.

I will calculate rate on the rising edge of each pulse, and calculate total based on units per pulse. If the value will quickly roll over a long integer, cascade two of them...
 

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
557
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
710
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,752
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
661
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,383
Back
Top Bottom