News:

  • July 02, 2026, 05:43:00 AM

Login with username, password and session length

Author Topic: Real in data view only accepts 7 or 8 digits  (Read 11877 times)

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Real in data view only accepts 7 or 8 digits
« on: June 15, 2015, 08:13:27 PM »
Why can you only enter or display 7 or 8 digits in data view for a real? And it only passses 7 digits through modbus MHR1:RD to my kepwareex data collection software.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Real in data view only accepts 7 or 8 digits
« Reply #1 on: June 15, 2015, 11:20:37 PM »
How many digits did you expect? This is a limitation of floating point. Google 'floating point' and start reading.
An output is a PLC's way of getting its inputs to change.

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: Real in data view only accepts 7 or 8 digits
« Reply #2 on: June 16, 2015, 12:32:58 AM »
What are you actually measuring, how precise does it need to be, and what is the full range?

For example, is it time in seconds, to the millisecond, but for up to a week's worth of seconds, i.e. 7 x 24 x 60 x 60? 

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Re: Real in data view only accepts 7 or 8 digits
« Reply #3 on: June 16, 2015, 07:11:38 AM »
How many digits did you expect? This is a limitation of floating point. Google 'floating point' and start reading.
I was thinking real not floating point, thanks.

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Re: Real in data view only accepts 7 or 8 digits
« Reply #4 on: June 16, 2015, 07:12:57 AM »
What are you actually measuring, how precise does it need to be, and what is the full range?

For example, is it time in seconds, to the millisecond, but for up to a week's worth of seconds, i.e. 7 x 24 x 60 x 60? 

The precision is enough, I was just curious, forgot it was float not real, thanks.

b_carlton

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 606
    • thePLCguy
Re: Real in data view only accepts 7 or 8 digits
« Reply #5 on: June 16, 2015, 09:12:45 AM »
Quote
I was thinking real not floating point

I don't understand the distinction. Most PLCs use the IEEE 754 32 bit format. Were you thinking of something else. Your PC probably uses the 64 bit format with double the precision.
An output is a PLC's way of getting its inputs to change.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6164
  • Yes Pinky, Do-more will control the world!
Re: Real in data view only accepts 7 or 8 digits
« Reply #6 on: June 16, 2015, 09:20:46 AM »
We tend to use "real" and "floating point" interchangeably. But as Bernie mentioned, PCs are generally using double precision. The PLC uses single precision. Smaller storage size reduces the available precision.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3833
    • Host Engineering
Re: Real in data view only accepts 7 or 8 digits
« Reply #7 on: June 16, 2015, 09:22:29 AM »
In computer-land, typically real implies floating point representation.  So if you see a computer implementing "real numbers", it is most likely using floating point representation.

In the Mathematical world "real" has one meaning, and computers can only "approximate" this infinitely large set of numbers.  For example, the real value of the fraction 1/3 (0.333...) would require all the RAM in the world to represent it in a true "real" format, and then it would still be short by an infinite number of decimal places  ;D.

davidbgtx

  • Hero Member
  • *****
  • Posts: 215
  • Host be the Most
Re: Real in data view only accepts 7 or 8 digits
« Reply #8 on: June 16, 2015, 02:40:46 PM »
Quote
I was thinking real not floating point

I don't understand the distinction. Most PLCs use the IEEE 754 32 bit format. Were you thinking of something else. Your PC probably uses the 64 bit format with double the precision.

My SQL server database stores values collected from ThinkNDo (WINPLC) by way of KepserverEX. See attached pic. Shift1DownHrs set for float.

No biggie. I don't really need this much precision was just curious.