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  2015  <20162017  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  2015  <20162017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: [UNTRUSTED] PyEpics timeout behavior
From: "Kasemir, Kay" <[email protected]>
To: "Guyotte, Greg S." <[email protected]>
Cc: "[email protected]" <[email protected]>
Date: Tue, 30 Aug 2016 15:39:54 +0000
Hi:

On Aug 30, 2016, at 10:43 AM, Guyotte, Greg S. <[email protected]> wrote:
> I’m experiencing unexpected timeout behavior on PyEpics 3.2.4.
> 
> Using epics.PV, I experience double the expected timeout in all cases.
> Using epics.caget(), the timeout value seems to be ignored and I
> experience 5 seconds of delay when I ask for less than 5 seconds.
epics.caget() is a shortcut which internally calls get_pv to get the PV, then calls get() to read a value.
For the first step, the connection, it always uses a 5 sec timeout. For the get(), it then uses the timeout that you pass in.
So that explains your 5 second delay.

Using the epics.PV in principle allows more control over the various steps: Search for channel, await connection (or register a connection callback), ..

For epics.PV, creating the PV doesn’t really wait at all:
>  print "Test 1: using epics.PV"
>  time1 = time.time()
>  p = epics.PV("idontexist", connection_timeout=waittime)
>  time2 = time.time()
>  print "  Time to create non-existent PV= ",time2-time1
This just sends a name search out and returns in a fraction of a second.

>  val = p.get(timeout=waittime, use_monitor=False)
This get() call will then wait for the connection, since we aren’t already connected.
It uses some internal timeout for that.

I guess you could try this to have more control:

# Send search request
p = epics.PV("idontexist”)
# Wait for the connection
p.connect(timeout=..)

# On success, read:
p.get()

-Kay


References:
PyEpics timeout behavior Guyotte, Greg S.

Navigate by Date:
Prev: PyEpics timeout behavior Guyotte, Greg S.
Next: Re: PyEpics timeout behavior 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  <20162017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: PyEpics timeout behavior Guyotte, Greg S.
Next: Re: PyEpics timeout behavior 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  <20162017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 30 Aug 2016 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·