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
- Replies:
- RE: mbbi/mbbo default setting Mooney, Tim M.
- References:
- mbbi/mbbo default setting Ralph Lange
- Navigate by Date:
- Prev:
Re: Small arrays in rsrv Michael Davidsaver
- Next:
RE: mbbi/mbbo default setting Mooney, Tim M.
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
- Navigate by Thread:
- Prev:
mbbi/mbbo default setting Ralph Lange
- Next:
RE: mbbi/mbbo default setting Mooney, Tim M.
- Index:
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|