I think you need NELM in the subArray record equal to NELM in the
waveform record.
Geoff
On Jun 16, 2008, at 11:28 PM, Zhichu Chen wrote:
Hi,
I've written a waveform support but I can't make it readable by
other records,
so I wrote a soft one like this:
======================================================
static long read_wf(waveformRecord *pwf)
{
CALLBACK *pcallback=(CALLBACK *)(pwf->dpvt);
unsigned long i;
long BUFFER[10000];
for (i = 0 ; i < 1500 ; i++) {
BUFFER[i] = 10 + (i%2) ;
}
for (i = 1500 ; i < 4500 ; i++) {
BUFFER[i] = 510 + (i%2) ;
}
for (i = 4500 ; i < 10000 ; i++) {
BUFFER[i] = 10 + (i%2) ;
}
long *pbuffer;
if(pwf->pact) {
pbuffer = BUFFER ;
pwf->nelm = pwf->nord = 5000;
pwf->bptr = pbuffer;
}
else{
if(pwf->disv<=0) return(2);
pwf->pact=TRUE;
callbackRequestProcessCallbackDelayed(
pcallback,pwf->prio,pwf,(double)pwf->disv);
pwf->pact=TRUE;
}
return 0;
}
======================================================
and exported it to a device type as "SOFT" and wrote a db file like:
======================================================
record (waveform, "wf") {
field(FTVL, "LONG")
field(SCAN, "1 second")
field(NELM, "5000")
field(DTYP, "SOFT")
}
record (subArray, "sa") {
field(INP, "wf.VAL")
field(SCAN, "1 second")
field(FTVL, "LONG")
field(MALM, "100")
#field(INDX, "0")
field(NELM, "100")
}
======================================================
the "wf" record gave a correct 5000 points emulated signal array
but the "sa"
record just gave me 100 zeros. I've tried some combinations in the
DB file like
some of you said it could be better to use "wf.VAL CA" in the INP
field of "sa"
or "wf.VAL CP" etc., but I have no luck.
Then I think maybe the waveform support needs modification. So can
any of
you give me some advice about how to write the correct waveform
support.
By the way, I put another soft waveform record and the subArray
could read it.
So basicly, it's not the problem of my EPICS release.
--
Best Regards
Chen
----------------------------------------------------------------
Zhi-chu Chen | Shanghai Synchrotron Radiation Facility
No. 2019 | Jialuo Rd. | Jiading | Shanghai | P.R. China
tel: 086 21 5955 3405 | zhichu.chen.googlepages.com
| www.sinap.ac.cn
----------------------------------------------------------------
- References:
- Weird waveform behavior Zhichu Chen
- Navigate by Date:
- Prev:
Weird waveform behavior Zhichu Chen
- Next:
unhandled exception in timerQueue Matthew Pearson
- 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:
Weird waveform behavior Zhichu Chen
- Next:
Re: Weird waveform behavior Dirk Zimoch
- 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
|