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  2021  2022  2023  <20242025  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  <20242025 
<== Date ==> <== Thread ==>

Subject: Resetting a compress record to empty it
From: Érico Nogueira Rolim via Tech-talk <tech-talk at aps.anl.gov>
To: "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Tue, 10 Dec 2024 15:34:43 +0000
Hi folks!

We are using compress records as circular buffers, and would like to be
able to empty them between events. However, our current implementation
feels hackish, so I'd like to see if we are missing something.

The circular buffer is implemented similarly to below:


record(calc, "scalar"){
     field(CALC, "VAL+1")
}

record(compress, "array"){
     field(ALG, "Circular Buffer")
     field(NSAM, "100")
     field(INP, "scalar PP")
}


Emptying them is done manually, with someone writing to a PV which
writes into the records' RES fields. There are two naive ways of
implementing the reset PV:


record(longout, "reset-array"){
     field(OUT, "array.RES")
}

record(longout, "reset-array-pp"){
     field(OUT, "array.RES PP")
}


"reset-array" doesn't process the record, so monitor clients don't
received its changed value; only new clients (or explicit Get
operations) see the empty vector. It does leave "array" empty, though,
so subsequent processing of the record will leave it with the correct
amount of elements.


"reset-array-pp" processes the record 'too much'. It will be emptied,
then processed once, so "scalar" is processed as well and "array"
fetches that value, ending up with one element, not empty.


The only way we have managed to make it work, so that monitor clients
(GUI and CLI) observe an empty vector, feels somewhat hackish. It's done
with seq:


record(seq, "reset-array-full"){
     field(DOL1, 1)
     field(DOL2, 1)
     field(LNK1, "array.RES PP") # empty record, process it, ends up
with one element
     field(LNK2, "array.RES") # somehow empties record before monitor is
actually posted
}

Is there some better way of implementing this?

If not, is the behavior of "reset-array-full" something we can rely on?
I'd be okay with relying on it, especially if I understood it better.

And could something be done to fix it in epics-base, perhaps always
posting monitors on writes to "special(SPC_RESET)" fields? Would that
make sense?


Cheers,

Érico


Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente.

Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately.

Replies:
Re: Resetting a compress record to empty it Johnson, Andrew N. via Tech-talk

Navigate by Date:
Prev: Re: IOC for Tektronix DAQ6510? Mark Rivers via Tech-talk
Next: Re: Resetting a compress record to empty it Johnson, Andrew N. 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  2021  2022  2023  <20242025 
Navigate by Thread:
Prev: Re: IOC for Tektronix DAQ6510? Mark Rivers via Tech-talk
Next: Re: Resetting a compress record to empty it Johnson, Andrew N. 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  2021  2022  2023  <20242025 
ANJ, 10 Dec 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·