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: Weird behaviour in wait=True when using epics.Motor.get(something, something, wait=True) |
From: | Torsten Bögershausen via Tech-talk <tech-talk at aps.anl.gov> |
To: | Matt Newville <newville at cars.uchicago.edu>, "Marco A. Barra Montevechi Filho" <marco.filho at lnls.br> |
Cc: | SWC <swc at lnls.br>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Mon, 23 Jan 2023 17:43:19 +0000 |
Hej again, are we still wondering about callbacks and wait=True ? Writing to VELO give one callback and one camonitor event here. Writing to DLLM give 2 callbacks and 2 monitors. This feels like a bug to me, but I don't think it worth to fix it. The Record is processed twice, first because the update of the DLLM field. And another time when the motor had been polled caused by a "GET_INFO" transaction. Back to the wait=True question, if anybody is interested. Writing to CNEN with wait=True seems to wait for the Record to have processed the command, it seems to me. However, when the record has processed the command, and send it to the controller, it doesn't mean that the controller has digested it fully. What are you using CNEN for ? Often it is used it for "enabling the amplifier". Other definitions that I have seen are "closed loop" or "torque control". We use it for "enabling the amplifier". Once the controller has received the "enable", it make take 1 second until the amplifier is ready, and the motor can be moved. HTH From: Tech-talk <tech-talk-bounces at aps.anl.gov> on behalf of Matt Newville via Tech-talk <tech-talk at aps.anl.gov> Hi Marco, On Thu, Jan 19, 2023 at 9:43 AM Marco A. Barra Montevechi Filho <marco.filho at lnls.br> wrote:
I suspect that the "sometimes get an initial callback" is because creating an `epics.Motor()`
will make an initial connection for PVs
to some fields, including I also see that writing to the DHLM and DLLM of the Motor Record causes two nearly simultaneous events with the same new value. I don't see that for all other fields, but the motor record is
complicated, and setting some values will cause a cascade of events. I suspect that setting DHLM will also set HLM (or maybe LLM if the direction is negative), which might then also update the DHLM value.
General answer: Some things are easier to control than other things. If you first fetch the value of "CNEN" or "DHLM", and then add the callback, you should only see changes from that initial value (all assuming that connections happen in time). I don't know how to get only 1 callback if DHLM is changed. --Matt |