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: Russell Redman <[email protected]>
To: Mark Rivers <[email protected]>, <[email protected]>, <[email protected]>
Date: Tue, 07 Dec 2004 08:43:30 -0800
Title: Re: Initial value readback from hardware into output records
I am curious about a closely related issue that I fear will arise when  we try to upgrade our version of EPICS from 3.13.8 to use the newer software.  My code runs in both hardware and simulation modes to allow the software to be tested without having the hardware attached.  When the IOC boots, it does not know which mode it is supposed to be in.  The operator sets HARDWARE/SIMULATION mode flag, then runs an INITIALISE action to open communications with hardware or with the simulator, as appropriate.  Very bad things happen if the EPICS drivers attempt to read back values from nonexistent hardware, and I have put a considerable effort into the startup code to ensure that I/O records do not process on startup.

So here is my question: How can I PREVENT an output record from reading back a value during init_record from hardware that may or may not exist?

Cheers,
Dr. Russell O. Redman
Tel: (250) 363-6917 | Fax: (250) 363-0045
<mailto:[email protected]>
National Research Council Canada | Conseil national de recherches Canada
5071 West Saanich Road           | 5071 West Saanich Road
Victoria, B. C. V9E 2E7          | Victoria, C.-B. V9E 2E7
Government of Canada             | Gouvernement du Canada
--





On 2004-12-07 5:15 AM, "Mark Rivers" <[email protected]> wrote:

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




References:
RE: Initial value readback from hardware into output records Mark Rivers

Navigate by Date:
Prev: RE: Initial value readback from hardware into output records Mark Rivers
Next: RE: Initial value readback from hardware into output records Mark Rivers
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 Mark Rivers
Next: Re: Initial value readback from hardware into output records 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 ·