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 | 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 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: Weird behaviour in wait=True when using epics.Motor.get(something, something, wait=True) |
From: | "Marco A. Barra Montevechi Filho via Tech-talk" <tech-talk at aps.anl.gov> |
To: | Torsten Bögershausen <Torsten.Bogershausen at ess.eu>, Matt Newville <newville at cars.uchicago.edu> |
Cc: | SWC <swc at lnls.br>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov> |
Date: | Thu, 26 Jan 2023 15:20:22 +0000 |
Hi, Torsten!
>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. Understood. It would be easier for me to understand if it was a constant behavior. It is still a little harder when it is expected to happen twice but happens only once (rarely, but occurs as reported in previous emails). Anyway, the point here is just to understand how the record works so that i can plan my scans in a way that makes sense, so thanks for the explanation 🙂 > 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. From: Torsten Bögershausen <Torsten.Bogershausen at ess.eu>
Sent: 23 January 2023 14:43 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> Subject: Re: Weird behaviour in wait=True when using epics.Motor.get(something, something, wait=True) 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
Aviso Legal: Esta mensagem e seus anexos podem conter informações confidenciais e/ou de uso restrito. Observe atentamente seu conteúdo e considere eventual consulta ao remetente antes de copiá-la, divulgá-la ou distribuí-la. Se você recebeu esta mensagem por engano, por favor avise o remetente e apague-a imediatamente. Disclaimer: This email and its attachments may contain confidential and/or privileged information. Observe its content carefully and consider possible querying to the sender before copying, disclosing or distributing it. If you have received this email by mistake, please notify the sender and delete it immediately. |