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

Subject: Re: Process a record only when IOC shell exits
From: Andrew Johnson via Tech-talk <tech-talk at aps.anl.gov>
To: Ralph Lange <ralph.lange at gmx.de>, EPICS Tech Talk <tech-talk at aps.anl.gov>
Date: Thu, 15 Sep 2022 10:15:12 -0500
HI Andy,

On 9/15/22 4:23 AM, Ralph Lange via Tech-talk wrote:
On Thu, 15 Sept 2022 at 09:50, Wang, Andrew via Tech-talk <tech-talk at aps.anl.gov> wrote:
I am wondering if it is possible to have a record process only when the exit command is sent to the IOC Shell. 

Have a look at the different options for the PINI field. That's probably as close as you can get without coding.

Unfortunately PINI doesn't have a shutdown choice at all, which comes from the history that embedded IOCs didn't need to handle releasing resources at shut-down, so the IOC shutdown process wasn't very well defined.

I think the only way to do what you're wanting is to have some code register an epicsAtExit() routine as late as possible, either from an st.cmd command after iocInit or from initHookAfterIocRunning, and for its routine to trigger record processing. I would suggest having it call postEvent(eventNameToHandle("exit")) (after including dbScan.h to declare those routines) which would trigger all records that have SCAN="Event" and EVNT="exit".

HTH,

- Andrew
-- 
Complexity comes for free, Simplicity you have to work for.

References:
Process a record only when IOC shell exits Wang, Andrew via Tech-talk
Re: Process a record only when IOC shell exits Ralph Lange via Tech-talk

Navigate by Date:
Prev: Re: Question regarding synApps:delaygen Mark Rivers via Tech-talk
Next: Re: Yokogawa DL350 Wang, SuYin Grass via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
Navigate by Thread:
Prev: Re: Process a record only when IOC shell exits Ralph Lange via Tech-talk
Next: Question regarding synApps:delaygen Jörn Dreyer via Tech-talk
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  <20222023  2024 
ANJ, 15 Sep 2022 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·