EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Weird waveform behavior
From: "Zhichu Chen" <[email protected]>
To: [email protected]
Date: Tue, 17 Jun 2008 12:28:57 +0800
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
----------------------------------------------------------------

Replies:
Re: Weird waveform behavior Geoff Savage
Re: Weird waveform behavior Dirk Zimoch

Navigate by Date:
Prev: ImageJ and EPICS? Antonino Miceli
Next: Re: Weird waveform behavior Geoff Savage
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: ImageJ and EPICS? Antonino Miceli
Next: Re: Weird waveform behavior Geoff Savage
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  <20082009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Sep 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·