Hi Emmanuel,
Not sure whether I fully understand your question, but for an
exiting record,
all default fields are there no matter you use it or not.
The difference is just what the exact value it has.
For you first example: the FLNK is CONSTANT 0, and DRVH is 40
you next example FLNK is "AnotherAO", and DRVH is 0.
Therefore, you are always able to change any existing field by for
example using dbpf from iocsh
epics> dbpf anotherAO.VAL 10
Record 'anotherAO.VAL' not found
epics> dbpf myAO.VAL 10
DBR_DOUBLE: 10
epics>
But again, I might miss something.
Guobao
On 6/6/14, 11:22 AM, Emmanuel Mayssat wrote:
Hello all,
A feature I use a lot with my db file is overwriting a
record, ie:
record(ao, "myAO") {
field(VAL, "20")
field(DRVH, "40")
}
and later in the same or another db file
record(ao, "myAO") {
field(VAL, "21")
field(FLNK, "AnotherAO")
}
The above is equivalent to 1 single entry with
record(ao, "mAO") {
field(VAL, "21")
field(DRVH, "40")
field(FLNK, "AnotherAO")
}
Now the issue is that to overwrite the field of a record,
you need to know its type (i.e. ao) as you need to repeat the
record line.
Is it possible to have a database entry (maybe like the
alias entry) where you could just say:
changefield("myAO", VAL, 21)
which doesn't create the record if it doesn't exist, but
which perform the equivalent to
record(ao, "myAO") {
field(VAL, "21")
}
if it does.
Maybe a similar command already exist.
If so let me know,
--
Emmanuel
|