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  <20122013  2014  2015  2016  2017  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
<== Date ==> <== Thread ==>

Subject: RE: Triggered autosave on exit
From: "Hu, Yong" <yhu@bnl.gov>
To: "'Mark Rivers'" <rivers@cars.uchicago.edu>, Tim Mooney <mooney@aps.anl.gov>, Di Maio Franck <Franck.DiMaio@iter.org>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Fri, 5 Oct 2012 16:42:42 +0000
Franck's use case of the autosave is very interesting, but I guess it may take efforts to find the solution. I have tried different ways on Linux softioc:

1. I tried to add manual_save() to the xxxMain.cpp. Something like these:

    iocsh(NULL);
    manual_save("xxx.req");
    epicsThreadSleep(2);
    epicsExit(0);

However, this will not work since manual_save() is only available in the autosave module and it is not included in the EPICS base. 

2. I tried to use create_triggered_set() in the startup script file (st.cmd) just as Tim's suggestion. Also I used the devIocStats module which provides a PV named "yhuHost:SYSRESET" to reboot the IOC. Here are the configurations for st.cmd and db file: 

st.cmd:

    create_monitor_set("auto_settings.req",30,"P=xxx:")
    create_triggered_set("auto_settings.req","yhuHost:resetIOC","P=xxx:")

db file:

    record(bo,"yhuHost:resetIOC")
    {
        field(ZNAM,"NoRest")
        field(ONAM,"Reset")
        field(FLNK,"yhuHost:seqExample")
    }

    record(seq,"yhuHost:seqExample")
    {
	  #delay 2 seconds to reboot the IOC
        field(DLY1,"2")
        field(LNK1,"yhuHost:SYSRESET.PROC ")
    }

When I do "caput yhuHost:resetIOC 1", the autosave is really executed (the save file "auto_settings.save" is written) and then about 2 seconds later, there is a message output "IOC reboot started" from the softioc. However, the IOC is not really rebooted, it is hung up (I still see the Shell "epics>"). 

Any suggestion about my second approach? Any other better way?

Thanks,

Yong 

-----Original Message-----
From: tech-talk-bounces@aps.anl.gov [mailto:tech-talk-bounces@aps.anl.gov] On Behalf Of Mark Rivers
Sent: Friday, October 05, 2012 10:42 AM
To: Tim Mooney; Di Maio Franck
Cc: tech-talk@aps.anl.gov
Subject: RE: Triggered autosave on exit

Can I have a PV that does that when I type "exit" on my softIoc?

I agree that what Frank suggests would be very nice.

Mark


________________________________________
From: tech-talk-bounces@aps.anl.gov [tech-talk-bounces@aps.anl.gov] on behalf of Tim Mooney [mooney@aps.anl.gov]
Sent: Friday, October 05, 2012 9:08 AM
To: Di Maio Franck
Cc: tech-talk@aps.anl.gov
Subject: Re: Triggered autosave on exit

Franck,

You can use a trigger PV to cause the save set to be written whenever the trigger PV posts a value.
You can do this with a monitor save set that is also monitored:

   create_monitor_set("auto_settings.req",30,"P=xxx:")
   create_triggered_set("auto_settings.req","xxx:myTrigger","P=xxx:")

Because the save-set name is the same in both calls, the second doesn't add a new save set, but instead adds a new method to the existing save set.

Tim

----- Original Message -----
From: "Di Maio Franck" <Franck.DiMaio@iter.org>
To: tech-talk@aps.anl.gov
Sent: Friday, October 5, 2012 4:55:12 AM
Subject: Triggered autosave on exit

Dear Experts, Gurus and Educated Friends

A question that probably already popped-up in the past...

If we want that when the IOC process exits (in an healthy state) because it has been requested so (i.e. not crashed), the autosave is executed before the exit ... how can that be done?

The objective is to prevent that the changes made few seconds before a "restart" are lost (a use case during tests).
And we don't want to reduce the autosave period only for this case.

Thanks!

Franck


Franck Di Maio
CODAC System Designer
CODAC Section

ITER Organization, Building 519/027, CHD, Control System Division Route de Vinon sur Verdon - 13115 St Paul Lez Durance - France
Phone: +33 4 42 17 64 05



--
Tim Mooney (mooney@aps.anl.gov) (630)252-5417 Software Services Group (www.aps.anl.gov) Advanced Photon Source, Argonne National Lab


Replies:
Re: Triggered autosave on exit Eric Norum
Re: Triggered autosave on exit Tim Mooney
References:
Triggered autosave on exit Di Maio Franck
Re: Triggered autosave on exit Tim Mooney
RE: Triggered autosave on exit Mark Rivers

Navigate by Date:
Prev: Re: EPICS 3.15.0 incompatible make rules Ralph Lange
Next: Re: Triggered autosave on exit Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
Navigate by Thread:
Prev: RE: Triggered autosave on exit Mark Rivers
Next: Re: Triggered autosave on exit Eric Norum
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  <20122013  2014  2015  2016  2017 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·