totalizer --Micrologix

DBLD99

Member
Join Date
Oct 2003
Location
USA
Posts
230
Hello, I have searched the site for totalizers, but all the examples use Float files. I need to do this in a fricken Micrologix 1000, (also need to scale it in here also), how would someone totalize without a float file and scp instruction. The int. can only go -32767 to 32767. Thanks for your help

I have 0-5500GPM -4-20ma signal, wanting to totalize in GPM. The micro's dont support long intergers that I know of. Thanks for your help
 
Last edited:
The wrong tool for the job.

I don't think that it can be done in any effective way using only integers, because of the number of significant figures. With Integers, you only have 4 full digits to work with. It is likely that you will be collecting over 1000 data points to reach your total, which would mean 1 digit of accuracy. That just won't cut it.

Does your micrologix support Long Integers? (L data type) If so, you can use those instead of floats - just keep track of where your decimal place lies.
 
Can you please Explain Totalizers.

Is this like counting strokes on a punch press?
Counting Bottles going down a conveyor?
If it is something like this, can't you cascade counters?

It may be very obvious to everyone else, but I am ignorant on this subject.
Please enlighten me.
 
A totalizer is a method of keeping track of the quantity of something over a period of time.

The best example would be totalizing a flowrate.

For instance, you have a flowmeter reporting the flowrate of something. A totalizer would take the flowrate and calculate how much flow occured over a period of time, add it to a total, the end result being a measure of the total material that went through the flowmeter.


If you were totalizing GPM you know that you have X gallon per 1 minute. After 10 minutes you would have X*10 gallons. Of course a flowmeter calculates it's signal much faster than 1 minute. You would want to set up the totalizer to sample and totalize a flow rate at the shortest interval possible if you were totalizing something with a lot of quickly changing variance, where other times you might not care about the accuracy of your total, or the thing being totalized doesn't change very much or very rapidly.
 
Last edited:
There are some things to consider:

1. What kind of precision do you need? (you can divide the reading by 10, 100, or 1000 if you're not going to lose money over it or start raising eyebrows at the EPA).

2. What's your upper limit? Do you want to be able to add max flow for a day, a month, a year?

After you calculate flow/time period and do the sum, you could create a roll-over register. If N7:0 >= 1000 then add 1 to N7:1 and subtract 1000 from N7:0. Get the idea? You can add more registers beyond this for more digits.

The program scan is usually quick enough that if you were to add 2000
to N7:0, the two scans required to work out the result won't really be apparent. If it bugs you, though, you can create "holding registers" for the data and update them after you've completed the math (if N7:0 < 1000 then MOV... ).

This gets interesting to display on an HMI or touchscreen if you don't have leading zeros or math operations available. But, it can work.

Be sure to budget time for troubleshooting!

AK
 
Subroutine????

If I am not mistaken, the Micrologix 1000 uses RSLogix500 for programming. You could write a subroutine in it, right??
The subroutine can be programmed to have a scan time for it, independent of the main program scan time. And it works like an interrupt. For your programmed interrupt time, it will execute the subroutine.
In the subroutine, you could sample the flow rate and store it in an integer file. Every subsequent sampling would be added to the earlier stored flow rate and so on. But, an overflow might occur beyond the 16-bit integer value. Then you could follow what "Akreel" says above here.
Am I saying something relevant or am way off the track here????
 
Akreel, you are exactely correct, I used to do long integer math many moons ago B4 there was DINTs and reals. Numbers < 1 were merely handled like another integer you just had to keep track of the decimal place, and like wise in the other direction, keep track of overflows!
 
Bitmore said:
Akreel, you are exactely correct, I used to do long integer math many moons ago B4 there was DINTs and reals. Numbers < 1 were merely handled like another integer you just had to keep track of the decimal place, and like wise in the other direction, keep track of overflows!

I "grew up" on Automation Direct. While floating point math is available, it was sometimes easier to apply a decimal point on the HMI. I also created a number of run-time counters for motors. You use can up a 4 digit BCD number fairly quickly on a motor that runs 24/7.

AK
 
There is no reason this can't be done using integers - I've done it many times with ADC and they only have 0-9999 available. As Aaron said, you just have to watch your decimal places and use a rollover register. I usually have my rollover at 1,000, 1,000,000 and so on, but you can suit your needs with any increment you want.

You can certainly use a subroutine, but I'd avoid trying to do the totalizing to every scan. You will end up with very small increments and loose a lot of data. Unless you have very fast changes and need incredible accuracy it isn't worth it. If you are doing custody transfer applications an external dedicated totalizer is probably better.

I usually use a timer to go to the subroutine, and put the increment at 10 seconds or so. Take a "snapshot" flow rate reading, multiply it by the timer setting, and get the units right. (If flow rate is gpm or cubic meters per hour for flow mean you have to do some conversion.)

Implicit in the totalizing function is the assumption that the flow rate when you take a snapshot reading the rate has been constant for the entire time interval. That is never true, of course, but on the average it doesn't matter because statistically the times you are high are offset by the times you are low.
 

Similar Topics

Has anyone out there created or knows where to find a 4-20 in totalizer block for Micrologix 500. I am needing to add a couple totalizers to an...
Replies
1
Views
3,008
Hi Folks, I am using a Micrologix 1200.I want to record the weight on a conv.Every 45 pulses I want to record the weight.I am using an ADD...
Replies
10
Views
3,441
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
574
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
787
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,797
Back
Top Bottom