EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: Re: Device Driver Initialization routine
From: Andrew Johnson <[email protected]>
To: [email protected]
Date: Tue, 2 Dec 2008 11:45:43 -0600
On Tuesday 02 December 2008 11:19:50 David Dudley wrote:
> I read in section 12.5.6 (page 186) of the "IOC Application Developers
> Guide" that the Init Record routine calculates ESLO and EOFF.
>
> Do I need to do that from within my device driver, or is it done
> automatically somewhere?

The record support code doesn't know the raw range of your analog I/O values, 
so it can't calculate ESLO for you.  That's why your ai/ao device support is 
responsible for setting it, in both the Init Record and Special Linear 
Conversion routines.  You only need to set EOFF if its value is not the same 
as EGUL, so in most cases the calculation is a one liner, e.g. for a 16-bit 
ADC/DAC:

    prec->eslo = (prec->eguf - prec->egul)/65535.0;


The device's special_linconv() routine is only called when LINR is LINEAR; the 
user can set ESLO and EOFF manually when LINR is SLOPE.

Of course this all assumes that your device support is using the RVAL field; 
if it directly handles floating-point values in the VAL field then LINR, 
EGUL, EGUF, ESLO and EOFF are not relevent anyway.

HTH,

- Andrew
-- 
Talk is cheap. Show me the code. -- Linus Torvalds

Replies:
Re: Device Driver Initialization routine David Dudley
References:
Device Driver Initialization routine David Dudley

Navigate by Date:
Prev: Device Driver Initialization routine David Dudley
Next: Re: sscan compile error on base 3.14.10 on linux Andrew Johnson
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Device Driver Initialization routine David Dudley
Next: Re: Device Driver Initialization routine David Dudley
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·