Gallons Totalizer and GPM

I have a question about how to get both a totalizer and a gpm reading out of a high speed digital input.
I have already set up variables that check the high speed digital input for it’s reading every 500 mSec. I set the input block on the IDC5-FAST to counter (is that best for this application?). The variable is on a loop and is updating with pulses. I would like to take those pulses and multiply them by the K-factor to produce totalized gallons. The solutions that I’m looking to produce are how to get gpm as well as how to continue to totalize if the K-factor has been changed because of calibrations.

Anyone got any ideas?

1 Like

Hi ScaDunk,

When you configured that point, you probably noticed for the “Feature” you could choose “Counter” or “Frequency” or “On-Time Totalizer” (just to mention a few of the many built-in I/O options).

Of course, that’s an “or” not and “and” so you only get to pick one feature per point. However, are you using all 4 input channels on that module? Could you split the signal and configure one point as “On-Time Totalizer” and another for, perhaps you’d want “Frequency” to get the gpm?

The more calculations you let the I/O Unit (aka “brain”) do, the less your chart has to do and the less code your have to debug/maintain!


Can I attach what I have done so far and have you check it? If so, how should I add it?

Yes, right-click on your chart to Export, then zip the file and attach it here.

Oh, and to answer your question I am not using all channels, but I’d like to keep it to one per meter since there are going to be multiple meters.

So the counter setting gives me a total pulses counting up from zero. I need to multiply that by the k-factor (pulses per gallon) to get true gallons. The problem I run into is that once a year we have k-factor changed when we do third party calibrations of our flow meters. So, if that k-factor changes, the whole count will change, not just the portion of the count from the point we changed the k-factor. I was going to just do a get and clear and add it to a variable over time, but then if I clear it the way I’m running my chart it will most likely mess up the GPM reading. So, I’m trying to figure out how to do both calculations in the same chart.

The other question I have is that a chart is run every 100mSec right? and do you have to have a delay added to that…I know it’s recommended in most charts, but then if I’m calculating GPM based off of how many pulses in a second, does that then mean that the chart delay of 100mSec will mess up my second count, then adding 100mSec + delay to my real second interval?

basic problem is I’m trying to do this as accurately as possible to maintain a true reading.

Hi ScaDunk,

Okay, I checked w/my favorite flow-meter expert, who did a whole [U][B]blog series on this topic[/B][/U], and we have a few suggestions and concerns here.

  • NOT splitting the signal and trying to do all that math in a chart is NOT recommended (and extra module, if needed, is much less expensive than your time and trouble).

  • You mention “accuracy” and an 500ms and we’re not sure what exactly what you’re after there – where does this 500ms come from, and what accuracy/resolution do you need? This goes with whether that IDC5-FAST or some other module, like the one Ben used in his blog/flow meter application, the IDC5-SW, for example, makes the most sense for your application. (Also check out this blog post on [U][B]Accuracy vs. Resolution[/B][/U].)

  • You mentioned “totalizing,” which threw me off, you don’t want to use our on- or off-time totalizer features for here because you’re measuring [I]how many [/I]pulses (frequency and count) not on-time – sorry for my confusion!

Also, you’ll need to worry about rollover (how high will these counts get? you’ll need to read & clear them before they roll over). Ben stores his daily, weekly, monthly, and yearly counts. But you might want to watch these values in even smaller increments – like hour-by-hour? Will you store this info in a database? Sounds like you want to only apply the new k-factors starting when you change it? (Maybe you’ll want to store both the raw data and the k-factor-adjusted data in a database?)

Can you tell us a little more about the big picture here, and accuracy + storage/recording requirements?