Noboru Yamamoto wrote:
>
> Dear Colleague,
>
> One of my colleague try to get output value of AO record from the record
> on another IOC. So he put channel name in DOL field. After initializing
> IOC, dbpr command shows that DOL has CA_LINK.
> However value which this AO record got is jut garbage.
> After looking at the codes, aoRecord.c and aiRecord.c and devAiSoft.c,
> I modified one line of code in aoRecord.c. With this modification,
> AO record get correct number from CA_LINK.
> I'm not quite sure if it has another side effect. Honestly speaking,
> I don't understand why original code get the garbage and why the modified
> version does get the correct number.
>
> Anyway, here is a original code in aoRecord.c.
>
> ===== extracted from aoRecord.c ======================================
> static long process(pao)
> struct aoRecord *pao;
> {
> struct aodset *pdset = (struct aodset *)(pao->dset);
> long status=0;
> unsigned char pact=pao->pact;
> double value;
>
> if ((pdset==NULL) || (pdset->write_ao==NULL)) {
> pao->pact=TRUE;
> recGblRecordError(S_dev_missingSup,(void *)pao,"write_ao");
> return(S_dev_missingSup);
> }
>
> /* fetch value and convert*/
> if (pao->pact == FALSE) {
> if ((pao->dol.type != CONSTANT) &&
> (pao->omsl == CLOSED_LOOP)) {
> fetch_value(pao, &value);
> }
> else {
> value = pao->val;
> }
> convert(pao, &value);
> }
> ...
> =========================================================================
I looked a little closer and I think the problem is that fetch_value
does not change value if dbGetLink reports an error. Since value is not
initialized it is just garbage in this case. This will happen whenever
the CA link has a problem.
Noboru,
Is this what happened?
If this is true then the change should be:
/* fetch value and convert*/
if (pao->pact == FALSE) {
if ((pao->dol.type != CONSTANT) &&
(pao->omsl == CLOSED_LOOP)) {
status = fetch_value(pao, &value);
}
else {
value = pao->val;
}
if(!status) convert(pao, value);
}
And fetch_value modified to return a status value.
I will change it for the next release of epics.
Marty Kraimer
- References:
- CA_LINK in DOL field of AO record. Noboru Yamamoto
- Navigate by Date:
- Prev:
CA_LINK in DOL field of AO record. Noboru Yamamoto
- Next:
16-bit A/D and D/A conversions Garrett D. Rinehart
- 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:
CA_LINK in DOL field of AO record. Noboru Yamamoto
- Next:
16-bit A/D and D/A conversions Garrett D. Rinehart
- 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
|