Storing Totalized Flow

justin lutz

Member
Join Date
Aug 2008
Location
Columbus, Ohio
Posts
93
Hello everyone,

I have read through several posts on totalization, but i was hoping that someone could help me understand the best way to store totalized values? I am working with a SLC 5/05 processor.

The main thing i am looking at is totalized flows, on the order of 15 million gallons per day (MGD). Is it best to store the totalized values in an integer file or a float file? I have heard some reference to double integer files, but i am not familiar with how they work or if i even have them at my disposal in the SLC. What are my limitations of each file type (when should the total be "rolled-over" so to speak?

I appreciate any help you may have to offer.

Thanks,

Justin
 
I would use Floating points. You are limited to 32676 in a Integer. 15,000,000 is 1.5E+07 right the SLC will display that. Howmuch rounding can you afford? do YOu need to have exact numbers? If you need exact numbers you may need to split it up in 2 consecutive addresses.
 
First the reason you would use something other than a integer would be the value. An integer can only hold a value smaller than 32768. If your stored value is going to exceed 32768 then you will need a larger register. A Float uses 2 integers instead of one or 2 words however you want to look at it. Since your using a SLC we will use the term integer. A float is a special register used to hold decimal numbers. It gives the PLC the ability to store numbers like 1.5 etc. The downside is 1.5 looks like 1.499999. This can lead to errors. If you do not need the decimal place and your value is going to be larger than an integer can handle then what you want is a Long integer. This is the double integer you were told about. It has 32 bits instead of 16 like an integer so it can store a much larger number.

This is the water down version. For more detail you may want to look at a manual on the SLC and search for Data Files it tells the size of files in words.
 
Worth mentioning: I am reading in actual analog flows (4-20mA), as there is no pulse output available from the instrument.

To be honest, i am not certain how much rounding i can afford. I just know that, while it is not possible, the Plant would like the numbers on the HMI to match those on the local instrument. I don't know what degree of accuracy i can expect given the application and the fact that i am totalizing the analog value vs. a pulse.
 
So, if the valid floating point element range is 1.1754944 E–38 thru 028237 E+38, and I am totalizing a worst case of 15 MGD, how would you handle the roll-over? Is it best to roll-over at the end of 24 hours, or to roll-over once a nominal threshold is reached (say 100,000,000 gallons)? Right now, the Plant is not interested in totalizing on a daily/weekly/monthly/etc. basis, but to rather have just a "running total."
 
The HMI's displayed total will never match the internal instrument totalizer, but one solution is to display (HMI 4-20mA calculated total) + (offset) = displayed HMI value

I assume that the instrument's total is the most accurate, so that's the standard against which the offset correction is calculated.

Then let someone periodically access a register that gets added to the HMI 4-20mA calculated total.

When changing to a new offset, the trick is to save the previous offset and add the new offset to the old offset v, because the difference between calculated and displayed is already offset by some value.
 
One thing to remember about round-off is that it tends to equalize. The error when the flow going up is offset by an opposite error when the flow is going down. If you do the math right your totalizer should be quite accurate.
 

Similar Topics

HI all, I have a backup from a Series 7000 Cognex camera. I am trying to restore and see the vision tools used in the job. Can I restore those...
Replies
0
Views
63
Hello, I have an int variable that updates the value every second. I want to store the 100 values in an array. Array should keep storing the...
Replies
7
Views
999
Hi I have a vision camera that I’m getting the string data P908765 from the vision on an advance trigger .which im using a S -move. Then I put...
Replies
1
Views
369
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
Is there any easy way to store a password for an email address that is changeable on the HMI that is not easily deciphered. aka, don't write it to...
Replies
0
Views
379
Back
Top Bottom