Bits

I have a program that reads an encoder. I am moving the encoder value HSC:0.acc to N7:0. I need to read values greater than 32767.
Can I get a 32 bit address? I'm using RSLogix 500.
Thank you
Phil
 
If you use a floating-point register, you'll lose accuracy after about 7 million counts.

Because you mention the HSC:0 function file, I presume you're using a MicroLogix 1200 or 1500 controller. Those support the Long Integer (L) data type, which is a 32-bit signed integer.

Try moving or copying your HSC:0.ACC value into an element in a L-type data table file.
 
Which PLC are you using? The accumulated count in a 1200 or 1500 is a Long Word which will give you up to a huge number. If you have long integers available, move it into that.

Edit - the master go in his answer first.
 
Ken Roach said:
If you use a floating-point register, you'll lose accuracy after about 7 million counts.

Hi Ken, I'm curious what happens at 7 million counts, isn't the floating point file good for a much larger number? The RSLogix500 help file shows its good to 3.40282347e+38. Thanks.

P.S.
Sorry, I didn't catch the HSC:0.ACC; I should have assumed MicroLogix instead of SLC.
 
Use the long integer (L) type - that will get you into the billions of counts. Floating point provides a mantissa and an exponent (powers of 10). The mantissa is only so large.

Let's start with a simple concept. You get one digit to hold a number (0-9) and one digit (0-9) to hold 'how many zeros after that'

If your 'how many zeroes after that' is zero then using the first digit you can count from 0 to 9 in 1 number increments. If the 'how many zeroes after that' is 1 then you can count from 0 to 90 but only in jumps of 10. When you get to 9 in the 'how many zeroes after that' you are counting in jumps of 1 billion. So if you have 2 and 4 as your digits you have 20000. Now try to add just 1 to that using this system. You can't. You can add at a minimum 10000.

Are you getting the idea? The 3.40282347 in your post is the max that the first 'digit' register can hold. (The strange number is a binary/computer thing). The 38 is the largest that the 'how many zeroes after that' can hold. (Actually each of these can hold minus numbers also but I won't get into that)

The inability to add 'just one' as you get to bigger numbers is what Ken was referring to.
 

Similar Topics

Hello, I have noticed that in version 35 of Studio there are times that XIC/XIO bits get stuck and will not function properly. After toggling...
14
Replies
407
Views
I have an S7-1200 CPU 1214C DC/DC/DC, FW V4.2.2, connected to a KTP700 Basic PN using TIA Portal V21. PLC IP = 192.168.0.100 HMI IP =...
5
Replies
350
Views
Howdy! I am having a Beckhoff CX5230 communicate to a 1769-L18ERM over EtherNet/IP. I have communications working back and forth and things are...
5
Replies
422
Views
Hi Everyone, I am curious what the checkboxes under the "Minor Faults" tab in the controller properties actually do. I always assumed these were...
7
Replies
639
Views
I am working with logix designer studio 5000 on a compact logix L30ER. I don't work with this normally and I think that I am getting some of the...
4
Replies
476
Views
Top