Experimental Physics and Industrial Control System
The ALS uses a sub record:
record(sub,"$(IOC):exit") {
field(DESC,"Exit subroutine")
field(SCAN,"Passive")
field(SNAM,"exitSubroutine")
}
with:
static void exitSubroutine(subRecord *precord) {
epicsExit((precord->a == 0.0) ? EXIT_SUCCESS : EXIT_FAILURE);
}
epicsRegisterFunction (exitSubroutine);
Processing this causes the IOC to exit.
On Oct 5, 2012, at 9:42 AM, "Hu, Yong" <[email protected]> wrote:
> 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: [email protected] [mailto:[email protected]] On Behalf Of Mark Rivers
> Sent: Friday, October 05, 2012 10:42 AM
> To: Tim Mooney; Di Maio Franck
> Cc: [email protected]
> 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
>
--
Eric Norum
[email protected]
- References:
- Triggered autosave on exit Di Maio Franck
- Re: Triggered autosave on exit Tim Mooney
- RE: Triggered autosave on exit Mark Rivers
- RE: Triggered autosave on exit Hu, Yong
- Navigate by Date:
- Prev:
RE: Triggered autosave on exit Hu, Yong
- Next:
RE: Lambda-TDK Genesys support Szalata, Zenon M.
- 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
2022
2023
2024
- Navigate by Thread:
- Prev:
RE: Triggered autosave on exit Hu, Yong
- Next:
Re: Triggered autosave on exit Tim Mooney
- 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
2022
2023
2024