EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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: Commands with synchronous answers from python
From: "Kasemir, Kay via Tech-talk" <tech-talk at aps.anl.gov>
To: "Neidherr, Dennis Dr." <D.Neidherr at gsi.de>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Mon, 26 Feb 2024 20:30:52 +0000
Hi: I may misunderstand, but when you say … I need a method to trigger the processing of a StreamDevice device in a python code, wait until the processing is done …, I see two parts to that. From the channel access client side, you can perform
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd

Hi:

 

I may misunderstand, but when you say … I need a method to trigger the processing of a StreamDevice device in a python code, wait until the processing is done …, I see two parts to that.

 

From the channel access client side, you can perform a “put callback” that writes to a record and waits until that record finishes processing.

From the command line, that would be something like

 

  caput -c -w 10 Variable 1

 

As Matt has shown, with pyepics it would be

 

    from epics import caput

    caput('Variable', 1, wait=True, timeout=10)

 

The thing is, however, that the server side needs to support that.

If you write to a motor record’s VAL field, the caput will indeed wait until the motor moved to the commanded position, maybe tried again if the error was too large etc., and completes once it did its best to reach the commanded position.

If you use stream device to simply write some setpoint to a device, the caput might wait until stream device sent that message out to the device, but not necessarily until the device did anything about that. If the device is a lakeshore temperature controller that’s asked to cool down from 300 to 30 Kelvin, that might take hours. You need database constructs which typically include the “busy” record to create logic that blocks until the device is indeed “done”. For an example see https://github.com/ornl-epics/lakeshore

That way you have a record that truly delays completion until the device reached the commanded state. You can then simply use the put-callback and you’ll know that the device is in the desired state once that put-callback completes.

 

-Kay

 


References:
Commands with synchronous answers from python Neidherr, Dennis Dr. via Tech-talk
Re: Commands with synchronous answers from python Érico Nogueira Rolim via Tech-talk
Re: Commands with synchronous answers from python Matthew Newville via Tech-talk

Navigate by Date:
Prev: Re: Commands with synchronous answers from python Matthew Newville via Tech-talk
Next: pvAccess assert error Mark Rivers via Tech-talk
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
Navigate by Thread:
Prev: Re: Commands with synchronous answers from python Matthew Newville via Tech-talk
Next: RE: Commands with synchronous answers from python Neidherr, Dennis Dr. via Tech-talk
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
ANJ, 29 Feb 2024 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·