EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Problem with epics alarm
From: Benjamin Franksen <[email protected]>
To: [email protected]
Date: Fri, 08 Oct 1999 20:49:15 +0200
Sue Witherspoon wrote:
> 
> The problem is in the epics alarm subroutine:
>   (snipit from an ai record)
> ...
> The comparison between a double and a float is okay as long as the precision of
> the comparison is not very large. For instance
> 
>  if val = 125303.000 and hihi = 125303.001 the above comparision
>  would give you an alarm.
> 
> On the surface the solution would be to change the type of hihi to
> be double but on further inspection the ascii file for this record
> says that the field is DBF_FLOAT? Does this imply that the
> size of the record must also change?

Yes, a DBF_FLOAT is compiled (by dbRecordtypeH) to 'float' and
DBF_DOUBLE to 'double'.

I never quite understood why so many of the ai and ao record's fields
are float instead of double. Another example where this leads to wrong
results are the AOFF and ASLO fields. You cannot represent a 32 bit
integer (RVAL) with a float without loosing precision.

I'd propose to make all analog fields doubles.

Ben


References:
Problem with epics alarm Sue Witherspoon

Navigate by Date:
Prev: Problem with epics alarm Sue Witherspoon
Next: Re: Problem with epics alarm Andrew Johnson
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Problem with epics alarm Sue Witherspoon
Next: Re: Problem with epics alarm Andrew Johnson
Index: 1994  1995  1996  1997  1998  <19992000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·