Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: davidbgtx on June 15, 2015, 08:13:27 PM

Title: Real in data view only accepts 7 or 8 digits
Post by: davidbgtx 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.
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: b_carlton 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.
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: franji1 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? 
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: davidbgtx 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.
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: davidbgtx 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.
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: b_carlton 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.
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: BobO 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.
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: franji1 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.
Title: Re: Real in data view only accepts 7 or 8 digits
Post by: davidbgtx 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.