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  2008  2009  <20102011  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  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Analog output device support design
From: Ralph Lange <[email protected]>
To: EPICS tech-talk <[email protected]>
Date: Mon, 26 Jul 2010 09:40:36 -0400
Hi Angus,

On 25.07.2010 20:32, Angus Gratton wrote:
[...]
I'm thinking that each record's OUT link can specify what jumper
settings are applied on the channel, ie OUT, "#C2 S3 @5v BIP" says
channel #3 is jumpered 5v Bipolar.

The device support can then set default EGUF and EGUL values that will
automatically work via linconv to convert VAL written in volts to RVAL
which is the 16-bit integer that goes to hardware.

If the database designer wants to layer a more meaningful value over the
volts (ie degrees) then they create another database CALC record that
set the volts in the AO record.

As Mark pointed out, this is generally the way to go.


Note, though, that you don't need the additional CALC record to convert from something else. Instead of overwriting, Device Support should *use* the EGUL and EGUF values that the db designer created.
That way an ao with "...@5V BIP" and EGUF/EGUL = +/- 5 will convert from "output voltage" to the 16-bit integer your card needs, while setting EGUF/EGUL to something else will do the linear conversion from that "something else" range to your raw value. This is the whole point of having EGUF/EGUL/EGU as design fields - the only thing Device Support has to do is calculate the actual conversion factors, as only the Device Support reads the jumper info from the OUT link, and knows the bit width and other particularities of that device.


Please do not write your device support starting from scratch. Copy the device support for a device that is similar to yours, understand it, refactor to get all the names right, then apply the changes necessary for your specific hardware. That way you probably will not only learn a lot, but also have a better support library in less time.

Good luck!
Ralph


Replies:
Re: Analog output device support design Angus Gratton
References:
Analog output device support design Angus Gratton

Navigate by Date:
Prev: RE: Analog output device support design Mark Rivers
Next: Maven2 repository for EPICS Carcassi, Gabriele
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: Analog output device support design Mark Rivers
Next: Re: Analog output device support design Angus Gratton
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  <20102011  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 ·