Experimental Physics and
| |||||||||||||||||
|
Hi, On Mon, Sep 19, 2022 at 10:57 AM LE-DANIEL Erwann <erwann.le-daniel at alstomgroup.com> wrote:
OK. Then, I'm less sure about what is going on. Creating multiple instances of a PV in a loop would be an odd thing to do, though it will not create completely new connections to the CA Channel: `epics.ca._cache` should only have one Channel in it, though it will retain a large number of callbacks that are no longer accessible. I don't know if there is a limit on the number of PVs that can be created - your script runs to at least 3000 times for me, though I did not test with raspberry pi. But: For sure, creating a PV and then fetching its value repeatedly is recommended: p = epics.PV(‘TL_AN_Input’) while True: val = p.get() print (val) time.sleep(0.1) There is also `epics.get_pv` which will get a cached PV or create one if needed: while True: p = epics.get_(‘TL_AN_Input’) val = p.get() print (val) time.sleep(0.1) this will prevent the creation of thousands of useless callbacks. --Matt
| ||||||||||||||||
ANJ, 19 Sep 2022 |
·
Home
·
News
·
About
·
Base
·
Modules
·
Extensions
·
Distributions
·
Download
·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing · |