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  <20112012  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  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Handling failures in st.cmd
From: Till Straumann <[email protected]>
To: Benjamin Franksen <[email protected]>
Cc: [email protected]
Date: Thu, 12 May 2011 20:02:16 -0500
On 05/12/2011 07:31 PM, Benjamin Franksen wrote:
Am Freitag, 13. Mai 2011, um 02:07:20 schrieb Ernest L. Williams Jr.:
Till Straumann wrote:
On 05/12/2011 05:22 PM, Zelazny, Michael Stanley wrote:
If, for example, dbLoadRecords, initializing some hardware module,
cd("some/dir"), etc. fails while an IOC is booting, is there any way to
trap this in my st.cmd and take an action, such as abort the IOC boot?

Under RTEMS (cexpsh shell -- every line is a C expression)
you can easily do that (provided that the routine you want to trap
returns a status)

dbLoadRecords(...)&&  bsp_reset()

will reset the board if dbLoadRecords() returns
a non-zero value.

However, rebooting is maybe not the best way to
handle this since you will most likely end up in
an endless loop (since the error condition doesn't
go away with a reboot).

What we really want is for the whole process to just stop.
For example, in RTEMS if there is an undefined symbol the system errors
out and stops.
Or is that vxWorks, I am thinking of?

If I remember correctly,  I have once done this for VxWorks by calling
exit(EXIT_FAILURE). This will abort the shell task and the boot process stops.
It will, however, not stop other tasks that have aleady been started, so is
useful only until shortly before iocInit completes.

Under RTEMS

exit()

shuts down the executive, i.e., all tasking is stopped and the
entire system tries to return to the environment from where
it was started.

MotLoad based boards cannot return to the MotLoad environment since
essential data structures of MotLoad have been destroyed (RAM, interrupt
vectors etc.). Therefore, the BSP resets the board after RTEMS shuts
down. Hence, exit() is not much different from bsp_reset() but it does
e.g., execute all the atexit() hooks etc. I'm not sure (off my head)
at what point C++ global destructors are executed.

T.

Cheers
Ben

________________________________

Helmholtz-Zentrum Berlin für Materialien und Energie GmbH

Mitglied der Hermann von Helmholtz-Gemeinschaft Deutscher Forschungszentren e.V.

Aufsichtsrat: Vorsitzender Prof. Dr. Dr. h.c. mult. Joachim Treusch, stv. Vorsitzende Dr. Beatrix Vierkorn-Rudolph
Geschäftsführer: Prof. Dr. Anke Rita Kaysser-Pyzalla, Prof. Dr. Dr. h.c. Wolfgang Eberhardt, Dr. Ulrich Breuer

Sitz Berlin, AG Charlottenburg, 89 HRB 5583

Postadresse:
Hahn-Meitner-Platz 1
D-14109 Berlin

http://www.helmholtz-berlin.de



References:
Handling failures in st.cmd Zelazny, Michael Stanley
Re: Handling failures in st.cmd Till Straumann
Re: Handling failures in st.cmd Ernest L. Williams Jr.
Re: Handling failures in st.cmd Benjamin Franksen

Navigate by Date:
Prev: Re: Handling failures in st.cmd Till Straumann
Next: WAGO 750 Stepper/DC-Drive Controller with EPICS? Heiniger Martin
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Handling failures in st.cmd Benjamin Franksen
Next: EPICS support for Delta Tau UMAC system Zhan Zhang
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  <20112012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 18 Nov 2013 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·