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 modified the call of fetch_value() as follows. &(pao->val) is passed
as second argument instead of &value. A value of "value" variable
is updated by the return value of fetch_value().
===== extracted from modified 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, &(pao->val));
value=pao->val;
}
else {
value = pao->val;
}
convert(pao, &value);
}
...
=========================================================================
Thanks for reading my report.
Noboru Yamamoto
KEKB control group
KEK, JAPAN
Noboru Yamamoto
KEKB Accelerator Control Group
KEK, JAPAN
Fax:+81-298-64-0321
Tel:+81-298-64-5309
e-mail:[email protected]
- Replies:
- Re: CA_LINK in DOL field of AO record. Marty Kraimer
- Navigate by Date:
- Prev:
Re: first serial devSupp Li Jingyi
- Next:
Re: CA_LINK in DOL field of AO record. Marty Kraimer
- 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:
Re: first serial devSupp Li Jingyi
- Next:
Re: CA_LINK in DOL field of AO record. Marty Kraimer
- 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
|