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 2025 | 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 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: pyepics get_with_metadata inconstant behaviour |
From: | "Marco A. Barra Montevechi Filho via Tech-talk" <tech-talk at aps.anl.gov> |
To: | Matt Newville <newville at cars.uchicago.edu> |
Cc: | Lucca Bavia Cuenca Campoi <lucca.campoi at lnls.br>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Fri, 16 Sep 2022 19:55:12 +0000 |
Thanks, Matt!
Indeed it worked here. A colleague of mine also suggested using ophyd with .describe() and .get() methods and indeed it works well too. Thanks for the help, Marco From: Matt Newville <newville at cars.uchicago.edu>
Sent: 16 September 2022 16:46 To: Marco A. Barra Montevechi Filho <marco.filho at lnls.br> Cc: tech-talk at aps.anl.gov <tech-talk at aps.anl.gov>; Lucca Bavia Cuenca Campoi <lucca.campoi at lnls.br> Subject: Re: pyepics get_with_metadata inconstant behaviour Hi Marco,
On Fri, Sep 16, 2022 at 1:38 PM Marco A. Barra Montevechi Filho via Tech-talk <tech-talk at aps.anl.gov> wrote:
Sorry for the confusion!
For each PV in Channel Access, there are a few choices in "record type": "plain", "severity", "time", "control", and "graphics" (I might be missing one or two). These will change which set
of metadata can be retrieved with the data.
If I recall correctly, "severity" is a subset of "time" and "graphics" is a subset of "control". "plain" gives no extra metadata, "time" gives timestamp, alarm, and severity, and "control"
giving lots of metadata, but importantly not the timestamp.
In pyepics, there is a choice of this record type (called "form" in the pyepics code and docs, as "type" is a builtin in Python), with "time" being the default, "plain" and "ctrl" being available.
That is
mypv = epics.PV(pvname, form='ctrl')
will create a PV with all the control metadata available but by default
mypv = epics.PV(pvname, form='ctrl')
will create a PV with time metadata. Even for a "time" PV, doing `mypv.get_ctrlvars()` will return the "control" metadata (precision, limits, etc).
`mypv.get_with_metadata()` will try to give all the available metadata, but it might not explicitly look those up - it might rely on cached values from the last monitor event. The intention
for the `use_monitor` option for `mypv.get_with_metadata()` is to control whether those cached values are used, but it does seem to be doing something incorrectly: I'll investigate.
I think that the best way to get an accurate and complete set of all the metadata, use
mypv.get_with_metadata(with_ctrlvars=True)
That will really do a fetch of the current values of the control metadata, or to get the control metadata with
mypv.get_ctrlvars()
Again, sorry for the confusion.
--Matt
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. |