Difference b/n Real Numbers in logix 5000

coreddl

Member
Join Date
Jan 2012
Location
Singapore
Posts
14
Hi chaps!!

Considering the following example of doing subtraction of 2 real number in rs logix 5000(L75),Why we are getting the result as .100000038 and why not exactly 0.1.

Example:
SourceA = 10.1
SourceB = 10.0
Destination=0.100000038
Above tags are of real types!

Cheers!
 
'Real' data types are always approximations. It's similar to .33333 being an approximation of the fraction 1/3. There is no way using a finite number of decimal digits to precisely represent 1/3. They are most accurate in storing x/10, x/100 etc.

The 'Real' data types are most accurate at storing x/2, x/4, x/8 etc.

Try this floating point calculator.

Note that '10.1' is stored in its best accuracy as 10.100000381469727

'10.0' because it doesn't have a fraction is stored accurately.

Thus the difference you receive.

Google 'Floating Point' or 'IEEE 754' and start reading.
 

Similar Topics

We have remote IO 1734-AENTR and all of them seem to be recognized in Logix except in, RIO-5000. When we look at the revision, all the ones that...
Replies
4
Views
743
From a FAT it appears that a struct containing bits/int/real can't be sent from a 1513 to a 1200. When using two 1513 there is no issue. Total...
Replies
5
Views
698
Hello, I have a problem with AO- and AA-Tags. When I use for example the tag AO_Test with the address 200 and type the value 1,2 in, the AA-Tag...
Replies
7
Views
1,411
Hi; We installed an orifice plate type steam flow transmitter which configured to give 4-20mA signal correspond to 0-9ton. I given that signal...
Replies
24
Views
5,611
As per the title. This might seem like a basic question to many, but I'm unclear about the difference between a coil ( ) and an application...
Replies
28
Views
4,042
Back
Top Bottom