--- Begin Message ---
> I am really confused about the initial values of ASLO for ai and ao
> records.
You are right - the situation is a bit confusing.
> In the record reference manual it says that the
> initial value for ai and ao are 1.0.
> [...]
> The results are:
> ASLO has a default of 0 for ao records and
> a default of 1.0 for ai records.
Right. But a glance at the code might clarify the situation:
aoRecord.c (~line 192):
case(0): /* convert */
value = (double)pao->rval + (double)pao->roff;
if(pao->aslo!=0.0) value *= pao->aslo;
value += pao->aoff;
aiRecord.c (~line 365):
val = (double)pai->rval + (double)pai->roff;
/* adjust slope and offset */
if(pai->aslo!=0.0) val*=pai->aslo;
val+=pai->aoff;
So there's no real difference between ASLO being not set, 0.0 or 1.0.
(Actually ASLO being 0 saves a few usec for the multiplication.)
> I am putting 1.0 as the value of ASLO in all the capfast symbols
> that we are using for both ai and ao records, which seems to be the
> right way to go to me.
Generally agreed.
We could actually have a default of 1.0 for ao records in the dbd file and
get rid of the test against zero in the code.
Or we could have a default of 0 for both record types and define the value
0 for ASLO as "don't use it". (This would need a word in the doc.)
Should we do something? Is this worth the effort? *Shrug.*
Ralph
--- End Message ---