5/21/2012 8:36 PM | |
Joined: 10/31/2011 Last visit: 11/12/2024 Posts: 400 Rating: (5) |
Dear Ayman, I m using the same block and AI value is working correctly..
|
5/21/2012 9:26 PM | |
Joined: 10/7/2005 Last visit: 11/18/2024 Posts: 3027 Rating: (1057)
|
Hello m.shoaib khatana You are doing 36000 additions to calculate the Total (one addition every 100ms over one hour). What this means in your case is that your AI value (which is an hourly flow value) gets divided by 36000 and the fraction of that actual value is then addedto the total every 100ms. The precision of a floating point value is "only" 6 decimal placesand as you add a rather small value to an every increasing larger total, the required alignment of the exponents will lead to a loss of precision (values get truncated in this alignment). This will in your caseleadto an accumulated value that is too small and you'll find more info on this at How accurately can I calculate with REAL numbers that are used in extensive formulas? Possible Solutions: 1.) Do a totalevery minute and add these totals together 60 times to get the hourly total. 2.) If your steam flow is rather steady, call the totalizer block only lets say every 10 seconds instead of every 100ms. Give it a try and please let us know if it helped. |
Last edited by: fritz at: 5/21/2012 9:46 PMChanged the term"digit" to "decimal places" to remove ambiguity (thanks Juergen) Cheers |
|
This contribution was helpful to4 thankful Users |
5/21/2012 9:28 PM | |
Joined: 10/31/2011 Last visit: 11/12/2024 Posts: 400 Rating: (5) |
Here code in ob35 CALL "Totalizer" , DB200 IN0 :=DB1.DBD48 IN1 :=T#1H IN2 :=T#100MS IN3 :=M700.0 OUT4:=DB8.DBD8 |
5/22/2012 6:04 PM | |
Joined: 10/7/2005 Last visit: 11/18/2024 Posts: 3027 Rating: (1057)
|
Hello Selvam_viji assuming my theory that the problem is caused by the precision of a floating point value is correct, I'm afraid to say that your suggestion will make the problem worse instead of better. |
Cheers |
|
This contribution was helpful to2 thankful Users |
Follow us on