EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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

Subject: RE: mbbi/mbbo default setting
From: "Mooney, Tim M." <[email protected]>
To: "Johnson, Andrew N." <[email protected]>, "[email protected]" <[email protected]>
Date: Fri, 3 Apr 2015 16:30:01 +0000
> > Any other ideas?

> Put dbpf() commands in the startup script after iocInit().

> I think the only way to be able to do this would be if dbLoadRecords()
> worked on a live IOC and initialized each record as it got created
> (presumably immediately after seeing the closing brace). You could then
> have a second instance of the record in the same .db file to set the
> record's default value. That's a somewhat different architecture than we
> have right now though.

Well, you could do something like this with the dbLoadRecords hook Andrew
recently added.  Your hook might look for an info node named "initMBBO" or
something, which would specify the initial string value.

Tim Mooney ([email protected]) (630)252-5417
Software Services Group (www.aps.anl.gov)
Advanced Photon Source, Argonne National Lab


________________________________________
From: [email protected] [[email protected]] on behalf of Andrew Johnson [[email protected]]
Sent: Friday, April 03, 2015 11:15 AM
To: [email protected]
Subject: Re: mbbi/mbbo default setting

On 04/03/2015 10:29 AM, Ralph Lange wrote:
> As I am already asking stupid questions....
>
> The mbbi/mbbo records implement enums.
> Is there a way to set the default value in the database using a choice
> string?

No, but you can of course use the number. If your strings get set by
device support then there would be no easy way to do this statically
since device initialization happens at iocInit(), after dbLoadRecords()
has finished. I guess you could write a device-specific routine that you
would call before iocInit() to do the string-to-number conversion and
put that value into the record for you...

If your choice strings are static though you must know at design-time
what number is associated with each particular string, although your
database creation code can't be completely generic, it must know about
the mbb[io] record types to know what fields map to the strings.

> Any other ideas?

Put dbpf() commands in the startup script after iocInit().

I think the only way to be able to do this would be if dbLoadRecords()
worked on a live IOC and initialized each record as it got created
(presumably immediately after seeing the closing brace). You could then
have a second instance of the record in the same .db file to set the
record's default value. That's a somewhat different architecture than we
have right now though.

HTH,

- Andrew
--
Light thinks it travels faster than anything but it is wrong.
No matter how fast light travels, it finds the darkness has
always got there first, and is waiting for it.
    -- Terry Pratchett, Reaper Man


References:
mbbi/mbbo default setting Ralph Lange
Re: mbbi/mbbo default setting Andrew Johnson

Navigate by Date:
Prev: Re: mbbi/mbbo default setting Andrew Johnson
Next: APS Jenkins Upgrade Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: mbbi/mbbo default setting Andrew Johnson
Next: APS Jenkins Upgrade Andrew Johnson
Index: 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·