8/10/2022 8:52 PM  
Joined: 2/20/2022 Last visit: 11/16/2022 Posts: 9 Rating: (0) 
Good afternoon, I'm making a simple flow totalizer as follows. FIT_TOT = FIT_TOT + (FIT_PV/5000) Where FIT_TOT is a Real variable. 5000 comes from l/S to M³ conversion with a Clock of 5Htz. My question is: I'm doing a Reset of the TOT_FIT variable through a button on the HMI. I wanted to do an automatic reset so as not to burst the maximum value supported by the Real variable. What would be the maximum value supported in the variable so that there are no problems? I've seen other manufacturers use the following logic: When FIT_TOT > 1E+09 FIT_TOT = 0.0 But I didn't understand the use of 1E+09 and I don't know if it would work on the S71200. Thank you very much.

Last edited by: Felipe Asbahr at: 08/10/2022 20:54:09Last edited by: Felipe Asbahr at: 08/10/2022 20:58:31 

8/10/2022 10:52 PM  
Joined: 9/19/2011 Last visit: 2/27/2024 Posts: 138 Rating: (33) 
Felipe, The correct notation for Siemens PLC's is 1.0E+09. Another notation is REAL#1.0e+9. The maximum value is just greater than +3.4E+38. Larry 
This contribution was helpful to1 thankful Users 
8/11/2022 8:38 AM  
Joined: 9/23/2005 Last visit: 2/28/2024 Posts: 4453 Rating: (693) 
Not knowing what order of magnitude is FIT_PV/5000 it is not possible to answer your question. Let's say minimum value you wish to record is 1. Then in case of a REAL data type it would be something like 10^6. You should rather move to a LREAL data type for this kind of task. Then it might happen that you do not need to reset at all. And do some learning on IEEE754 now. It will save you from pouring tears later. 
Regards, 

This contribution was helpful to2 thankful Users 
Follow us on