EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  <19971998  1999  2000  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  <19971998  1999  2000  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: ai record support has an error
From: Marty Kraimer <[email protected]>
To: [email protected]
Date: Tue, 21 Oct 1997 07:56:27 -0500
Benjamin Franksen wrote:
> 
> Hi again,
> 
> I fear the aoRecord is 'infected' by the same kind of disease, as one
> can see by looking into the init_record() and convert() functions. In
> the first case the solution is the same as in the aiRecord, replace
> 
>         val = pai->rval + pai->roff;
> 
> in init_record() by
> 
>         val = (double)pai->rval + (double)pai->roff;
>

This one I remembered to do.
 
> In the second case (convert()) it goes the other way around: First val
> is streched according to eslo as in
> 
>         value = (value - pao->egul) / pao->eslo;
> 
> Afterwards roff is subtracted:
> 
>         pao->rval -= pao->roff;
> 
> As in the aiRecord, if egul and eguf are assuming 32 bit raw values,
> this can lead to an overflow. Proposed solution: replace the last 4
> lines of convert():
> 
>         if (value >= 0.0) pao->rval = value + 0.5;
>         else    pao->rval = value - 0.5;
>         pao->rval -= pao->roff;
>         return;
> 
> by these three:
> 
>         if (value >= 0.0) pao->rval = value - pao->roff + 0.5;
>         else    pao->rval = value - pao->roff- 0.5;
>         return;
>


This one I did not remember.

I will make the change

Marty Kraimer

References:
ai record support has an error Benjamin Franksen
Re: ai record support has an error Marty Kraimer
Re: ai record support has an error Benjamin Franksen

Navigate by Date:
Prev: Re: R3.13.beta11 & Tornado 1.0.1 Ralph Lange
Next: Re: R3.13.beta11 & Tornado 1.0.1 Marty Kraimer
Index: 1994  1995  1996  <19971998  1999  2000  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: Re: ai record support has an error Benjamin Franksen
Next: Subarray records with a minummum profile Hammonds, John
Index: 1994  1995  1996  <19971998  1999  2000  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 ·