Real Data Type limits

Join Date
Feb 2017
Location
Anniston, AL
Posts
24
Am I understanding correct that the "real" data type in an RSLogix 5000 is a 32-bit (double integer), but the "rules" change as needed?

Say I had a negative number, would it limit it to: -32767.9999847412109375 or somewhere there abouts?

I had a compactlogix limit me to: 65535.0 (approximately, I didn't write it down when it happened).

It appeared to limit the number at the MAX for an unsigned integer. Why wasn't the decimal portion at something other than a zero? Why would the limit be for an UNSIGNED integer? I was incriminating it with a small number (somewhere in the neighborhood of .00218666). o_O

The number just stopped btw. Kind of figured I would have had a minor fault showing..
 
The REAL is completely different from a DINT. It's an IEEE 754 single-precision floating point encoded value.

In general a REAL value in a ControlLogix can represent a value up to about 3.402823 × 10^38, but only to about six significant digits.

The problem I think you're encountering is that you're doing an accumulator using a small increment and at some point, the relative difference between the accumulated value and the increment value is zero, so the ADD instruction simply has no effect on the REAL value.

When the increment is 1, this happens at about 7 million.

Ideally, use an integer accumulator or some kind of rollover method when you need to do large accumulations of small increments.

There are numerous threads on this Forum and elsewhere on the Internet discussing this issue in computer science.
 
The REAL is completely different from a DINT. It's an IEEE 754 single-precision floating point encoded value.

In general a REAL value in a ControlLogix can represent a value up to about 3.402823 × 10^38, but only to about six significant digits.

The problem I think you're encountering is that you're doing an accumulator using a small increment and at some point, the relative difference between the accumulated value and the increment value is zero, so the ADD instruction simply has no effect on the REAL value.

When the increment is 1, this happens at about 7 million.

Ideally, use an integer accumulator or some kind of rollover method when you need to do large accumulations of small increments.

There are numerous threads on this Forum and elsewhere on the Internet discussing this issue in computer science.


I know it has been a while since I posted this, but I thought I would come back and say thanks! Your responses scattered throughout the web have helped me a lot in the past few months!
 

Similar Topics

Is there a way to use LREAL Data type on L71. I am getting 64 bit Double (IEEE754 Double precision 64-bit) data from a modbus device onto PLC via...
Replies
6
Views
952
Hi All, I'm using AB plc 5370(Modbus TCP slave progm type) with GE cimplicity scada V8.1. For DI,DO,AI communication is working good. But, I...
Replies
10
Views
2,551
Hi, Im new to SCL, but decided to start learning it - if only to be able to do some simple jobs such as indirect addressing. got some simple...
Replies
3
Views
6,901
Hi all, As you know, when reading from modbus floating point data (32 bits) by prosoft MCM card, we use real data type in controllogix to...
Replies
2
Views
7,048
Hi Iam using monitouch hmi(V9 soft) with omron plc cj2m (CX programmer). In this I want to read a data from hmi to plc. The data was like...
Replies
0
Views
94
Back
Top Bottom