Hard Meter Number

I've been beating my head against this problem intermittently for a while now. o_O

We have 3 meter with hard mechanical counters on the top that go up to 99,999,999.99 and then roll over to 0. We only use them as a verification/check against our flow computer for the indicated volume.

I'm using Wonderware v10.6 and RSLogix5000.

Currently they're typing the numbers into an analog entry on Wonderware and stored and processed as real (float) in the PLC. The problem is the nature of how the floats are stored means they're not accurate when you get up to the very large numbers. RSLogix is also rounding the decimals, sometimes to funky numbers.

I've tried using integers, but I can't get the resolution to come in, even through formatting.

I'm sure there has to be a solution to this, and reducing the resolution might be it, but I'd rather keep the resolution if possible.
 
use double-precision (64-bit) floats. I think they are called LREAL in RSLogix5k. I don't know if they are available in Wonderware, but they should be.
 
use double-precision (64-bit) floats. I think they are called LREAL in RSLogix5k. I don't know if they are available in Wonderware, but they should be.

They are called LINT (Long Integer), and are not supported by most instructions.

Good luck if the OP tries to use them !


EDIT : My apologies, you said Floats, not Integers.

BUT ! There are NO 64-bit double-precision REALs in Logix5000, just standard 32-bit.


2021-03-18_151055.jpg
 
If you insist on using REAL you're going to have to do some rollover to get your display to be correct.

You can use counters to increment for say every 1000 gallons, when the real reaches 1000, increment the counter by 1 for the (1)XXX galloons and clear the real to 0 when the real reaches the next 1000 increment the counter by 1 to (2)000 and so on. you could use whatever scale you want, it could be rollover a 100,000 gallons.

You can also accomplish this in the HMI by having a numeric entry for each numeric place. If this is to clunky use a DINT and extract the bits and insert them to your real positions.
 
If you're trying to do it using a DINT with two implied decimal places, the rollover would be at 10 billion. That's too large for a DINT. Can you manually reset the counters at some value less than the rollover but within the upper limit of a DINT?
 
Two cascading DINTs would be how I'd store the value. I am not sure how WunderWear will deal with that as a numeric entry though.


Agree. Use one dint to hold major and another to hold decimal values.

The LINT is unfortunately not all that useful. I actually just did a similar task where I am reading values from meter via modbus (through a gateway). The meter will wrap around after 99,999,999. I used a DINT to hold actual total since I calculated the worse case scenario would be that I would not have to worry about the DINT rollover for 50years. I will probably be retired and perhaps dead by then, and this place will be dozed down way before then.
 
Two cascading DINTs would be how I'd store the value. I am not sure how WunderWear will deal with that as a numeric entry though.


If you mean totalizing in one counter and then rolling over into the second and resetting the first, I do this as well with MicroLogix 1100s. In the HMI I then do:


Total = Counter1.ACC + (Counter2.ACC * 32767)


Where Counter1 is the main totalizer and Counter2 is the overflow. Obviously in this case, it would be higher than 32767 where they're DINTs instead of INTs. Could also have it roll over at an arbitrary number such as 1,000,000 so it would be (Counter2.ACC * 1,000,000) instead. I assume you could have this cascade as many times as you want.


EDIT: Missed the whole discussion about the decimal points, don't mind me.
 
I have done the 2 cascading INTs method on a SLC, had to have the HMI show 2 INT values aligned to show the entire value.

So the second INT showed all the leading 0's I would add a 1 that would be covered by the other integer.
 
I'm not sure how cascading counters will help in this case, but maybe I'm misreading the the problem. My understanding is that operators are transcribing the number they see on the meters to a variable in Wonderware. WW sends that variable to the PLC as a 32-bit floating point number which is the source of the problem as the number gets beyond seven significant digits.
That's why I suggested manual reset of the counters before their accumulated value exceeds 2,147,483647. Then a number like 12,345,678.90 can be sent to the PLC as 1,234,567,890, a DINT with two implied decimal places.
 
I wonder if storing the operator entry as a string would work, padded out to the left with zeros.

That way no digits are lost, and the value can be recovered at any point downstream.

Does the plc ever make any calculations with the value?
 

Similar Topics

Hi, I have a VSD which was initially intended to be connected to an AB drive via ethernet, but the design has now changed to use only hard wired...
5
Replies
199
Views
Good Morning , I started a job with the county I live in . They have several locations with Rockwell Automation PLC's with versions of...
15
Replies
896
Views
Please forgive the broad nature of this question: For context: I am a cybersecurity consultant making a transition from the traditional digital...
9
Replies
1,034
Views
Hello World, This is my first thread on here but I have been a full-time programmer/controls technician for about 5 years now. We have a...
3
Replies
1,050
Views
Hi - I'm a newbie to the PLC world but was recently asked if we could store more than the 2G that the CompactLogix 5370 allows by its max size SD...
13
Replies
2,888
Views
Top