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: Initial value readback from hardware into output records
From: "Mark Rivers" <[email protected]>
To: <[email protected]>, <[email protected]>
Date: Tue, 7 Dec 2004 07:15:12 -0600
Benjamin Franksen wrote:

> Reading back initial values of output records via init_record (what is
> usually called 'warm reboot' or 'bumpless reboot') has never worked
> with asynchronous device supports. In particular, to my knowledge
> devGpib doesn't provided any support for warm reboot (I doubt the new
> asynDriver based GPIB support is any different here; if it is, I'd be
> interested to know).

The generic device support for EPICS records in asyn 4.0 sets the
initial values of output records to the current device value in
init_record.  

Here is the code from init_record for the ao record in devAsynInt32.c:
static long initAo(aoRecord *pao)
{
    devInt32Pvt *pPvt;
    asynStatus status;
    epicsInt32 value;

    status = initCommon((dbCommon *)pao,&pao->out,
        processCallbackOutput,interruptCallbackOutput);
    if (status != asynSuccess) return 0;
    pPvt = pao->dpvt;
    pasynInt32SyncIO->getBounds(pPvt->pasynUserSync,
                                &pPvt->deviceLow, &pPvt->deviceHigh);
    convertAo(pao, 1);
    /* Read the current value from the device */
    status = pasynInt32SyncIO->read(pPvt->pasynUserSync,
                      &value, pPvt->pasynUser->timeout);
    if (status == asynSuccess) {
        pao->rval = value;
        return 0;
    }
    return 2; /* Do not convert */
}

So it calls the driver's getBounds() method so that linear conversion
can work, and then calls asynInt32SyncIO->read() to get the current
value, setting ao->rval to that.  Note that since this is being done in
iocInit it is OK to wait, and a synchronous call is being used (no
callback needed).

One thing we did not get done in this release of asyn, but which we plan
to do in the next release, is more general support for updating the
output value when it changes for some other reason than the output
record writing to it.  Examples include:
- The value is changed from the device front panel by an operator
- The value is written by the asynDriver, called some other code besides
that output record.

In each case there will be ability for the output record device support
to request a callback when the output has changed.  The device support
will then be able to update the current value without writing it again.

Back to Stephen Banks original question, I don't think that the devGpib
component in asyn 4.0 does support bumpless reboot, but I don't use it
so I am not positive.

Mark




Replies:
Re: Initial value readback from hardware into output records Russell Redman
Re: Initial value readback from hardware into output records Benjamin Franksen

Navigate by Date:
Prev: Re: Initial value readback from hardware into output records Benjamin Franksen
Next: Re: Initial value readback from hardware into output records Russell Redman
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: Initial value readback from hardware into output records Benjamin Franksen
Next: Re: Initial value readback from hardware into output records Russell Redman
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 ·