Integer Size Limit

sreev

Guest
S
Using AB Micrologix 1000, I am trying to count totalizer pulses into an integer word. But the maximum number that an integer can store is 32767. Is there a work around to this to store larger numbers? Micrologix 1000 does not seem to support floating point data type. I could not find anything using search, but if this has already been answered before please point me to the thread.
 
As far as I know there is no clean work-around for this situation.
This suggestion isn't very clean but it may work for you depending on what you need to do with the totals. You can cascade a group of integers to keep track of larger counts. For example, use one integer to count from 0 - 9999. On count 10000, reset the first integer to zero and increment a second integer by 1. You can do the use a third integer if you need to get above 99999999.
Like I said, it isn't real clean but it will accurately keep track of the counts.

Keith
 
Keith's solution is typical in many cases.

It can be used for time-counting as well as event counting.

The problem is, Can the accumulated number be displayed or manipulated by any math function?

If your PLC does not recognize numbers greater than 32xxx (1-word), then you could certainly have a problem trying to do anything with the accumulated number.

For example, if your accumulated value, using two 16-bit words, was 42xxx... that is, word-1 = 1 (32xxx) and word-2 = 10,000, then how can you do any thing with that number?

There certainly are ways to perform any math function on any number, no matter how you have it stored, but you have to go through much effort to make sense of it.

You could go through the effort of keeping track of the numbers in the same way that math does, that is...

x-number of 1's,
x-number of 10's,
x-number of 100's,
x-number of 1,000's,
x-number of 10,000's,
x-number of 100,000's etc.
(where x = 0 to 9)

That makes it much easier to do math on numbers that are larger than your PLC can handle. You can ADD, SUBTRACT, MULTIPLY and DIVIDE these huge numbers.

Using that method will also allow you to display numbers on your HMI that are larger than the HMI recognizes. You simply display individual unit numbers.

x-number of 100,000's,
x-number of 10,000's,
x-number of 1,000's,
COMMA
x-number of 100's,
x-number of 10's,
x-number of 1's
(where x = 0 to 9)

It takes quite a bit of extra code, but it can be done. Even in a dumb ol' AB Micrologix 1000.

Just a "heads-up".
 
Thank you

Thank you all for the suggestions. I feared there was no straightforward way of doing this. Terry's and Keith's suggestions will be a great start for me. I had used "L" long integer files in the past with Micrologix 1500 but they are not supported on 1000. In fact 1000 does not allow any user defined data files.
 

Similar Topics

Hi. I'm using a Modbus ProSoft where I basically map data to a big INT array. Example, where GX_I_63HPU is a REAL, MNETC.DATA.WriteData[200] an...
Replies
21
Views
515
Good morning all, I'm integerating a device with a Rockwell PLC with V34 Studio 5000. The device reports error codes using a single integer to...
Replies
19
Views
1,328
Ex If I Read from Integer file N7:0 N7:0 is an 8 point input card , input 0 and 2 are on , rest off When I look at : N7:0 -7 6 5 4 3 2 1 0 I...
Replies
5
Views
780
The analog array has 16 individual bits and each bit is an alarm. SCADA is having issues getting the BIT bool value. However they can get the...
Replies
9
Views
1,058
I set up a Mitisubishi test system on the bench. Q03UDSPU Q173DCPU MR-J3-40B HF-KP43 HMI is a LS XP50 TTA/KP43 I am trying to use a signed...
Replies
1
Views
406
Back
Top Bottom