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: "Kasemir, Kay" <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Thu, 26 Mar 2015 13:28:00 -0500
Thanks Andrew, Kay, Dirk,

That's very helpful.  I'll update the connection callbacks for pyepics PVs to follow this approach of fetching CTRL variables and creating a separate monitor for DBE_PROPERTY events on the CTRL data type.

--Matt
 

On Thu, Mar 26, 2015 at 7:43 AM, Kasemir, Kay <[email protected]> wrote:
Hi:

On Mar 26, 2015, at 4:47 AM, Dirk Zimoch <[email protected]>
 wrote:
> In my opinion clients should work like this:
>
> Every monitoring client should have a connection callback.
>
> On connect it checks if the data type has changed (that may include changes in array length, keep in mind that dynamic array length is a relatively new thing and we cannot expect every server to support it). If yes, remove existing event subscriptions on this channel and start from scratch as if the channel was new. Most probably the client needs to clean up some if its internal data structures here.
>
> If no event subscription exists (new channel or changed data type), the client should get the DBR_CTRL data once, subscribe for VALUE (or LOG) plus ALARM changes on the DBR_STS data (as usual) and additionally subscribe for DBE_PROPERTY changes on the DBR_CTRL data (a second, independent monitor). It needs two different event callbacks because different things need to be updated. The callback for DBR_STS is the usual stuff, but the callback for DBR_CTRL needs to update enum strings, precision and such.

I agree with Dirk, and the details of changing the subscription are important.

For what it's worth, I started out like this:

1) Create channel
2) In connection callback, fetch DBR_CTRL_native_type
3) When received, establish monitor for DBR_TIME_native_type or DBR_STS, depending on your needs
.. keep receiving updates until
4) Channel disconnects for some reason: Clear monitor, start over at 2)

--> That doesn't work!
Clearing the monitor fails because the CA client lib tries to cancel the subscription on the CA server, which it can't reach since we're after all disconnected.
It's also possible that the IOC is still running, only the network between IOC and client had a problem. In that case, the IOC will keep the subscription info. On reconnect, client starting over at 2) now results in 2 entries in the CA server's client list.

What Dirk describes about comparing the type of existing subscriptions is correct:

1) Create channel
2) In connection callback, fetch DBR_CTRL_native_type
3) When received:
     if (monitor != null  &&  data type changed)
     {   clear monitor; monitor = null }
     if (monitor == null)
          monitor = ca_add_event(DBR_TIME_native_type);
.. keep receiving updates until
4) Channel disconnects for some reason: Start over at 2)

If you support DBE_PROPERTY, you actually have one more monitor for that, checked the same way on reconnects.

Thanks,
Kay



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
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
Re: pyepics not updating pv.enum_strs after connection Dirk Zimoch
Re: pyepics not updating pv.enum_strs after connection Andrew Johnson
Re: pyepics not updating pv.enum_strs after connection Matt Newville
Re: pyepics not updating pv.enum_strs after connection Andrew Johnson
Re: pyepics not updating pv.enum_strs after connection Dirk Zimoch
Re: pyepics not updating pv.enum_strs after connection Kasemir, Kay

Navigate by Date:
Prev: RE: Record issue - to set aother record value Mooney, Tim M.
Next: RE: Registration Open for the Spring 2015 EPICS Collaboration Meeting Emmanuel Mayssat
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 Kasemir, Kay
Next: Re: pyepics not updating pv.enum_strs after connection Michael Davidsaver
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 ·