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  <20152016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: pyepics not updating pv.enum_strs after connection
From: Jameson Graef Rollins <[email protected]>
To: Matt Newville <[email protected]>
Cc: EPICS tech-talk <[email protected]>
Date: Thu, 19 Mar 2015 20:04:25 -0700
On Thu, Mar 19 2015, Matt Newville <[email protected]> wrote:
> I'm not certain I can tell what you did, but I'll guess that you created a
> PV, set a callback, and are trying to run pv.get_ctrlvars() inside the
> callback.  That won't work, basically because the get_ctrlvars() would have
> to do an Epics poll(), and inside a callback you're already "inside" an
> Epics poll().
>
> But you can create a PV, get the ctrl vars, and then set a callback, or
> allow that the first few calls in the callback may not have the enum
> strings.      I typically do this as
>     pv = PV(pvname)
>     pv.get(as_string=True) # make sure it's connected, has a value, and
> has  CTRL values
>     pv.add_callback(....)

The tricky bit is that for this application I do *not* want to connect
to the PV when it's being created, and I want all updates to happen from
the callbacks.  This is for a gui application that is connecting to many
PVs asynchronously.  Waiting for each individual PV to connect at
start-up would slow down the start up time considerably.  For this
application there's really no other time when the value can be retrieved
"as_string" so that enum_strs is updated without having to bring the
user into the process somehow (at least I have yet to figure out how).

Is there really no other option?  I still don't understand why the
enum_strs attribute can't just be updated automatically when the
connection is first made, without having to retrieve it manually at some
point.  It would certainly make things easier from my perspective.

jamie.

Attachment: signature.asc
Description: PGP signature


Replies:
Re: pyepics not updating pv.enum_strs after connection Matt Newville
References:
pyepics not updating pv.enum_strs after connection Jameson Graef Rollins
Re: pyepics not updating pv.enum_strs after connection Jameson Graef Rollins
Re: pyepics not updating pv.enum_strs after connection Matt Newville
Re: pyepics not updating pv.enum_strs after connection Jameson Graef Rollins
Re: pyepics not updating pv.enum_strs after connection Matt Newville

Navigate by Date:
Prev: Re: mbbi Undefined value/string Andrew Johnson
Next: Re: pyepics not updating pv.enum_strs after connection Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: pyepics not updating pv.enum_strs after connection Matt Newville
Next: Re: pyepics not updating pv.enum_strs after connection Matt Newville
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  <20152016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 16 Dec 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·