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  2024  2025  <2026 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  <2026
<== Date ==> <== Thread ==>

Subject: How to ensure with_ctrlvars monitor in PyEpics if PVs are initially unavailable
From: "Wang, Lin via Tech-talk" <tech-talk at aps.anl.gov>
To: tech-talk at aps.anl.gov
Date: Thu, 25 Jun 2026 19:57:22 +0800 (GMT+08:00)

Dear all,


If the PV is ready, the following PyEpics code works normally and metadata is always available in callback,


import time, epics


def cb(**kw):

    print("units =", kw.get("units"))


pv = epics.PV("calcExample")

pv.wait_for_connection(timeout=5)

pv.add_callback(cb, with_ctrlvars=True)

time.sleep(10)


However, it seems that if the PV is not ready at first, the with_ctrlvars parameter will not take effect. In this case, even if the PV becomes accessible later, callback can never access metadata in subsequent updates.


So the questions: if PV metadata is intended to be available in callback no matter what status the PV is when calling add_callback(), is there any workaround? Or am I missing something?



Thanks,

Lin



Replies:
Re: How to ensure with_ctrlvars monitor in PyEpics if PVs are initially unavailable Matthew Newville via Tech-talk

Navigate by Date:
Prev: Re: Problems with Dante (XGLab) Driver Dariush Hampai via Tech-talk
Next: Re: Problems with Dante (XGLab) Driver Mark Rivers 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  2024  2025  <2026
Navigate by Thread:
Prev: EPICS thread on Marana problem Louisa Kienesberger via Tech-talk
Next: Re: How to ensure with_ctrlvars monitor in PyEpics if PVs are initially unavailable Matthew Newville 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  2024  2025  <2026
ANJ, 25 Jun 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·