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  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  <20212022  2023  2024  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  <20212022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Question about compress records
From: "Guyotte, Greg via Tech-talk" <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 8 Feb 2021 15:58:15 +0000

Hello,

 

I’m attempting to use a pair of compress records to calculate the average of a scalar PV over a window of time.

 

The first compress record is the “Circular Buffer”, which has a size of 360 samples, with a SCAN period of “10 second”, thereby sampling the scalar PV (which is INP) over one hour of time.

 

record(compress, “Buffer”) {

  field(INP, “Current”)

  field(ALG, “Circular Buffer”)

  field(NSAM, “360”)

  field(SCAN, “10 second”)

  field(FLNK, “AvgCurrent”)

}

 

The second compress record is set to “N to 1 Average”, taking as INP the array obtained from the circular buffer compress record.  This record should process each time the circular buffer receives new data, therefore the circular buffer record has a forward link to this record:

record(compress, “AvgCurrent”) {
  field(SCAN, “Passive”)

  field(INP, “Buffer”)

  field(ALG, “N to 1 Average”)

  field(N, “360”)

}

 

What I find is that the “N to 1 average” record is invalid until the Circular buffer has filled up (e.g. after one hour in my case).  After the circular buffer is full of samples, it works as expected.

 

I have also tried to compute the average with an acalcout record, but I got the same result.

 

Is this the expected outcome, or can anyone suggest how to implement so that average works before the circular buffer is full?  Is there perhaps a way I can initialize the circular buffer?

 

Thanks,

Greg Guyotte


Replies:
Re: Question about compress records Mooney, Tim M. via Tech-talk
Re: Question about compress records Ralph Lange via Tech-talk

Navigate by Date:
Prev: Firmware upgrade for MRF event generators and receivers Abdalla Ahmad via Tech-talk
Next: Re: Question about compress records Mooney, Tim M. via Tech-talk
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  <20212022  2023  2024 
Navigate by Thread:
Prev: RE: Firmware upgrade for MRF event generators and receivers Abdalla Ahmad via Tech-talk
Next: Re: Question about compress records Mooney, Tim M. via Tech-talk
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  <20212022  2023  2024 
ANJ, 10 Feb 2021 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·