Smoothing in ai soft support broken for NaN/inf values
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Fix Released
|
Undecided
|
Ralph Lange |
Bug Description
The ai soft support contains the following code:
if (!dbGetLink(
/* Apply smoothing algorithm */
if (prec->smoo != 0.0 && prec->dpvt)
else
prec->udf = FALSE;
[...]
}
This breaks if the record's value is not finite (NaN/+inf/-inf), as the smoothing formula will never return a finite value, and the record is stuck with the NaN/+inf/-inf.
I would suggest to add one more condition to the inner if clause:
/* Apply smoothing algorithm */
if (prec->smoo != 0.0 && prec->dpvt && finite(prec->val))
else
Related branches
Changed in epics-base: | |
status: | New → Fix Committed |
Changed in epics-base: | |
status: | Fix Committed → Fix Released |
Thinking: While the previous value is NaN or ±Inf the new result will be the new value, but as soon as the previous value comes back to reality we start smoothing it again.
That looks right, please apply in 3.14 to both aiRecord.c and the devAiSoft.c device support which also implements this smoothing algorithm. I will merge the changes into 3.15 in due course.
Thanks.