Would it be possible to perform this function from inside the iocInit function chain? When iocInit(0) is performed, I install an init function hook to receive all the init steps. Could I build and install a database during – say- the initHookAfterInitDevSup announcement? At that point, I push a database out to a temp file, and the load it in using a call to dbReadDatabaseFP, or similar?
This is just to make a couple of statistics records available every time the driver loads, but I could see other uses for it.
Later-
*David Dudley*
Controls Engineer III
*Facility for Rare Isotope Beams*
Michigan State University
640 South Shaw Lane
East Lansing, MI 48824-1321, USA
Tel. 517-908-7133
Email: dudleyd at frib.msu.edu <mailto:dudleyd at frib.msu.edu>
**
*cid:[email protected]*
*From:*Tech-talk <tech-talk-bounces at aps.anl.gov> *On Behalf Of *Ralph Lange via Tech-talk
*Sent:* Friday, February 04, 2022 3:48 AM
*To:* EPICS Tech Talk <tech-talk at aps.anl.gov>
*Subject:* Re: Creating a database record
*[EXTERNAL] This email originated from outside of FRIB*
On Thu, 3 Feb 2022 at 21:01, Dudley, David via Tech-talk <tech-talk at aps.anl.gov <mailto:tech-talk at aps.anl.gov>> wrote:
Is it possible from with a device driver that before iocInit (or during some part of it) to programmatically build a database record for use in EPICS?
I know of a driver that does that, yes.
In the initialization of the driver (started by calls from the startup script) they detect the hardware and create a matching DB file in '/tmp', then load that file. Works fine.
I don't like that for a production system for multiple reasons. Having no or little control over which records an IOC loads.... Broken cards that would just disappear from the name space with no trace....
But I see the advantage for plug-and-play lab use.
If you don't hard code the records into the driver code, but maybe blow up from templates that are part of your application, you would give the user at least some control.
Cheers,
~Ralph
reference: https://github.com/NDSv3/nds-epics/blob/46bf0bbf053a36be6140ef3d457519f8b56609a8/ndsSup/src/epicsInterfaceImpl.cpp#L170 <https://github.com/NDSv3/nds-epics/blob/46bf0bbf053a36be6140ef3d457519f8b56609a8/ndsSup/src/epicsInterfaceImpl.cpp#L170>