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
- 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
- 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
- Navigate by Date:
- Prev:
Record issue - to set aother record value Amien Crombie [TLABS]
- Next:
RE: Record issue - to set aother record value Arnold, Ned D.
- 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
- Navigate by Thread:
- Prev:
Re: pyepics not updating pv.enum_strs after connection Ralph Lange
- 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
<2015>
2016
2017
2018
2019
2020
2021
2022
2023
2024
|