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: Luedeke Andreas <[email protected]>
To: [email protected]
Date: Wed, 28 Jul 2010 10:45:42 +0200
 Angus Gratton wrote on 27/07/10 01:00:
> Thanks Ralph & Mark.
>
> On Mon, 2010-07-26 at 09:40 -0400, Ralph Lange wrote:
>   
>> 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 - 
> OK, sounds great. It's possible to have device support set the defaults
> though, right? To avoid the designer having to repeat themselves in each
> record if they just want the default case?
>   
Hi Angus,
I think this part of your question has been only partially answered.

If I understood correctly, you want to have a two-step conversion:
1.) convert from physical units (double) to DAC output voltage (double)
2.) convert from output voltage (double) to DAC 16 bit integer (int16)
While the first part has to be configured in the database, the second
should be set automatically
depending on your OUT link.

I think this makes sense, if the device support actually sets the output
mode of the DAC.
If the mode is jumpered, why should the device support know at all how?
It would be fully sufficient to do the conversion in the record support
via EGUF/EGUL,
the device support just passes the int16 to the DAC.
Therefore you would not need the VMEIO parameter string at all, just
specify card and signal.
That way, all information needed is in the EGUF/EGUL/EGU fields: it is
maybe wrong, but not inconsistent :-)

In case you can set the DAC polarity and range from the driver,
you will have the problem that it is not foreseen in the normal "ao"
record support to have a two stage conversion.
It will use EGUF/EGUL to convert a double (either physical units or
output voltage) to an integer.
You could set EGUF/EGUL from the device support, depending on your
parameter string in the OUT link.
But EGUF/EGUL is normally set in the database, so it would may confuse
some people.
If you still want to do it, you could call your parameter like "...@5V
BIP setEGUx" to give a hint
and then set EGUF/EGUL and EGU.
Another "standard" way would be to handle everything in the database
template:
Your parameter string could be defined like "...@$(EGU) $(EGUL) $(EGUF)"
and allowed values are:
for 5V bipolar -> {EGU=V,EGUL=-5,EGUF=+5} -> "...@V -5 +5"
for 10V unipolar -> {EGU=V,EGUL=0,EGUF=10} -> "...@V 0 10"
Those substitution values can be used to define the fields, too:

    record(ao,"xxx") {

        field(DTYP,"DACyyy")
        field(OUT,"#C$(CARD) S$(SIGNAL) @$(EGU) $(EGUL) $(EGUF)")
        field(EGU,"$(EGU)")
        field(EGUL,"$(EGUL)")
        field(EGUF,"$(EGUF)")

    }
      

In both cases I would suggest a second record to convert from
engineering units to output voltage.

Another case where we wanted to have a two-stage conversion at the SLS
was a pre-calibrated DAC.
The DAC have some, hopefully little systematic non-linearity.
You can measure those with a precise volt-meter and generate breakpoint
tables from those measurement.
If you do that, you get a perfectly linear DAC over the full range.
In particular, if you ever have to change the DAC, you put in a new DAC,
change to the new breakpoint table and the output voltages will be
perfect again.
But then of course you should not mix physical unit conversion with the
DAC voltage conversion,
but have two independent records.

Andreas

Replies:
Re: Analog output device support design Ralph Lange

Navigate by Date:
Prev: Tech-talk archives excluded from indexing? Angus Gratton
Next: Developing of record / driver / device support? Asyn? Gorka Ronda
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 Angus Gratton
Next: Re: Analog output device support design Ralph Lange
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 ·