"Redman, Russell O." wrote:
>
> If I can add my two cents, EPICS uses doubles a bit too often as a default
> data type, and this is just one of several examples. Echoing some of the
> other comments in the thread, it should be possible to initialise
> - longin and longout records with any valid long specification,
> - mbbi and mbbo with integers or strings from the xxST enum,
> - stringin and stringout with any valid character string
> etc. In general, it should be possible to initialise a record with any
> value that the record type would interpret unambiguously as input through
> INP or DOL.
>
> Following Benjamin Franksen, I think an appropriate syntax would be to add a
> VAL field, which if nonblank would be parsed using the normal input
> mechanisms to set the initial value of the record, just as if it had been
> read from INP or DOL.
>
> Cheers,
> Russell O. Redman
Not quite as simple as it seems.
dbStaticLib, which does NOT use record support, includes dbPutString. This is
the routine that writes values to link fields when database record instances are
loaded or at run time when link fields are modified.
recGblInitConstantLink is called by record support during iocInit. Only the
record support knows the relationship between the link field and it's
corresponding data field. Thus to do what Benjamin suggests, all record support
that calls recGblInitConstantLink would need to be modified.
Perhaps there is an easy solution.
For the record types that have an INP field add the following to the VAL field
dbd file
promptgroup(GUI_INPUT)
and to the record types with an DOL field add
promptgroup(GUI_OUTPUT)
Then database configuration tools will allow the user to assign values to the
VAL field. If you use an ordinary editor like vi or emacs to create your
databases then you can do this now.
recGblInitConstantLink will NOT write a value to the associated field if the
link field is null. Examples
record(longin,"mrkli4") {
field(VAL,"0x10")
field(INP,"")
}
record(longin,"mrkli5") {
field(VAL,"0x10")
field(INP,"0")
}
Then after iocInit the following is true
epics> dbgf "mrkli4"
DBR_LONG: 16 0x10
epics> dbgf "mrkli5"
DBR_LONG: 0 0x0
The bad effect is that users have two ways to define values for the VAL field,
e.g. assign values to VAL itself or else assign values to the associated link
field. Does this matter? Maybe not.
Marty Kraimer
- Replies:
- Making VAL configurable [was: Hex constant as input to longin record?] Benjamin Franksen
- References:
- RE: Hex constant as input to longin record? Redman, Russell O.
- Navigate by Date:
- Prev:
RE: Hex constant as input to longin record? Redman, Russell O.
- Next:
Making VAL configurable [was: Hex constant as input to longin record?] Benjamin Franksen
- Index:
1994
1995
1996
1997
1998
1999
2000
<2001>
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:
RE: Hex constant as input to longin record? Redman, Russell O.
- Next:
Making VAL configurable [was: Hex constant as input to longin record?] Benjamin Franksen
- Index:
1994
1995
1996
1997
1998
1999
2000
<2001>
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
|