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