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  <20092010  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  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: 答复: how to change the MEAN without reboot IOC?
From: 汪启胜 <[email protected]>
To: "Andrew Johnson" <[email protected]>, <[email protected]>
Cc: Michael Abbott <[email protected]>
Date: Tue, 17 Mar 2009 08:51:54 +0800
Title: ´ð¸´: how to change the MEAN without reboot IOC?

Hi,all

Thanks your reply and discussion. All of these is very helpful to me. Andrew's suggestion is a good resolution to me. I can define several record to the same module.

Best regards,
Wang Qisheng
===================================================
No.239 Zhangheng Road
PuDong District
Shanghai Institute of Applied Physics CAS
Shanghai, China
Tel: +86-21-33933256  Fax: +86-21-33933031



-----Original Message-----
From: [email protected] 代表 Andrew Johnson
Sent: 2009-3-16 (星期一) 23:00
To: [email protected]
Cc: Michael Abbott
Subject: Re: how to change the MEAN without reboot IOC?

Hi Michael,

On Monday 16 March 2009 03:38:35 Michael Abbott wrote:
> On Mon, 16 Mar 2009, Gasper Jansa wrote:
> > You can use extended device support to support changes to INP/OUT fields
> > in runtime. See chapter 12.5 of Application developer's guide.
>
> Thanks, wasn't aware of this.  Look like that support was added to 3.14.8
> (which happens to be the version we've been using for ages...)
>
> Took a little reading to make sense, think I understand it now: is the
> idea that every time a write to INP occurs my record will first receive a
> del_record() callback follwed by an add_record() callback?

It's not the record, it's the device support that provides those routines.

> Do I have any idea about the new INP and DTYP values at the time
> del_record() is called, or do I have to assume that I'm going to have to
> completely detach the record?  I guess the model is that writing to
> DTYP/INP are complete changes of record context -- I guess I can work with
> that.

To change to a different device support layer, you have to set the DTYP field
to the new value before the INP/OUT field.  That by itself does nothing. 
Then when you set the INP/OUT field, the IOC checks that both the old and new
device layers support the address change, disables I/O Interrupt scanning to
the record, then calls the old support's del_record() routine.  This may
return an error status if it doesn't want the change to occur for any reason,
but otherwise it much completely detach from the record (it could conceivably
look at the DTYP field at this point to see whether it's going to get the
record back, but it has no way of knowing the hardware address that is being
set at this point so I really don't recommend trying this).

If everything is Ok, the IOC then free()s the old INP/OUT link structure and
calls the record's special() routine at this point if the field is thus
marked.  Next it sets the INP/OUT field to its new value and again calls the
record's special() routine if thus marked.  DPVT is now cleared and the DSET
field is configured according to the DTYP field, then it calls the new device
support layer's add_record() routine.  This can also reject the record by
returning an error if it wishes.  After resetting I/O Interrupt scanning if
it was in use before, the IOC finally posts any CA monitor events on the
field.

All this is implemented in the dbPutFieldLink() routine inside
base/src/db/dbAccess.c if you want to see the details.

Hope this helps; feel free to post follow-up questions.


To answer Wang Qisheng's original question, the device support you are using
is unlikely to allow the INP field to be changed because it doesn't implement
the extended interface, although it could.  Until that happens, could you
define several records pointing to the same Hy8401ip module and signal with
different values for MEAN, then just pick a different record to look at at
runtime?

- Andrew
--
The best FOSS code is written to be read by other humans -- Harold Welte


Replies:
Re: ´ð¸´: how to change the MEAN without reboot IOC? Maren Purves
References:
how to change the MEAN without reboot IOC? 汪启胜
Re: how to change the MEAN without reboot IOC? Gasper Jansa
Re: how to change the MEAN without reboot IOC? Michael Abbott
Re: how to change the MEAN without reboot IOC? Andrew Johnson

Navigate by Date:
Prev: Re: Help building EPICS 3.14.9 for RTEMS Till Straumann
Next: Newbie - stuck at makeBaseApp.pl Jeffrey Holt
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: how to change the MEAN without reboot IOC? Andrew Johnson
Next: Re: ´ð¸´: how to change the MEAN without reboot IOC? Maren Purves
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  <20092010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 31 Jan 2014 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·