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: "David Dudley" <[email protected]>
To: tech-talk <[email protected]>
Date: Tue, 2 Dec 2008 13:45:59 -0600
According to the 3.14 WIKI on the ai record, the ESLO and EOFF fields aren't configurable through the DCT.  I take it that that's wrong.  Should that be changed?
 
I assumed I couldn't do anything with it, so I didn't try, and used ASLO and AOFF instead, however looks like I need to correct some things.
 
Also, if you are using LINEAR, do you have to have a special_linconv() routine in the driver in order to get values scaled correctly?
David

On Tue, Dec 2, 2008 at 11:45 AM, Andrew Johnson <[email protected]> wrote:
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 Andrew Johnson
References:
Device Driver Initialization routine David Dudley
Re: Device Driver Initialization routine Andrew Johnson

Navigate by Date:
Prev: Re: sscan compile error on base 3.14.10 on linux Andrew Johnson
Next: Re: Device Driver Initialization routine 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: Re: Device Driver Initialization routine Andrew Johnson
Next: Re: Device Driver Initialization routine 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 
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 ·