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 2019 2020 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 2019 2020 2021 <2022> 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: warnings.warn from raspberry pyepics |
From: | LE-DANIEL Erwann via Tech-talk <tech-talk at aps.anl.gov> |
To: | Matt Newville <newville at cars.uchicago.edu> |
Cc: | "tech-talk-request at aps.anl.gov" <tech-talk-request at aps.anl.gov>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Mon, 19 Sep 2022 16:30:55 +0000 |
YES ! you were True ! I effectively created lot of “instance” of PV !! Your solution works perfectly ! ! THANK YOU VERY MUCH ! Cordialement, LE DANIEL Erwann. De : Matt Newville <newville at cars.uchicago.edu> CAUTION: This email was sent from outside Alstom. Be vigilant if you want to click on links or open attachments. 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 In case of strong suspicion of phishing, report the email through the reporting tool on your Outlook toolbar or send it as an attachment to
spam at alstomgroup.com CONFIDENTIALITY : This e-mail and any attachments are confidential and may be privileged. If you are not a named recipient, please notify the sender immediately and do not disclose the contents to another person, use it for any purpose or store or copy the information in any medium. |