hi Andrew
Thanks,
2014-12-12 17:44 GMT+01:00 Andrew Johnson <[email protected]>:
> Hi,
>
> On 12/12/2014 10:28 AM, Walter Werner wrote:
>> I use pyepics for my client and want to avoid the "Virtual circuit
>> disconnect" exception from CA being printed on the standard input.
>> CA.Client.Exception...............................................
>> Warning: "Virtual circuit disconnect"
>> Context: "localhost:20000"
>> Source File: ../cac.cpp line 1215
>> Current Time: Wed Dec 10 2014 05:51:45.821307011
>> ..................................................................
>> This exception accrues if the server is down.
>
> Do you have a connection callback handler for your PVs? If not,
> supplying one may prevent some of the disconnect messages (and permit
> your code to find out when it should stop trying to access the PV values).
Yes, i do have the connection handler. And i try to recoonect the pv
if the connection is lost. As far as i know the PV class does not
reconnect automatically. My problem was more a cosmetic nature for the
end user. It looks not very nice if some exception is printed on the
console, although i already take care of it.
> You can also redirect any/all error messages from the underlying CA
> library by providing your own printf handler. From the pyepics
> documentation for the low-level CA module:
>> epics.ca.replace_printf_handler(fcn=None)
>> Replace the normal printf() output handler with the supplied
>> function (defaults to sys.stderr.write())
>
> Note that a single message like the one you quoted above may have come
> from several calls to the printf handler routine, so don't just try to
> pop up a new dialog box every time it gets called.
that was the method i was looking for !!! The example code looks like this:
----------------
def my_printf_handler(output_str):
pass
#TODO write output_str to some logfile
epics.ca.replace_printf_handler(my_printf_handler)
---------------
regards
Walter
- Replies:
- Re: pyepics "Virtual circuit disconnect" CA.Client.Exception Andrew Johnson
- Navigate by Date:
- Prev:
RE: CA Gateway 2.0.5.0 released freddie.akeroyd
- Next:
Re: pyepics "Virtual circuit disconnect" CA.Client.Exception Walter Werner
- 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 "Virtual circuit disconnect" CA.Client.Exception Walter Werner
- Next:
Re: pyepics "Virtual circuit disconnect" CA.Client.Exception Andrew Johnson
- 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
|