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  2016  2017  2018  <20192020  2021  2022  2023  2024  2025  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  <20192020  2021  2022  2023  2024  2025 
<== Date ==> <== Thread ==>

Subject: How to set timeout for reading a pyepics device attribute [SEC=UNOFFICIAL]
From: "CORNALL, Terry via Tech-talk" <[email protected]>
To: "[email protected]" <[email protected]>
Date: Tue, 3 Dec 2019 04:59:58 +0000

Hi All.

If I use pyepics devices, such as a motor, via:

m=epics.Motor('SR10BM01SPAL03:SPIN’, timeout=5)

And then try to read some attribute, like:

jvel=m.JVEL

it sometimes happens that the attempt to read the attribute times out in 1 second. (rare, but it does happen)

UserWarning: ca.get('SR10BM01SPAL03:SPIN.JVEL') timed out after 1.00 seconds.

 

The timeout=5 specified in creating the device instance above in my example appears to be a ‘connection timeout’ used when first making the device instance rather than the timeout used when getting an attribute value.

 

I’ve pondered the code and doco but can’t see how to set  the timeout that applies to reading an attribute.

If I use an epics.Motor.get() like

Jvel=m.get(‘JVEL’, timeout=5)

I get an error about unexpected keyword argument ‘timeout’, and looking at the code in epics/motor.py supports that I can’t do it that way.

 

According to code in epics/motor.py, Motor.get() uses PV.get() but doesn’t specify any timeout  so I get stuck with a hard-coded 1 second.

 

I guess I can get the epics.Motor’s PV as a string and then attach the attribute string and then use PV.get(pvstring, timeout=5) but it seems a bit hacky if there is a better way that I’ve missed.

 

Any thoughts?

Terry


Replies:
Re: How to set timeout for reading a pyepics device attribute [SEC=UNOFFICIAL] Matt Newville via Tech-talk

Navigate by Date:
Prev: Re: SRS RGA 100 protocol files Heinz Junkes via Tech-talk
Next: Phoebus and Archiver Appliance Rory Clarke - UKRI STFC via Tech-talk
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  <20192020  2021  2022  2023  2024  2025 
Navigate by Thread:
Prev: Re: SRS RGA 100 protocol files Heinz Junkes via Tech-talk
Next: Re: How to set timeout for reading a pyepics device attribute [SEC=UNOFFICIAL] Matt Newville via Tech-talk
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  <20192020  2021  2022  2023  2024  2025 
ANJ, 03 Dec 2019 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions ·
· Download · Search · IRMIS · Talk · Documents · Links · Licensing ·