Mark Rivers wrote:
Folks,
There is something I don't quite understand about the ao and ai
records with soft device support.
If I set DOL="1", then the init_record routine, either in the record
(for ao), or in device support (for ai) sets prec->udf=0. This is
what I expect. However, I find that after iocInit that STAT=UDF and
SEVR=Invalid. This is not what I expected.
The records never call checkAlarms in init_record, so the STAT and
SEVR are not being reset to NO_ALARM. Are the STAT and SEVR fields to
to UDF and INVALID somewhere else in base before init_record is called?
If I set PINI=1 in my database, then the record will process once, and
STAT and SEVR will be set to NO_ALARM. But I don't understand why I
have to do this, why does a soft record initialize with STAT=UDF aand
SEVR=Invalid when its DOL is OK?
Is this the desired behavior, and is there a way to make the STAT and
SEVR be NO_ALARM without having to set PINI=1?
Yes this is the expected behavior. The idea is that SEVR is always
invalid and STAT is always UDF until the record is processed the first
time.
Note that only when recGblResetAlarms is called are stat and sevr
normally given values.
If you really really want stat and sevr to start with no alarm the
following should work
record(<type>,"<name>") {
...
field(STAT,"NO_ALARM")
field(SEVR,"NO_ALARM")
...
}