EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  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  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Initialising an ao record from a constant DOL
From: Andrew Johnson <[email protected]>
To: Bob Dalesio <[email protected]>
Cc: "Owens, PH (Peter)" <[email protected]>, [email protected]
Date: Fri, 23 Apr 2004 09:45:37 -0500
Bob Dalesio wrote:
It could be made to work that way - but it doesn't work that way now. I believe that the DOL field is ignored if it is a constant. It seems so from what you've described.

Actually Bob, the code says you're wrong there, it probably changed since you wrote it. This is from the AO's init_record routine (R3.13.x, but should be the same in R3.14.x):


    /* get the initial value if dol is a constant*/
    if (pao->dol.type == CONSTANT) {
	if(recGblInitConstantLink(&pao->dol,DBF_DOUBLE,&pao->val))
	    pao->udf = FALSE;
    }

However you erre right about it doing the read on initialization, and that gave me the hint to what I think is happening. This code appears lower down in the same routine:

        status=(*pdset->init_record)(pao);
        switch(status){
        case(0): /* convert */
	    value = (double)pao->rval + (double)pao->roff;
	    if(pao->aslo!=0.0) value *= pao->aslo;
	    value += pao->aoff;
            if (pao->linr == menuConvertNO_CONVERSION){
		; /*do nothing*/
            }else if (pao->linr == menuConvertLINEAR){
                     value = value*pao->eslo + pao->eoff;
            }else{
                if(cvtRawToEngBpt(&value,pao->linr,pao->init,
			(void *)&pao->pbrk,&pao->lbrk)!=0) break;
            }
	    pao->val = value;
	    pao->udf=FALSE;
        break;
        case(2): /* no convert */
        break;

It looks to me like Pete's device support is returning a 0 from its init_record routine, when it should be returning a 2 as it hasn't properly set the RVAL field.

I think that explains the problem and where the correct solution needs to go - in ornlSerial. I'd suggest checking all of its output device supports which I believe should all do the same thing.

- Andrew
--
Dear God, I didn't think orange went with purple until I saw
the sunset you made last night.  That was really cool. - Caro


Replies:
Re: Initialising an ao record from a constant DOL Benjamin Franksen
References:
Re: Initialising an ao record from a constant DOL Bob Dalesio

Navigate by Date:
Prev: Re: Initialising an ao record from a constant DOL Luedeke Andreas
Next: Re: Initialising an ao record from a constant DOL David Maden
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Initialising an ao record from a constant DOL Bob Dalesio
Next: Re: Initialising an ao record from a constant DOL Benjamin Franksen
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  <20042005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·