g+
g+ Communities
Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
<== Date ==> <== Thread ==>

Subject: Re: aiRecord conversion
From: Benjamin Franksen <benjamin.franksen@helmholtz-berlin.de>
To: <tech-talk@aps.anl.gov>
Date: Thu, 30 Aug 2012 01:32:21 +0200
Am Donnerstag, 30. August 2012, 00:42:48 schrieb Michael Davidsaver:
> On 8/28/2012 1:08 PM, Eric Norum wrote:
> > On Aug 28, 2012, at 9:42 AM, Bruno Seiva Martins
> > <brunoseivam@gmail.com <mailto:brunoseivam@gmail.com>> wrote:
> >
> > ...
> >
> > The documentation at
> > https://wiki-ext.aps.anl.gov/epics/index.php/RRM_3-14_Analog_Input#specia
> > l_linconv describes this pretty well:
> >
> > special_linconv(precord,after)
> >
> > This routine is called whenever any of the fields LINR, EGUF, EGUL or
> > ROFF is modified. To support linear conversion, EOFF and ESLO must be
> > set accordingly. The record support sets EOFF to EGUL before calling
> > this routine, which is the very common case when RAWL is zero below.
> >
> > A useful formula for calculating EOFF and ESLO is this one:
> >
> > EOFF = (RAWF * EGUL - RAWL * EGUF) / (RAWF - RAWL)
> > ESLO = (EGUF - EGUL) / (RAWF - RAWL)
> >
> > Here, RAWL and RAWF are the lowest resp. highest possible raw value.
> > For instance, a 16 bit bipolar ADC might have RAWL=-0x7fff, RAWF=0x7fff.
>
> Did RAWF and RAWL ever exist in a 3.14 release?
>
> A quick search through VCS history shows that these fields only existed
> briefly between 3.14.0-alpha2 and -beta1 (circa 2001).
>
> It would be nice to have them, then linear conversions would be
> unambiguous defined by fields and we could do without special_linconv().

It's interesting that you ask. When I wrote the above lines I did not suspect
that they had ever been actual fields, once. I used them only as a notational
device, though I agree that it would be much nicer to just let device support
set RAWF and RAWL (as part of init_record); the record support could then
calculate ESLO/EOFF from these and EGUF/EGUL -- and the other way around, too,
e.g. user changes EOFF or ESLO => record support updates EGUF and EGUL.

Is this a change that could be made for 3.15 or is it too disruptive?
--
Ben Franksen
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführung: Prof. Dr. Anke Rita Kaysser-Pyzalla, Thomas Frederking

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de


Replies:
Re: aiRecord conversion Andrew Johnson
References:
aiRecord conversion Bruno Seiva Martins
Re: aiRecord conversion Eric Norum
Re: aiRecord conversion Michael Davidsaver

Navigate by Date:
Prev: Re: aiRecord conversion Michael Davidsaver
Next: Mass PV assign and event flag sync [was: Creating INLINK/OUTLINK in record support] Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
Navigate by Thread:
Prev: Re: aiRecord conversion Michael Davidsaver
Next: Re: aiRecord conversion Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICSv4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·