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: ? initHookRegister()
From: Marty Kraimer <[email protected]>
To: "Liyu, Andrei" <[email protected]>
Cc: [email protected]
Date: Mon, 19 Jan 2004 07:50:17 -0600
Liyu, Andrei wrote:
Hi,

	If I like to do some job during IOC initialization I should call
initHookRegister(). But I couldn't understand where (how) can I call
this function before iocInit()?

I can think of three ways.


1) Call your routine from the st.cmd file

Assume you have a function

    int initMyHook(void)
    {
        return(initHookFunction(myHookFunction));
    }


the st.cmd file contains initMyHook iocInit

2) Use a C++ static object.

   class initMyHook {
       public:
          initMyHook() {initHookFunction(myHookFunction);}
   }
   static initMyHook initMyHookObj;

The constructor initMyHook will get called for initMyHookObj at load time.

3) For 3.14.4 or later use the registrar facility

In your xxxInclude.dbd file the following must appear

registrar(myHook)

Your source file contains

   static void myHook(void)
   {
       static int firstTime = 1;
       if(!firstTime) return;
       firstTime=0;
       initHookFunction(myHookFunction);
   }
   epicsExportRegistrar(myHook);


For 3.14.4 and later method 3) is the recommended method.


	Can anybody write couple words about IOC deinitialization? Has
Epics similar hook here?


Sorry but iocCore is currently written to run forever. There is no deinitialization.


Thanks, Andrei.




Replies:
Re: ? initHookRegister() Ralph Lange
References:
? initHookRegister() Liyu, Andrei

Navigate by Date:
Prev: Re: Python MegaWidgets (Pmw) and Blt Noboru Yamamoto
Next: Re: ? initHookRegister() Ralph Lange
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: ? initHookRegister() Liyu, Andrei
Next: Re: ? initHookRegister() Ralph Lange
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 ·