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  <20232024  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  <20232024 
<== Date ==> <== Thread ==>

Subject: Re: [EXTERNAL] Scripts in Phoebus
From: "Kasemir, Kay via Tech-talk" <tech-talk at aps.anl.gov>
To: Florian Feldbauer <florian at ep1.ruhr-uni-bochum.de>, "tech-talk at aps.anl.gov" <tech-talk at aps.anl.gov>
Date: Wed, 9 Aug 2023 14:49:17 +0000

> it seems we can only  add 1 PV to the script executed by an Action Button.
> Is there any way to use more then 1 PV with scripts that should be executed via an Action Button?

> Also in another setup we have a small script that checks some configuration. When this script is executed a stack trace is visible in
the console showing the error "python not found".

Utility/console simply starts /usr/bin/python (configurable) and then you can send something line by line to it. Looks like you don’t have /usr/bin/python so need to add or configure that. Either way, totally unrelated to scripts running inside the GUI.

Buttons can start scripts in two ways:

  1. “Execute Script” action, a script that launched when pressing the button. Doesn’t receive any PVs, only the ‘widget’.
  2. “Script” attached to the widget and triggered by one or more PVs. Any widget can have that, not specific to button

If you want to have a script that has one or more PVs, AND trigger that via a button press:

Have button write 1 to loc://trigger(0)

Attach script to button (or really any widget) with PV loc://trigger(0) and maybe more PVs.

In the script, check if the loc://trigger(0) input is 1, and then do your thing, and reset the PV to 0 (which is a change in the PV and will once more trigger the script, but not do anything because you checked if the input is 1)

But in general, the better solution might be to have an IOC do what you want to do. Maybe an IOC implemented in python. In any case, you’ll then have a PV that you can write from a button or caput or PyQtDm or …, and it does what you want to do instead of adding control system logic into the GUI.



 

 


Replies:
Re: [EXTERNAL] Scripts in Phoebus Florian Feldbauer via Tech-talk
References:
Scripts in Phoebus Florian Feldbauer via Tech-talk

Navigate by Date:
Prev: Scripts in Phoebus Florian Feldbauer via Tech-talk
Next: Re: [EXTERNAL] Scripts in Phoebus Florian Feldbauer 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  <20232024 
Navigate by Thread:
Prev: Scripts in Phoebus Florian Feldbauer via Tech-talk
Next: Re: [EXTERNAL] Scripts in Phoebus Florian Feldbauer 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  <20232024 
ANJ, 09 Aug 2023 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·