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  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 
<== Date ==> <== Thread ==>

Subject: Re: Handling failures in st.cmd
From: Till Straumann <strauman@slac.stanford.edu>
To: "Ernest L. Williams Jr." <ernesto@slac.stanford.edu>
Cc: "tech-talk@aps.anl.gov" <tech-talk@aps.anl.gov>
Date: Thu, 12 May 2011 19:54:39 -0500
On 05/12/2011 07:07 PM, Ernest L. Williams Jr. wrote:
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.

On beatnik (and some other BSPs) you can do

dbLoadRecords() && BSP_panic("dbLoadRecords failed")


This will print a message to the console and wait
for the user to press a key and only then proceed to
reset the board.

HTH
-- Till


Or is that vxWorks, I am thinking of?

-- Ernest



HTH
-- Till




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.

Navigate by Date:
Prev: Re: Handling failures in st.cmd Benjamin Franksen
Next: Re: Handling failures in st.cmd Till Straumann
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 
Navigate by Thread:
Prev: Re: EPICS support for Delta Tau UMAC system Kevin Peterson
Next: RE: Handling failures in st.cmd Zelazny, Michael Stanley
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 
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 ·