EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: Record support and user-defined fields
From: Kay-Uwe Kasemir <[email protected]>
To: EPICS Core Talk <[email protected]>
Date: Tue, 05 Jul 2005 14:06:10 -0400
Hi:

On Jul 1, 2005, at 18:48, Benjamin Franksen wrote:
See V4 Database Access -> V4 Design: Assembling Record Support
Thanks for putting it up on the wiki.

What I don't understand is:
How do you get process() to include processInvalidOutput() at the chosen time?
Is that code manually written?
Or is it generated, invoking all process<fieldname> routines
in the order in which the fields are listed in the DBD file?

So how do you propose to associate the code that belongs to a certain
entension (and implements all this nice dynamic behavior) with the
extra field and the record support?
As shown on the wiki page, you pick the field name, type, parameters
to the code and code itself when defining the record instance:

calc("fred")
{
   ...
   user_field(SMOO,  iocFloat64T, "0.5", smoo_handler)
}

The 'smoo_handler' is located just like device support etc. are
located via the registry.
The user_field_handler interface has an init routine in which
smoo_handler can hook into the record's process().

Pro:
+ I can add fields per record instance as needed.
  I think it's easier for end users to grasp that
  you have AI, AO, CALC records
  plus 'average' and 'max' field that I can add to any of them,
  than to present them with the 3x2=6 custom record types
  BasicAI, MaxAI, AverageAI, AverageAndMaxAI, BasicAO, MaxAO, ...
+ Under vxWorks, I can do so without recompilation:
  ld <smoo_handlerLib.o
  dbLoadDataBase("..../records_that_use_smoo_handler")

Contra:
- For now, I only saw the necessity to provide process()-hooks in 2 places.
  When we need many more, your suggestion of re-writing process() and
  recompiling the whole record is better.
- the user_field_handler::init() can check the user field type,
  the record type etc. at runtime, but then you only see errors
  at runtime.
  With pre-defined records in the dbd file, more of that could
  be handled at compile time.

Thanks,
-Kay


Replies:
Re: Record support and user-defined fields Benjamin Franksen
References:
V4 iocRecord: forward linking Ralph Lange
Re: Record support and user-defined fields Benjamin Franksen
Re: Record support and user-defined fields Kay-Uwe Kasemir
Re: Record support and user-defined fields Benjamin Franksen

Navigate by Date:
Prev: Re: again: memory management Matthias Clausen
Next: Re: again: memory management Benjamin Franksen
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Record support and user-defined fields Benjamin Franksen
Next: Re: Record support and user-defined fields Benjamin Franksen
Index: 2002  2003  2004  <20052006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·