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
----------------------------------------------------------------