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: Matt Newville <[email protected]>
To: Jameson Graef Rollins <[email protected]>
Cc: EPICS tech-talk <[email protected]>
Date: Wed, 18 Mar 2015 19:54:50 -0500
Hi Jamie,


On Wed, Mar 18, 2015 at 6:26 PM, Jameson Graef Rollins <[email protected]> wrote:
On Wed, Mar 18 2015, Jameson Graef Rollins <[email protected]> wrote:
> Hi, folks.  I'm having an issue with pyepics and ENUM records.  I'm
> initializing a PV from a device as follows:
>
> dev = Device(prefix)
> pv = dev.PV(attr, connect=False, connection_callback=connection_callback)
> pv.add_callback(callback)
>
> This all seems to work fine and as expected, except that the pv supplied
> as a keyword argument to the connection_callback and callback functions
> never has the pv.enum_strs attribute set for ENUM records, even after
> connection has been established.  This means the ENUMs can't ever be
> resolved as strings.

Sorry, just to clarify, if I do *not* set connect=False when
initializing dev.PV, then the enum_strs attribute is set properly.  In
other words, it appears to only be set if the pv is able to connect on
initialization.  If connect=False, the created pv does not get enum_strs
set, nor does it ever even after a connection has been made.

jamie.


Sorry for the confusion.  The surest way to ensure you have enum strings and other CTRL attributes is to do

   pv.get_ctrlvars()

This should happens by default in many situations where you need to know the CTRL variables (say, putting a string for the name to enum PV, or getting with 'as_string=True').  Of course, a PV can't get look up its enum strings if it's not connected.

Hope that helps,

--Matt Newville

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

Navigate by Date:
Prev: EDM -ctl opens new window instead of raising old one jon
Next: Re: pyepics not updating pv.enum_strs after connection Jameson Graef Rollins
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 Jameson Graef Rollins
Next: Re: pyepics not updating pv.enum_strs after connection Jameson Graef Rollins
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 ·