ChadOut Member C Join Date Jan 2013 Location Texas Posts 1 Jan 24, 2013 #1 I am trying to track position with Siemens ladder logic. I have only a (real value) from HMI. Using ADD_R If input 1 is -1000 and input two is +2000 will out be null or +1000 ? Last edited: Jan 24, 2013
I am trying to track position with Siemens ladder logic. I have only a (real value) from HMI. Using ADD_R If input 1 is -1000 and input two is +2000 will out be null or +1000 ?
KalleOlsen Member K Join Date Oct 2008 Location Norway (moustache area) Posts 1,782 Jan 25, 2013 #2 ChadOut said: I am trying to track position with Siemens ladder logic. I have only a (real value) from HMI. Using ADD_R If input 1 is -1000 and input two is +2000 will out be null or +1000 ? Click to expand... It will be -1000.0 + 2000.0 = 1000.0 = +1.0000e+3) You might experience rounding errors like +9.99999e+2 or 1.000001e+3. So you must never compare a real value on sharp equality, it must be compared within dead band limits. Kalle
ChadOut said: I am trying to track position with Siemens ladder logic. I have only a (real value) from HMI. Using ADD_R If input 1 is -1000 and input two is +2000 will out be null or +1000 ? Click to expand... It will be -1000.0 + 2000.0 = 1000.0 = +1.0000e+3) You might experience rounding errors like +9.99999e+2 or 1.000001e+3. So you must never compare a real value on sharp equality, it must be compared within dead band limits. Kalle