Experimental Physics and
| |||||||||||||||||
|
Hi Simon, On Tue, May 26, 2020 at 3:47 AM Simon Rose via Tech-talk <tech-talk at aps.anl.gov> wrote:
The default "connection timeout" is 2 seconds. That is, PV.connect() will poll for up to 2 seconds for the channel created when initializing the `PV` to be connected. For PVs provided by a running IOC on the same local (virtual) machine, the connection should be much faster than that. I sort of suspect something else must be wrong. If this was on a more complex or slower network, I would suggest increasing the timeout (`PV.connect(timeout=5)`, for example). I might also suggest not using `assert` to raise an exception for unconnected PVs in real code, but rather view "unconnected PV" as something that you want to deal with gracefully instead of simply raising an exception. But, that all seems like it should be unnecessary if the IOC and client are on the same machine. To follow-up on Jure's suggestion, `PV.wait_for_connection()` is not really much different from `PV.connect()`, but with a) first do `PV.connect()` if not already connected, and then b) wait for connection. Yes, that sort of means that default timeout (still 2 seconds) will be waited twice before giving up on connecting a newly created PV. Again, that seems like it would only reduce your failure rate from 20% to 10%, which still seems too high for locally-provided PVs. --Matt
| ||||||||||||||||
ANJ, 28 May 2020 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |