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: Index of highest value
From: "Lawrence T. Hoff" <[email protected]>
To: <[email protected]>
Date: Sat, 18 Dec 2004 09:56:01 -0500
	In my application, I have a dozen "stripping foils", only 
one of which can be in use at a time. Each foil degrades with use
(related to aggregate number of particles stripped). I plan to
associated a "goodness" (or "badness") factor with each foil 
(something like a battery capacity indicator in a cell phone).
Let's assume this means a dozen analog records of some sort,
one for each foil.

	Ideally, I will provide a facility where a user can say:
"insert the best foil", which will find the foil with the highest
"goodness factor", and substitute that foil for the current one.

	To do this, I need to find the index of the foil with the
highest "goodness factor", and pass that index to the foil drive 
mechanism.

	I will probably use some sort of subroutine record to
achieve this. However, as a mental exercise, I tried to think
of how to do this with "standard" EPICS records. I could
not come up with what I thought was a "clean" solution!
Maybe someone can offer a suggestion about what I might be
missing?

	I.e. I realize that I can find the highest "goodness
factor" via a SEL record. As far as I know, that can provide
the highest value, but not which input that value came form.

	I also realize that I can use CALC records, and can
even use both the "goodness factors", and the SEL record output
as inputs to the CALC record. However, I cannot think of a 
CALC expression to compute the index, within the constraints
of the CALC field length limit. I.e. if the raw values are
in fields A-K, and the highest value (from the SEL record)
is in L, the obvious expression is:

"K==L?10:J==L?9:I==L?8:H==L?7:G==L?6:F==L?5:E==L?4:D==L?3:C==L?2:B==L?1:
0"

which is too long (AFAIK).

	I could break up the calculation into several CALC
records, or use a SEQ record to re-use a CALC record with
different formulas, but it seems to me that once the use of 
records exceeds some level of complexity, a subroutine record 
is called for.

Suggestions?

-- Larry




Replies:
Re: Index of highest value Andrew Johnson
Re: Index of highest value Tim Mooney

Navigate by Date:
Prev: RE: Looking for an obsolete IP chip Chestnut, Ronald P.
Next: EPICS VLINAC demo on MacOS X (darwin) Stephen Lewis
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: RE: Looking for an obsolete IP chip Chestnut, Ronald P.
Next: Re: Index of highest value Andrew Johnson
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 ·